Summary: --- /tmp/before 2007-01-30 13:12:53.000000000 -0200 +++ /tmp/after 2007-01-30 13:12:59.000000000 -0200 @@ -1,3 +1,5 @@ +/* moving fpu_counter(size=1) to after ioprio(offset=52, size=2, hole=2) */ + /* include2/asm/ptrace.h:34 */ struct task_struct { volatile long int state; @@ -13,8 +15,9 @@ struct list_head run_list; struct prio_array * array; short unsigned int ioprio; + unsigned char fpu_counter; - /* XXX 2 bytes hole, try to pack */ + /* XXX 1 byte hole, try to pack */ unsigned int btrace_seq; long unsigned int sleep_avg; @@ -88,10 +91,6 @@ /* XXX 31 bits hole, try to pack */ struct user_struct * user; - unsigned char fpu_counter; - - /* XXX 3 bytes hole, try to pack */ - int oomkilladj; char comm[16]; int link_count; @@ -104,8 +103,9 @@ /* XXX last struct has 8 bytes of padding */ - /* --- cacheline 17 boundary (1088 bytes) --- */ + /* --- cacheline 16 boundary (1024 bytes) was 60 bytes ago --- */ struct fs_struct * fs; + /* --- cacheline 17 boundary (1088 bytes) --- */ struct files_struct * files; struct nsproxy * nsproxy; struct signal_struct * signal; @@ -115,8 +115,8 @@ sigset_t saved_sigmask; struct sigpending pending; long unsigned int sas_ss_sp; - /* --- cacheline 18 boundary (1152 bytes) --- */ size_t sas_ss_size; + /* --- cacheline 18 boundary (1152 bytes) --- */ int (*notifier)(void *); void * notifier_data; sigset_t * notifier_mask; @@ -127,8 +127,8 @@ u32 self_exec_id; spinlock_t alloc_lock; spinlock_t pi_lock; - /* --- cacheline 19 boundary (1216 bytes) --- */ struct plist_head pi_waiters; + /* --- cacheline 19 boundary (1216 bytes) was 12 bytes ago --- */ struct rt_mutex_waiter * pi_blocked_on; void * journal_info; struct reclaim_state * reclaim_state; @@ -139,8 +139,8 @@ wait_queue_t * io_wait; u64 rchar; u64 wchar; - /* --- cacheline 20 boundary (1280 bytes) --- */ u64 syscr; + /* --- cacheline 20 boundary (1280 bytes) was 4 bytes ago --- */ u64 syscw; struct task_io_accounting ioac; struct robust_list_head * robust_list; @@ -149,8 +149,9 @@ atomic_t fs_excl; struct rcu_head rcu; struct pipe_inode_info * splice_pipe; -}; /* size: 1328, cachelines: 21 */ - /* sum members: 1319, holes: 3, sum holes: 9 */ +}; /* size: 1324, cachelines: 21 */ + /* sum members: 1319, holes: 3, sum holes: 5 */ /* bit holes: 2, sum bit holes: 62 bits */ /* paddings: 1, sum paddings: 8 */ - /* last cacheline: 48 bytes */ + /* last cacheline: 44 bytes */ + /* saved 4 bytes! */ ----------------------------------------------------------------------------------- Before: [acme@filo examples]$ pahole OUTPUT/qemu/linux-2.6/kernel/sched.o task_struct /* include2/asm/ptrace.h:34 */ struct task_struct { volatile long int state; /* 0 4 */ struct thread_info * thread_info; /* 4 4 */ atomic_t usage; /* 8 4 */ long unsigned int flags; /* 12 4 */ long unsigned int ptrace; /* 16 4 */ int lock_depth; /* 20 4 */ int load_weight; /* 24 4 */ int prio; /* 28 4 */ int static_prio; /* 32 4 */ int normal_prio; /* 36 4 */ struct list_head run_list; /* 40 8 */ struct prio_array * array; /* 48 4 */ short unsigned int ioprio; /* 52 2 */ /* XXX 2 bytes hole, try to pack */ unsigned int btrace_seq; /* 56 4 */ long unsigned int sleep_avg; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ long long unsigned int timestamp; /* 64 8 */ long long unsigned int last_ran; /* 72 8 */ long long unsigned int sched_time; /* 80 8 */ enum sleep_type sleep_type; /* 88 4 */ long unsigned int policy; /* 92 4 */ cpumask_t cpus_allowed; /* 96 4 */ unsigned int time_slice; /* 100 4 */ unsigned int first_time_slice; /* 104 4 */ struct list_head tasks; /* 108 8 */ struct list_head ptrace_children; /* 116 8 */ struct list_head ptrace_list; /* 124 8 */ /* --- cacheline 2 boundary (128 bytes) was 4 bytes ago --- */ struct mm_struct * mm; /* 132 4 */ struct mm_struct * active_mm; /* 136 4 */ struct linux_binfmt * binfmt; /* 140 4 */ long int exit_state; /* 144 4 */ int exit_code; /* 148 4 */ int exit_signal; /* 152 4 */ int pdeath_signal; /* 156 4 */ long unsigned int personality; /* 160 4 */ unsigned int did_exec:1; /* 164 4 */ /* XXX 31 bits hole, try to pack */ pid_t pid; /* 168 4 */ pid_t tgid; /* 172 4 */ struct task_struct * real_parent; /* 176 4 */ struct task_struct * parent; /* 180 4 */ struct list_head children; /* 184 8 */ /* --- cacheline 3 boundary (192 bytes) --- */ struct list_head sibling; /* 192 8 */ struct task_struct * group_leader; /* 200 4 */ struct pid_link pids[3]; /* 204 36 */ struct list_head thread_group; /* 240 8 */ struct completion * vfork_done; /* 248 4 */ int * set_child_tid; /* 252 4 */ /* --- cacheline 4 boundary (256 bytes) --- */ int * clear_child_tid; /* 256 4 */ long unsigned int rt_priority; /* 260 4 */ cputime_t utime; /* 264 4 */ cputime_t stime; /* 268 4 */ long unsigned int nvcsw; /* 272 4 */ long unsigned int nivcsw; /* 276 4 */ struct timespec start_time; /* 280 8 */ long unsigned int min_flt; /* 288 4 */ long unsigned int maj_flt; /* 292 4 */ cputime_t it_prof_expires; /* 296 4 */ cputime_t it_virt_expires; /* 300 4 */ long long unsigned int it_sched_expires; /* 304 8 */ struct list_head cpu_timers[3]; /* 312 24 */ /* --- cacheline 5 boundary (320 bytes) was 16 bytes ago --- */ uid_t uid; /* 336 4 */ uid_t euid; /* 340 4 */ uid_t suid; /* 344 4 */ uid_t fsuid; /* 348 4 */ gid_t gid; /* 352 4 */ gid_t egid; /* 356 4 */ gid_t sgid; /* 360 4 */ gid_t fsgid; /* 364 4 */ struct group_info * group_info; /* 368 4 */ kernel_cap_t cap_effective; /* 372 4 */ kernel_cap_t cap_inheritable; /* 376 4 */ kernel_cap_t cap_permitted; /* 380 4 */ /* --- cacheline 6 boundary (384 bytes) --- */ unsigned int keep_capabilities:1; /* 384 4 */ /* XXX 31 bits hole, try to pack */ struct user_struct * user; /* 388 4 */ unsigned char fpu_counter; /* 392 1 */ /* XXX 3 bytes hole, try to pack */ int oomkilladj; /* 396 4 */ char comm[16]; /* 400 16 */ int link_count; /* 416 4 */ int total_link_count; /* 420 4 */ struct sysv_sem sysvsem; /* 424 4 */ /* XXX 4 bytes hole, try to pack */ struct thread_struct thread; /* 432 656 */ /* XXX last struct has 8 bytes of padding */ /* --- cacheline 17 boundary (1088 bytes) --- */ struct fs_struct * fs; /* 1088 4 */ struct files_struct * files; /* 1092 4 */ struct nsproxy * nsproxy; /* 1096 4 */ struct signal_struct * signal; /* 1100 4 */ struct sighand_struct * sighand; /* 1104 4 */ sigset_t blocked; /* 1108 8 */ sigset_t real_blocked; /* 1116 8 */ sigset_t saved_sigmask; /* 1124 8 */ struct sigpending pending; /* 1132 16 */ long unsigned int sas_ss_sp; /* 1148 4 */ /* --- cacheline 18 boundary (1152 bytes) --- */ size_t sas_ss_size; /* 1152 4 */ int (*notifier)(void *); /* 1156 4 */ void * notifier_data; /* 1160 4 */ sigset_t * notifier_mask; /* 1164 4 */ void * security; /* 1168 4 */ struct audit_context * audit_context; /* 1172 4 */ seccomp_t seccomp; /* 1176 0 */ u32 parent_exec_id; /* 1176 4 */ u32 self_exec_id; /* 1180 4 */ spinlock_t alloc_lock; /* 1184 16 */ spinlock_t pi_lock; /* 1200 16 */ /* --- cacheline 19 boundary (1216 bytes) --- */ struct plist_head pi_waiters; /* 1216 16 */ struct rt_mutex_waiter * pi_blocked_on; /* 1232 4 */ void * journal_info; /* 1236 4 */ struct reclaim_state * reclaim_state; /* 1240 4 */ struct backing_dev_info * backing_dev_info; /* 1244 4 */ struct io_context * io_context; /* 1248 4 */ long unsigned int ptrace_message; /* 1252 4 */ siginfo_t * last_siginfo; /* 1256 4 */ wait_queue_t * io_wait; /* 1260 4 */ u64 rchar; /* 1264 8 */ u64 wchar; /* 1272 8 */ /* --- cacheline 20 boundary (1280 bytes) --- */ u64 syscr; /* 1280 8 */ u64 syscw; /* 1288 8 */ struct task_io_accounting ioac; /* 1296 0 */ struct robust_list_head * robust_list; /* 1296 4 */ struct list_head pi_state_list; /* 1300 8 */ struct futex_pi_state * pi_state_cache; /* 1308 4 */ atomic_t fs_excl; /* 1312 4 */ struct rcu_head rcu; /* 1316 8 */ struct pipe_inode_info * splice_pipe; /* 1324 4 */ }; /* size: 1328, cachelines: 21 */ /* sum members: 1319, holes: 3, sum holes: 9 */ /* bit holes: 2, sum bit holes: 62 bits */ /* paddings: 1, sum paddings: 8 */ /* last cacheline: 48 bytes */ ----------------------------------------------------------------------------------- After: [acme@filo examples]$ pahole -kV OUTPUT/qemu/linux-2.6/kernel/sched.o task_struct /* moving fpu_counter(size=1) to after ioprio(offset=52, size=2, hole=2) */ /* include2/asm/ptrace.h:34 */ struct task_struct { volatile long int state; /* 0 4 */ struct thread_info * thread_info; /* 4 4 */ atomic_t usage; /* 8 4 */ long unsigned int flags; /* 12 4 */ long unsigned int ptrace; /* 16 4 */ int lock_depth; /* 20 4 */ int load_weight; /* 24 4 */ int prio; /* 28 4 */ int static_prio; /* 32 4 */ int normal_prio; /* 36 4 */ struct list_head run_list; /* 40 8 */ struct prio_array * array; /* 48 4 */ short unsigned int ioprio; /* 52 2 */ unsigned char fpu_counter; /* 54 1 */ /* XXX 1 byte hole, try to pack */ unsigned int btrace_seq; /* 56 4 */ long unsigned int sleep_avg; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ long long unsigned int timestamp; /* 64 8 */ long long unsigned int last_ran; /* 72 8 */ long long unsigned int sched_time; /* 80 8 */ enum sleep_type sleep_type; /* 88 4 */ long unsigned int policy; /* 92 4 */ cpumask_t cpus_allowed; /* 96 4 */ unsigned int time_slice; /* 100 4 */ unsigned int first_time_slice; /* 104 4 */ struct list_head tasks; /* 108 8 */ struct list_head ptrace_children; /* 116 8 */ struct list_head ptrace_list; /* 124 8 */ /* --- cacheline 2 boundary (128 bytes) was 4 bytes ago --- */ struct mm_struct * mm; /* 132 4 */ struct mm_struct * active_mm; /* 136 4 */ struct linux_binfmt * binfmt; /* 140 4 */ long int exit_state; /* 144 4 */ int exit_code; /* 148 4 */ int exit_signal; /* 152 4 */ int pdeath_signal; /* 156 4 */ long unsigned int personality; /* 160 4 */ unsigned int did_exec:1; /* 164 4 */ /* XXX 31 bits hole, try to pack */ pid_t pid; /* 168 4 */ pid_t tgid; /* 172 4 */ struct task_struct * real_parent; /* 176 4 */ struct task_struct * parent; /* 180 4 */ struct list_head children; /* 184 8 */ /* --- cacheline 3 boundary (192 bytes) --- */ struct list_head sibling; /* 192 8 */ struct task_struct * group_leader; /* 200 4 */ struct pid_link pids[3]; /* 204 36 */ struct list_head thread_group; /* 240 8 */ struct completion * vfork_done; /* 248 4 */ int * set_child_tid; /* 252 4 */ /* --- cacheline 4 boundary (256 bytes) --- */ int * clear_child_tid; /* 256 4 */ long unsigned int rt_priority; /* 260 4 */ cputime_t utime; /* 264 4 */ cputime_t stime; /* 268 4 */ long unsigned int nvcsw; /* 272 4 */ long unsigned int nivcsw; /* 276 4 */ struct timespec start_time; /* 280 8 */ long unsigned int min_flt; /* 288 4 */ long unsigned int maj_flt; /* 292 4 */ cputime_t it_prof_expires; /* 296 4 */ cputime_t it_virt_expires; /* 300 4 */ long long unsigned int it_sched_expires; /* 304 8 */ struct list_head cpu_timers[3]; /* 312 24 */ /* --- cacheline 5 boundary (320 bytes) was 16 bytes ago --- */ uid_t uid; /* 336 4 */ uid_t euid; /* 340 4 */ uid_t suid; /* 344 4 */ uid_t fsuid; /* 348 4 */ gid_t gid; /* 352 4 */ gid_t egid; /* 356 4 */ gid_t sgid; /* 360 4 */ gid_t fsgid; /* 364 4 */ struct group_info * group_info; /* 368 4 */ kernel_cap_t cap_effective; /* 372 4 */ kernel_cap_t cap_inheritable; /* 376 4 */ kernel_cap_t cap_permitted; /* 380 4 */ /* --- cacheline 6 boundary (384 bytes) --- */ unsigned int keep_capabilities:1; /* 384 4 */ /* XXX 31 bits hole, try to pack */ struct user_struct * user; /* 388 4 */ int oomkilladj; /* 392 4 */ char comm[16]; /* 396 16 */ int link_count; /* 412 4 */ int total_link_count; /* 416 4 */ struct sysv_sem sysvsem; /* 420 4 */ /* XXX 4 bytes hole, try to pack */ struct thread_struct thread; /* 428 656 */ /* XXX last struct has 8 bytes of padding */ /* --- cacheline 16 boundary (1024 bytes) was 60 bytes ago --- */ struct fs_struct * fs; /* 1084 4 */ /* --- cacheline 17 boundary (1088 bytes) --- */ struct files_struct * files; /* 1088 4 */ struct nsproxy * nsproxy; /* 1092 4 */ struct signal_struct * signal; /* 1096 4 */ struct sighand_struct * sighand; /* 1100 4 */ sigset_t blocked; /* 1104 8 */ sigset_t real_blocked; /* 1112 8 */ sigset_t saved_sigmask; /* 1120 8 */ struct sigpending pending; /* 1128 16 */ long unsigned int sas_ss_sp; /* 1144 4 */ size_t sas_ss_size; /* 1148 4 */ /* --- cacheline 18 boundary (1152 bytes) --- */ int (*notifier)(void *); /* 1152 4 */ void * notifier_data; /* 1156 4 */ sigset_t * notifier_mask; /* 1160 4 */ void * security; /* 1164 4 */ struct audit_context * audit_context; /* 1168 4 */ seccomp_t seccomp; /* 1172 0 */ u32 parent_exec_id; /* 1172 4 */ u32 self_exec_id; /* 1176 4 */ spinlock_t alloc_lock; /* 1180 16 */ spinlock_t pi_lock; /* 1196 16 */ struct plist_head pi_waiters; /* 1212 16 */ /* --- cacheline 19 boundary (1216 bytes) was 12 bytes ago --- */ struct rt_mutex_waiter * pi_blocked_on; /* 1228 4 */ void * journal_info; /* 1232 4 */ struct reclaim_state * reclaim_state; /* 1236 4 */ struct backing_dev_info * backing_dev_info; /* 1240 4 */ struct io_context * io_context; /* 1244 4 */ long unsigned int ptrace_message; /* 1248 4 */ siginfo_t * last_siginfo; /* 1252 4 */ wait_queue_t * io_wait; /* 1256 4 */ u64 rchar; /* 1260 8 */ u64 wchar; /* 1268 8 */ u64 syscr; /* 1276 8 */ /* --- cacheline 20 boundary (1280 bytes) was 4 bytes ago --- */ u64 syscw; /* 1284 8 */ struct task_io_accounting ioac; /* 1292 0 */ struct robust_list_head * robust_list; /* 1292 4 */ struct list_head pi_state_list; /* 1296 8 */ struct futex_pi_state * pi_state_cache; /* 1304 4 */ atomic_t fs_excl; /* 1308 4 */ struct rcu_head rcu; /* 1312 8 */ struct pipe_inode_info * splice_pipe; /* 1320 4 */ }; /* size: 1324, cachelines: 21 */ /* sum members: 1319, holes: 3, sum holes: 5 */ /* bit holes: 2, sum bit holes: 62 bits */ /* paddings: 1, sum paddings: 8 */ /* last cacheline: 44 bytes */ /* saved 4 bytes! */