diff options
| author | Ge Yang <[email protected]> | 2025-05-27 03:36:50 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-06-25 22:55:03 +0000 |
| commit | 344ef45b03336e7f74658814f66483b5417c9cf1 (patch) | |
| tree | 577bb12d480587d8de8928d68fa85c79ba341bda /lib/alloc_tag.c | |
| parent | MAINTAINERS: add missing files to mm page alloc section (diff) | |
| download | kernel-344ef45b03336e7f74658814f66483b5417c9cf1.tar.gz kernel-344ef45b03336e7f74658814f66483b5417c9cf1.zip | |
mm/hugetlb: remove unnecessary holding of hugetlb_lock
In isolate_or_dissolve_huge_folio(), after acquiring the hugetlb_lock, it
is only for the purpose of obtaining the correct hstate, which is then
passed to alloc_and_dissolve_hugetlb_folio().
alloc_and_dissolve_hugetlb_folio() itself also acquires the hugetlb_lock.
We can have alloc_and_dissolve_hugetlb_folio() obtain the hstate by
itself, so that isolate_or_dissolve_huge_folio() no longer needs to
acquire the hugetlb_lock. In addition, we keep the folio_test_hugetlb()
check within isolate_or_dissolve_huge_folio(). By doing so, we can avoid
disrupting the normal path by vainly holding the hugetlb_lock.
replace_free_hugepage_folios() has the same issue, and we should address
it as well.
Addresses a possible performance problem which was added by the hotfix
113ed54ad276 ("mm/hugetlb: fix kernel NULL pointer dereference when
replacing free hugetlb folios").
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 113ed54ad276 ("mm/hugetlb: fix kernel NULL pointer dereference when replacing free hugetlb folios")
Signed-off-by: Ge Yang <[email protected]>
Suggested-by: Oscar Salvador <[email protected]>
Reviewed-by: Muchun Song <[email protected]>
Cc: Baolin Wang <[email protected]>
Cc: Barry Song <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/alloc_tag.c')
0 files changed, 0 insertions, 0 deletions
