Skip to content

Commit

Permalink
mm, slub: only disable irq with spin_lock in __unfreeze_partials()
Browse files Browse the repository at this point in the history
__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 <vbabka@suse.cz>
  • Loading branch information
Vlastimil Babka committed Sep 3, 2021
1 parent fc1455f commit 7cf9f3b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2352,9 +2352,7 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page)
{
struct kmem_cache_node *n = NULL, *n2 = NULL;
struct page *page, *discard_page = NULL;
unsigned long flags;

local_irq_save(flags);
unsigned long flags = 0;

while (partial_page) {
struct page new;
Expand All @@ -2366,10 +2364,10 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page)
n2 = get_node(s, page_to_nid(page));
if (n != n2) {
if (n)
spin_unlock(&n->list_lock);
spin_unlock_irqrestore(&n->list_lock, flags);

n = n2;
spin_lock(&n->list_lock);
spin_lock_irqsave(&n->list_lock, flags);
}

do {
Expand Down Expand Up @@ -2398,9 +2396,7 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page)
}

if (n)
spin_unlock(&n->list_lock);

local_irq_restore(flags);
spin_unlock_irqrestore(&n->list_lock, flags);

while (discard_page) {
page = discard_page;
Expand Down

0 comments on commit 7cf9f3b

Please sign in to comment.