Re: [PATCH v4 00/12] mm: make userland page table freeing RCU-safe
From: Matthew Wilcox
Date: Tue Sep 22 2026 - 12:47:13 EST
On Tue, Sep 22, 2026 at 04:35:31PM +0100, Lorenzo Stoakes (ARM) wrote:
> m68k-motorola required the biggest change - since RCU page table freeing
> uses call_rcu(), this means page table freeing can arise from softirq
> context.
>
> This was fixed with an IRQ-safe spin lock used in both get_pointer_table()
> and free_pointer_table().
You don't need to use an irq-safe spinlock for softirqs. It does work,
but it's overkill since it disables hardirqs. If you use spin_lock_bh(),
only softirqs are prevented from running (and it's safe to call
spin_lock_bh() when in softirq context, just like it's safe to call
spin_lock_irqsave() in hardirq or softirq context).