xen: credit: rearrange members of control structures
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 23 Jun 2017 10:55:05 +0000 (12:55 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 21 Jul 2017 17:22:03 +0000 (18:22 +0100)
commite371d3587bb2b2fa08de3a3560b3fe7a8c1e02ec
tree0f194120c1a3b8a6d358012ac82b7b3ca332c0c5
parenta2c4e5ab59db83a5a580b380864c44d57c9a739b
xen: credit: rearrange members of control structures

With the aim of improving memory size and layout, and
at the same time trying to put related fields reside
in the same cacheline.

Here's a summary of the output of `pahole`, with and
without this patch, for the affected data structures.

csched_pcpu:
 * Before:
    size: 88, cachelines: 2, members: 6
    sum members: 80, holes: 1, sum holes: 4
    padding: 4
    paddings: 1, sum paddings: 5
    last cacheline: 24 bytes
 * After:
    size: 80, cachelines: 2, members: 6
    paddings: 1, sum paddings: 5
    last cacheline: 16 bytes

csched_vcpu:
 * Before:
    size: 72, cachelines: 2, members: 9
    padding: 2
    last cacheline: 8 bytes
 * After:
    same numbers, but move some fields to put
    related fields in same cache line.

csched_private:
 * Before:
    size: 152, cachelines: 3, members: 17
    sum members: 140, holes: 2, sum holes: 8
    padding: 4
    paddings: 1, sum paddings: 5
    last cacheline: 24 bytes
 * After:
    same numbers, but move some fields to put
    related fields in same cache line.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit.c