From: Zbigniew Jędrzejewski-Szmek Date: Wed, 10 Feb 2021 16:32:31 +0000 (+0100) Subject: core: pahole optimization of struct Unit X-Git-Tag: v248-rc1~115^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c2524c7fdb46d801594030504c6059afcde89fa;p=thirdparty%2Fsystemd.git core: pahole optimization of struct Unit We had a lone 'bool job_running_timeout_set:1', which generated a hole. Let's move things around a bit. The structure is a tiny bit smaller and has less holes: /* size: 1192, cachelines: 19, members: 149 */ /* sum members: 1175, holes: 3, sum holes: 11 */ /* sum bitfield members: 27 bits, bit holes: 1, sum bit holes: 7 bits */ /* bit_padding: 14 bits */ /* last cacheline: 40 bytes */ /* size: 1184, cachelines: 19, members: 149 */ /* sum members: 1175, holes: 1, sum holes: 4 */ /* sum bitfield members: 27 bits (3 bytes) */ /* bit_padding: 13 bits */ /* last cacheline: 32 bytes */ --- diff --git a/src/core/unit.h b/src/core/unit.h index 1af0e50312f..457eba44a13 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -120,9 +120,6 @@ typedef struct Unit { UnitLoadState load_state; Unit *merged_into; - FreezerState freezer_state; - sd_bus_message *pending_freezer_message; - char *id; /* The one special name that we use for identification */ char *instance; @@ -150,6 +147,16 @@ typedef struct Unit { /* If this is a transient unit we are currently writing, this is where we are writing it to */ FILE *transient_file; + /* Freezer state */ + sd_bus_message *pending_freezer_message; + FreezerState freezer_state; + + /* Job timeout and action to take */ + EmergencyAction job_timeout_action; + usec_t job_timeout; + usec_t job_running_timeout; + char *job_timeout_reboot_arg; + /* If there is something to do with this unit, then this is the installed job for it */ Job *job; @@ -164,13 +171,6 @@ typedef struct Unit { sd_bus_track *bus_track; char **deserialized_refs; - /* Job timeout and action to take */ - usec_t job_timeout; - usec_t job_running_timeout; - bool job_running_timeout_set:1; - EmergencyAction job_timeout_action; - char *job_timeout_reboot_arg; - /* References to this */ LIST_HEAD(UnitRef, refs_by_target); @@ -359,6 +359,8 @@ typedef struct Unit { bool sent_dbus_new_signal:1; + bool job_running_timeout_set:1; + bool in_audit:1; bool on_console:1;