* + hugetlb-make-free_huge_page-irq-safe-fix.patch added to -mm tree
@ 2021-04-03 0:26 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-04-03 0:26 UTC (permalink / raw)
To: mike.kravetz, mm-commits, osalvador, songmuchun
The patch titled
Subject: hugetlb: fix irq locking omissions
has been added to the -mm tree. Its filename is
hugetlb-make-free_huge_page-irq-safe-fix.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/hugetlb-make-free_huge_page-irq-safe-fix.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/hugetlb-make-free_huge_page-irq-safe-fix.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Mike Kravetz <mike.kravetz@oracle.com>
Subject: hugetlb: fix irq locking omissions
The pach "hugetlb: make free_huge_page irq safe" changed spin_*lock
calls to spin_*lock_irq* calls. However, it missed several places
in the file hugetlb.c. Add the overlooked changes.
Link: https://lkml.kernel.org/r/b0b081e2-9d78-77ab-684f-a0989a7f1d27@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/hugetlb.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--- a/mm/hugetlb.c~hugetlb-make-free_huge_page-irq-safe-fix
+++ a/mm/hugetlb.c
@@ -2278,7 +2278,7 @@ static int alloc_and_dissolve_huge_page(
*/
page_ref_dec(new_page);
retry:
- spin_lock(&hugetlb_lock);
+ spin_lock_irq(&hugetlb_lock);
if (!PageHuge(old_page)) {
/*
* Freed from under us. Drop new_page too.
@@ -2291,7 +2291,7 @@ retry:
* Fail with -EBUSY if not possible.
*/
update_and_free_page(h, new_page);
- spin_unlock(&hugetlb_lock);
+ spin_unlock_irq(&hugetlb_lock);
if (!isolate_huge_page(old_page, list))
ret = -EBUSY;
return ret;
@@ -2301,7 +2301,7 @@ retry:
* freelist yet. Race window is small, so we can succed here if
* we retry.
*/
- spin_unlock(&hugetlb_lock);
+ spin_unlock_irq(&hugetlb_lock);
cond_resched();
goto retry;
} else {
@@ -2317,7 +2317,7 @@ retry:
__enqueue_huge_page(&h->hugepage_freelists[nid], new_page);
}
unlock:
- spin_unlock(&hugetlb_lock);
+ spin_unlock_irq(&hugetlb_lock);
return ret;
}
@@ -2333,15 +2333,15 @@ int isolate_or_dissolve_huge_page(struct
* to carefully check the state under the lock.
* Return success when racing as if we dissolved the page ourselves.
*/
- spin_lock(&hugetlb_lock);
+ spin_lock_irq(&hugetlb_lock);
if (PageHuge(page)) {
head = compound_head(page);
h = page_hstate(head);
} else {
- spin_unlock(&hugetlb_lock);
+ spin_unlock_irq(&hugetlb_lock);
return 0;
}
- spin_unlock(&hugetlb_lock);
+ spin_unlock_irq(&hugetlb_lock);
/*
* Fence off gigantic pages as there is a cyclic dependency between
@@ -2729,7 +2729,7 @@ static int set_max_huge_pages(struct hst
* pages in hstate via the proc/sysfs interfaces.
*/
mutex_lock(&h->resize_lock);
- spin_lock(&hugetlb_lock);
+ spin_lock_irq(&hugetlb_lock);
/*
* Check for a node specific request.
_
Patches currently in -mm which might be from mike.kravetz@oracle.com are
mm-cma-change-cma-mutex-to-irq-safe-spinlock.patch
hugetlb-no-need-to-drop-hugetlb_lock-to-call-cma_release.patch
hugetlb-add-per-hstate-mutex-to-synchronize-user-adjustments.patch
hugetlb-create-remove_hugetlb_page-to-separate-functionality.patch
hugetlb-call-update_and_free_page-without-hugetlb_lock.patch
hugetlb-change-free_pool_huge_page-to-remove_pool_huge_page.patch
hugetlb-make-free_huge_page-irq-safe.patch
hugetlb-make-free_huge_page-irq-safe-fix.patch
hugetlb-add-lockdep_assert_held-calls-for-hugetlb_lock.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-03 0:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-03 0:26 + hugetlb-make-free_huge_page-irq-safe-fix.patch added to -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).