[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220616195944.dev72axh7prwnfh7@kafai-mbp>
Date: Thu, 16 Jun 2022 12:59:44 -0700
From: Martin KaFai Lau <kafai@...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,
Jakub Sitnicki <jakub@...udflare.com>
Subject: Re: [PATCH bpf-next v9 02/10] bpf: convert cgroup_bpf.progs to hlist
On Fri, Jun 10, 2022 at 09:57:55AM -0700, 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>
> Reviewed-by: Jakub Sitnicki <jakub@...udflare.com>
> Signed-off-by: Stanislav Fomichev <sdf@...gle.com>
Reviewed-by: Martin KaFai Lau <kafai@...com>
Powered by blists - more mailing lists