* Re: [PATCH] rhashtable: Use irq work for shrinking
2026-06-04 2:17 ` [PATCH] rhashtable: Use irq work for shrinking Herbert Xu
@ 2026-06-04 10:47 ` Mykyta Yatsenko
2026-06-05 15:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Mykyta Yatsenko @ 2026-06-04 10:47 UTC (permalink / raw)
To: Herbert Xu
Cc: bot+bpf-ci, bpf, ast, andrii, daniel, kafai, kernel-team, eddyz87,
memxor, yatsenko, martin.lau, yonghong.song, clm, ihor.solodrai,
Tejun Heo, Linux Crypto Mailing List
On 6/4/26 3:17 AM, Herbert Xu wrote:
> On Wed, Jun 03, 2026 at 02:08:25PM +0100, Mykyta Yatsenko wrote:
>>
>> For v7 I'm dropping automatic_shrinking, because it adds a risk of
>> calling schedule_work() on element deletion path (__rhashtable_remove_fast_one())
>> when hashtable size drops below 30% of the capacity.
>
> Now that expansion uses irq work I think shrinking should switch
> to that as well.
>
Makes sense, thanks, I'll include your patch below in this series then.
> ---8<---
> Use irq work for automatic shrinking so that this may be called
> in NMI context.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
> index ef5230cece36..0693bce6f890 100644
> --- a/include/linux/rhashtable.h
> +++ b/include/linux/rhashtable.h
> @@ -1117,7 +1117,7 @@ static __always_inline int __rhashtable_remove_fast_one(
> atomic_dec(&ht->nelems);
> if (unlikely(ht->p.automatic_shrinking &&
> rht_shrink_below_30(ht, tbl)))
> - schedule_work(&ht->run_work);
> + irq_work_queue(&ht->run_irq_work);
> err = 0;
> }
>
> Cheers,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rhashtable: Use irq work for shrinking
2026-06-04 2:17 ` [PATCH] rhashtable: Use irq work for shrinking Herbert Xu
2026-06-04 10:47 ` Mykyta Yatsenko
@ 2026-06-05 15:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-06-05 15:10 UTC (permalink / raw)
To: Herbert Xu
Cc: mykyta.yatsenko5, bot+bpf-ci, bpf, ast, andrii, daniel, kafai,
kernel-team, eddyz87, memxor, yatsenko, martin.lau, yonghong.song,
clm, ihor.solodrai, tj, linux-crypto
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Thu, 4 Jun 2026 10:17:52 +0800 you wrote:
> On Wed, Jun 03, 2026 at 02:08:25PM +0100, Mykyta Yatsenko wrote:
> >
> > For v7 I'm dropping automatic_shrinking, because it adds a risk of
> > calling schedule_work() on element deletion path (__rhashtable_remove_fast_one())
> > when hashtable size drops below 30% of the capacity.
>
> Now that expansion uses irq work I think shrinking should switch
> to that as well.
>
> [...]
Here is the summary with links:
- rhashtable: Use irq work for shrinking
https://git.kernel.org/bpf/bpf-next/c/46730ee6e884
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread