Re: [PATCH 2/3] mm/tlb: Fix wrong judgement in allocate_global_asid()
From: Rik van Riel
Date: Sat Mar 29 2025 - 13:35:14 EST
On Sat, 2025-03-29 at 21:05 +0800, Hou Wenlong wrote:
> In allocate_global_asid(), 'global_asid_available' cannot be zero, as
> it
> has already been checked in use_global_asid(). Therefore, the warning
> in
> allocate_global_asid() cannot be triggered; fix the wrong judgment in
> allocate_global_asid().
>
> Fixes: d504d1247e36 ("x86/mm: Add global ASID allocation helper
> functions")
> Signed-off-by: Hou Wenlong <houwenlong.hwl@xxxxxxxxxxxx>
Good catch.
Reviewed-by: Rik van Riel <riel@xxxxxxxxxxx>
Looking at allocate_global_asid() again, I wonder if
that needs to be turned back into a loop.
What if we have no global asids available, and then
an asid gets freed that is smaller than the value
of last_global_asid?
--
All Rights Reversed.