summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-05-14 17:28:48 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-05-14 17:28:48 +0200
commit9aeb1a541bbb08616af1b4e5495d4bd4bfed6490 (patch)
treec9c352e584b4f205a3e9357e585cd9ee7c647a05 /src
parentresolved: rearrange DnsResourceRecord for better layout (diff)
downloadsystemd-9aeb1a541bbb08616af1b4e5495d4bd4bfed6490.tar.xz
systemd-9aeb1a541bbb08616af1b4e5495d4bd4bfed6490.zip
resolved: optimize layout of DnsTransaction
/* size: 296, cachelines: 5, members: 46 */ /* sum members: 278, holes: 5, sum holes: 17 */ /* sum bitfield members: 4 bits, bit holes: 1, sum bit holes: 4 bits */ ↓ /* size: 280, cachelines: 5, members: 46 */ /* sum members: 278, holes: 1, sum holes: 1 */ /* sum bitfield members: 4 bits, bit holes: 1, sum bit holes: 4 bits */
Diffstat (limited to 'src')
-rw-r--r--src/resolve/resolved-dns-transaction.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/resolve/resolved-dns-transaction.h b/src/resolve/resolved-dns-transaction.h
index c2d73cbedc..498cabb7e5 100644
--- a/src/resolve/resolved-dns-transaction.h
+++ b/src/resolve/resolved-dns-transaction.h
@@ -57,17 +57,6 @@ struct DnsTransaction {
uint64_t query_flags;
- DnsTransactionState state;
-
- uint16_t id;
-
- bool tried_stream:1;
-
- bool initial_jitter_scheduled:1;
- bool initial_jitter_elapsed:1;
-
- bool probing:1;
-
DnsPacket *sent, *received;
DnsAnswer *answer;
@@ -77,6 +66,8 @@ struct DnsTransaction {
uint32_t answer_nsec_ttl;
int answer_errno; /* if state is DNS_TRANSACTION_ERRNO */
+ DnsTransactionState state;
+
/* SD_RESOLVED_AUTHENTICATED here indicates whether the primary answer is authenticated, i.e. whether
* the RRs from answer which directly match the question are authenticated, or, if there are none,
* whether the NODATA or NXDOMAIN case is. It says nothing about additional RRs listed in the answer,
@@ -93,8 +84,6 @@ struct DnsTransaction {
sd_event_source *timeout_event_source;
unsigned n_attempts;
- unsigned n_picked_servers;
-
/* UDP connection logic, if we need it */
int dns_udp_fd;
sd_event_source *dns_udp_event_source;
@@ -114,6 +103,15 @@ struct DnsTransaction {
DnsServerFeatureLevel clamp_feature_level_servfail;
DnsServerFeatureLevel clamp_feature_level_nxdomain;
+ uint16_t id;
+
+ bool tried_stream:1;
+
+ bool initial_jitter_scheduled:1;
+ bool initial_jitter_elapsed:1;
+
+ bool probing:1;
+
/* Query candidates this transaction is referenced by and that
* shall be notified about this specific transaction
* completing. */
@@ -133,11 +131,15 @@ struct DnsTransaction {
* created in order to request DNSKEY or DS RRs. */
Set *dnssec_transactions;
+ unsigned n_picked_servers;
+
unsigned block_gc;
LIST_FIELDS(DnsTransaction, transactions_by_scope);
LIST_FIELDS(DnsTransaction, transactions_by_stream);
LIST_FIELDS(DnsTransaction, transactions_by_key);
+
+ /* Note: fields should be ordered to minimize alignment gaps. Use pahole! */
};
int dns_transaction_new(DnsTransaction **ret, DnsScope *s, DnsResourceKey *key, DnsPacket *bypass, uint64_t flags);