xen: credit2: rearrange members of control structures
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 23 Jun 2017 10:55:12 +0000 (12:55 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 21 Jul 2017 17:22:05 +0000 (18:22 +0100)
commit9cd8620bc088e429d5603550a82f0ac3865d5b82
tree43100d5a0fedd0da89a2f39b35b3a46b1ce071e9
parente371d3587bb2b2fa08de3a3560b3fe7a8c1e02ec
xen: credit2: 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.

csched2_runqueue_data:
 * Before:
    size: 216, cachelines: 4, members: 14
    sum members: 208, holes: 2, sum holes: 8
    last cacheline: 24 bytes
 * After:
    size: 208, cachelines: 4, members: 14
    last cacheline: 16 bytes

csched2_private:
 * Before:
    size: 120, cachelines: 2, members: 8
    sum members: 112, holes: 1, sum holes: 4
    padding: 4
    last cacheline: 56 bytes
 * After:
    size: 112, cachelines: 2, members: 8
    last cacheline: 48 bytes

csched2_vcpu:
 * Before:
    size: 112, cachelines: 2, members: 14
    sum members: 108, holes: 1, sum holes: 4
    last cacheline: 48 bytes
 * After:
    size: 112, cachelines: 2, members: 14
    padding: 4
    last cacheline: 48 bytes

While there, improve the wording, style and alignment
of comments too.

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