Cleanup the unused members of dns_slabheader_t

After the rdataslab -> rdataslab,rdatavec split, there were couple of
unused struct members.  Remove all the unused members, reorder the
members to eliminate the padding holes and thus reduce the
dns_slabheader_t and dns_slabtop_t structure sizes.
This commit is contained in:
Ondřej Surý 2025-12-16 11:43:34 +01:00
parent 3a4ad1fd12
commit aaf3454079
No known key found for this signature in database
GPG key ID: 2820F37E873DEA41
2 changed files with 10 additions and 17 deletions

View file

@ -77,14 +77,13 @@ struct dns_slabtop {
struct cds_list_head types_link;
struct cds_list_head headers;
dns_typepair_t typepair;
dns_slabtop_t *related;
/*% Used for SIEVE-LRU (cache) and changed_list (zone) */
ISC_LINK(struct dns_slabtop) link;
/*% Used for SIEVE-LRU */
dns_typepair_t typepair;
/*% Used for SIEVE-LRU (cache) */
bool visited;
ISC_LINK(struct dns_slabtop) link;
};
struct dns_slabheader {
@ -94,21 +93,15 @@ struct dns_slabheader {
/*%
* Locked by the owning node's lock.
*/
uint32_t serial;
union {
isc_stdtime_t expire;
dns_ttl_t ttl;
};
isc_stdtime_t expire;
dns_typepair_t typepair;
/* resigning (zone) and TTL-cleaning (cache) */
uint16_t resign_lsb : 1;
isc_stdtime_t resign;
isc_heap_t *heap;
unsigned int heap_index;
/* TTL-cleaning (cache) */
unsigned int heap_index;
isc_heap_t *heap;
/* Used for stale refresh */
_Atomic(uint32_t) last_refresh_fail_ts;
_Atomic(isc_stdtime_t) last_refresh_fail_ts;
dns_slabheader_proof_t *noqname;
dns_slabheader_proof_t *closest;

View file

@ -110,7 +110,7 @@ newslab(dns_rdataset_t *rdataset, isc_mem_t *mctx, isc_region_t *region,
*header = (dns_slabheader_t){
.headers_link = CDS_LIST_HEAD_INIT(header->headers_link),
.trust = rdataset->trust,
.ttl = rdataset->ttl,
.expire = rdataset->ttl,
.dirtylink = ISC_LINK_INITIALIZER,
};