Re: [PATCH v10 09/12] x86/mm: enable broadcast TLB invalidation for multi-threaded processes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 11 Feb 2025 at 22:09, Rik van Riel <riel@xxxxxxxxxxx> wrote:
> +       /* Transition from global->local ASID does not currently happen. */
> +       if (!global_asid && is_global_asid(prev_asid))
> +               return true;

What about a WARN_ON_ONCE? Then the code contains evidence that the
comment is true. IIUC this isn't just a "not implemented feature",
rather there is plenty of other code that would need to be updated to
make it safe.

> +static void use_global_asid(struct mm_struct *mm)
> +{
> +       u16 asid;
> +
> +       guard(raw_spinlock_irqsave)(&global_asid_lock);
> +
> +       /* This process is already using broadcast TLB invalidation. */
> +       if (READ_ONCE(mm->context.global_asid))
> +               return;
> +
> +       /* The last global ASID was consumed while waiting for the lock. */
> +       if (!READ_ONCE(global_asid_available)) {

I think the READ_ONCE is unnecessary while we have the spinlock, it's
fine if this read gets split or whatever?

Ditto for mm->context.global_asid, it's only modified with the lock held.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux