Re: [RFC] vmstat: Avoid waking up idle-cpu to service shepherd work

From: Peter Zijlstra
Date: Mon Mar 30 2015 - 12:25:40 EST


On Mon, Mar 30, 2015 at 09:47:01PM +0530, Viresh Kumar wrote:
> And all I get it is 8256 bytes, with or without the change.

Duh, rounded up to cacheline boundary ;-)

Trades two 4 byte holes at the start for a bigger 'hole' at the end.

struct tvec_base {
spinlock_t lock; /* 0 2 */

/* XXX 6 bytes hole, try to pack */

struct timer_list * running_timer; /* 8 8 */
long unsigned int timer_jiffies; /* 16 8 */
long unsigned int next_timer; /* 24 8 */
long unsigned int active_timers; /* 32 8 */
long unsigned int all_timers; /* 40 8 */
int cpu; /* 48 4 */

/* XXX 4 bytes hole, try to pack */

struct tvec_root tv1; /* 56 4096 */
/* --- cacheline 64 boundary (4096 bytes) was 56 bytes ago --- */
struct tvec tv2; /* 4152 1024 */
/* --- cacheline 80 boundary (5120 bytes) was 56 bytes ago --- */
struct tvec tv3; /* 5176 1024 */
/* --- cacheline 96 boundary (6144 bytes) was 56 bytes ago --- */
struct tvec tv4; /* 6200 1024 */
/* --- cacheline 112 boundary (7168 bytes) was 56 bytes ago --- */
struct tvec tv5; /* 7224 1024 */
/* --- cacheline 128 boundary (8192 bytes) was 56 bytes ago --- */

/* size: 8256, cachelines: 129, members: 12 */
/* sum members: 8238, holes: 2, sum holes: 10 */
/* padding: 8 */
};

vs

struct tvec_base {
spinlock_t lock; /* 0 2 */

/* XXX 2 bytes hole, try to pack */

int cpu; /* 4 4 */
struct timer_list * running_timer; /* 8 8 */
long unsigned int timer_jiffies; /* 16 8 */
long unsigned int next_timer; /* 24 8 */
long unsigned int active_timers; /* 32 8 */
long unsigned int all_timers; /* 40 8 */
struct tvec_root tv1; /* 48 4096 */
/* --- cacheline 64 boundary (4096 bytes) was 48 bytes ago --- */
struct tvec tv2; /* 4144 1024 */
/* --- cacheline 80 boundary (5120 bytes) was 48 bytes ago --- */
struct tvec tv3; /* 5168 1024 */
/* --- cacheline 96 boundary (6144 bytes) was 48 bytes ago --- */
struct tvec tv4; /* 6192 1024 */
/* --- cacheline 112 boundary (7168 bytes) was 48 bytes ago --- */
struct tvec tv5; /* 7216 1024 */
/* --- cacheline 128 boundary (8192 bytes) was 48 bytes ago --- */

/* size: 8256, cachelines: 129, members: 12 */
/* sum members: 8238, holes: 1, sum holes: 2 */
/* padding: 16 */
};
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/