[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <875ym2zx9v.fsf@cloudflare.com>
Date: Wed, 18 May 2022 16:16:08 +0100
From: Jakub Sitnicki <jakub@...udflare.com>
To: Stanislav Fomichev <sdf@...gle.com>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org
Subject: Re: [PATCH bpf-next v6 02/10] bpf: convert cgroup_bpf.progs to hlist
On Fri, Apr 29, 2022 at 02:15 PM -07, Stanislav Fomichev wrote:
> This lets us reclaim some space to be used by new cgroup lsm slots.
>
> Before:
> struct cgroup_bpf {
> struct bpf_prog_array * effective[23]; /* 0 184 */
> /* --- cacheline 2 boundary (128 bytes) was 56 bytes ago --- */
> struct list_head progs[23]; /* 184 368 */
> /* --- cacheline 8 boundary (512 bytes) was 40 bytes ago --- */
> u32 flags[23]; /* 552 92 */
>
> /* XXX 4 bytes hole, try to pack */
>
> /* --- cacheline 10 boundary (640 bytes) was 8 bytes ago --- */
> struct list_head storages; /* 648 16 */
> struct bpf_prog_array * inactive; /* 664 8 */
> struct percpu_ref refcnt; /* 672 16 */
> struct work_struct release_work; /* 688 32 */
>
> /* size: 720, cachelines: 12, members: 7 */
> /* sum members: 716, holes: 1, sum holes: 4 */
> /* last cacheline: 16 bytes */
> };
>
> After:
> struct cgroup_bpf {
> struct bpf_prog_array * effective[23]; /* 0 184 */
> /* --- cacheline 2 boundary (128 bytes) was 56 bytes ago --- */
> struct hlist_head progs[23]; /* 184 184 */
> /* --- cacheline 5 boundary (320 bytes) was 48 bytes ago --- */
> u8 flags[23]; /* 368 23 */
>
> /* XXX 1 byte hole, try to pack */
>
> /* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */
> struct list_head storages; /* 392 16 */
> struct bpf_prog_array * inactive; /* 408 8 */
> struct percpu_ref refcnt; /* 416 16 */
> struct work_struct release_work; /* 432 72 */
>
> /* size: 504, cachelines: 8, members: 7 */
> /* sum members: 503, holes: 1, sum holes: 1 */
> /* last cacheline: 56 bytes */
> };
>
> Suggested-by: Jakub Sitnicki <jakub@...udflare.com>
> Signed-off-by: Stanislav Fomichev <sdf@...gle.com>
> ---
Reviewed-by: Jakub Sitnicki <jakub@...udflare.com>
Powered by blists - more mailing lists