[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f63e161a-9189-9ca9-cae4-0ca34345e7f0@huaweicloud.com>
Date: Wed, 28 Jun 2023 14:18:01 +0800
From: Hou Tao <houtao@...weicloud.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: tj@...nel.org, rcu@...r.kernel.org, netdev@...r.kernel.org,
bpf@...r.kernel.org, kernel-team@...com, daniel@...earbox.net,
andrii@...nel.org, void@...ifault.com, paulmck@...nel.org
Subject: Re: [PATCH v3 bpf-next 03/13] bpf: Let free_all() return the number
of freed elements.
On 6/28/2023 9:56 AM, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@...nel.org>
>
> Let free_all() helper return the number of freed elements.
> It's not used in this patch, but helps in debug/development of bpf_mem_alloc.
>
> For example this diff for __free_rcu():
> - free_all(llist_del_all(&c->waiting_for_gp_ttrace), !!c->percpu_size);
> + printk("cpu %d freed %d objs after tasks trace\n", raw_smp_processor_id(),
> + free_all(llist_del_all(&c->waiting_for_gp_ttrace), !!c->percpu_size));
>
> would show how busy RCU tasks trace is.
> In artificial benchmark where one cpu is allocating and different cpu is freeing
> the RCU tasks trace won't be able to keep up and the list of objects
> would keep growing from thousands to millions and eventually OOMing.
>
> Signed-off-by: Alexei Starovoitov <ast@...nel.org>
Acked-by: Hou Tao <houtao1@...wei.com>
Powered by blists - more mailing lists