[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250604154754.a30e327c3f1640173c8b9cb8@linux-foundation.org>
Date: Wed, 4 Jun 2025 15:47:54 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: yangge1116@....com
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, 21cnbao@...il.com,
david@...hat.com, baolin.wang@...ux.alibaba.com, muchun.song@...ux.dev,
osalvador@...e.de, liuzixing@...on.cn
Subject: Re: [PATCH V2] mm/hugetlb: remove unnecessary holding of
hugetlb_lock
On Tue, 27 May 2025 11:36:50 +0800 yangge1116@....com wrote:
> From: Ge Yang <yangge1116@....com>
>
> In the isolate_or_dissolve_huge_folio() function, after acquiring the
> hugetlb_lock, it is only for the purpose of obtaining the correct hstate,
> which is then passed to the alloc_and_dissolve_hugetlb_folio() function.
>
> The alloc_and_dissolve_hugetlb_folio() function itself also acquires the
> hugetlb_lock. We can have the alloc_and_dissolve_hugetlb_folio() function
> obtain the hstate by itself, so that the isolate_or_dissolve_huge_folio()
> function no longer needs to acquire the hugetlb_lock. In addition, we keep
> the folio_test_hugetlb() check within the isolate_or_dissolve_huge_folio()
> function. By doing so, we can avoid disrupting the normal path by vainly
> holding the hugetlb_lock.
>
> The replace_free_hugepage_folios() function has the same issue, and we
> should address it as well.
>
This change addresses a possible performance issue which was introduced
by 113ed54ad276 ("mm/hugetlb: fix kernel NULL pointer dereference when
replacing free hugetlb folios"). 113ed54ad276 was added recently and
was cc:stable.
David said:
https://lkml.kernel.org/r/87521d93-cc03-480d-a2ef-3ef8c84481c9@redhat.com
Question is, will that bugfix's performance impact be sufficiently
serious for us to also backport this new patch?
Powered by blists - more mailing lists