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 */
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-02-12 11:59:59 +01:00
parent ef3fc326b9
commit 8c2524c7fd
+12 -10
View File
@@ -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;