mbox series

[bpf,v2,0/2] Wait for busy refill_work when destroying bpf memory allocator

Message ID 20221021114913.60508-1-houtao@huaweicloud.com (mailing list archive)
Headers show
Series Wait for busy refill_work when destroying bpf memory allocator | expand

Message

Hou Tao Oct. 21, 2022, 11:49 a.m. UTC
From: Hou Tao <houtao1@huawei.com>

Hi,

The patchset aims to fix one problem of bpf memory allocator destruction
when there is PREEMPT_RT kernel or kernel with arch_irq_work_has_interrupt()
being false (e.g. 1-cpu arm32 host or mips). The root cause is that
there may be busy refill_work when the allocator is destroying and it
may incur oops or other problems as shown in patch #1. Patch #1 fixes
the problem by waiting for the completion of irq work during destroying
and patch #2 is just a clean-up patch based on patch #1. Please see
individual patches for more details.

Comments are always welcome.

Change Log:
v2:
  * patch 1: fix typos and add notes about the overhead of irq_work_sync()
  * patch 1 & 2: add Acked-by tags from sdf@google.com

v1: https://lore.kernel.org/bpf/20221019115539.983394-1-houtao@huaweicloud.com/T/#t

Hou Tao (2):
  bpf: Wait for busy refill_work when destroying bpf memory allocator
  bpf: Use __llist_del_all() whenever possbile during memory draining

 kernel/bpf/memalloc.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 22, 2022, 2:30 a.m. UTC | #1
Hello:

This series was applied to bpf/bpf.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Fri, 21 Oct 2022 19:49:11 +0800 you wrote:
> From: Hou Tao <houtao1@huawei.com>
> 
> Hi,
> 
> The patchset aims to fix one problem of bpf memory allocator destruction
> when there is PREEMPT_RT kernel or kernel with arch_irq_work_has_interrupt()
> being false (e.g. 1-cpu arm32 host or mips). The root cause is that
> there may be busy refill_work when the allocator is destroying and it
> may incur oops or other problems as shown in patch #1. Patch #1 fixes
> the problem by waiting for the completion of irq work during destroying
> and patch #2 is just a clean-up patch based on patch #1. Please see
> individual patches for more details.
> 
> [...]

Here is the summary with links:
  - [bpf,v2,1/2] bpf: Wait for busy refill_work when destroying bpf memory allocator
    https://git.kernel.org/bpf/bpf/c/3d05818707bb
  - [bpf,v2,2/2] bpf: Use __llist_del_all() whenever possbile during memory draining
    https://git.kernel.org/bpf/bpf/c/fa4447cb73b2

You are awesome, thank you!