Skip to content

Commit 7cf9f3b

Browse files
committed
mm, slub: only disable irq with spin_lock in __unfreeze_partials()
__unfreeze_partials() no longer needs to have irqs disabled, except for making the spin_lock operations irq-safe, so convert the spin_locks operations and remove the separate irq handling. Signed-off-by: Vlastimil Babka <[email protected]>
1 parent fc1455f commit 7cf9f3b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

mm/slub.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,9 +2352,7 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page)
23522352
{
23532353
struct kmem_cache_node *n = NULL, *n2 = NULL;
23542354
struct page *page, *discard_page = NULL;
2355-
unsigned long flags;
2356-
2357-
local_irq_save(flags);
2355+
unsigned long flags = 0;
23582356

23592357
while (partial_page) {
23602358
struct page new;
@@ -2366,10 +2364,10 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page)
23662364
n2 = get_node(s, page_to_nid(page));
23672365
if (n != n2) {
23682366
if (n)
2369-
spin_unlock(&n->list_lock);
2367+
spin_unlock_irqrestore(&n->list_lock, flags);
23702368

23712369
n = n2;
2372-
spin_lock(&n->list_lock);
2370+
spin_lock_irqsave(&n->list_lock, flags);
23732371
}
23742372

23752373
do {
@@ -2398,9 +2396,7 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page)
23982396
}
23992397

24002398
if (n)
2401-
spin_unlock(&n->list_lock);
2402-
2403-
local_irq_restore(flags);
2399+
spin_unlock_irqrestore(&n->list_lock, flags);
24042400

24052401
while (discard_page) {
24062402
page = discard_page;

0 commit comments

Comments
 (0)