mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/mm] x86/mm: Use guard() in cpa_collapse_large_pages()
Date: Wed, 05 Aug 2026 12:26:49 -0000	[thread overview]
Message-ID: <178593280988.708.15483140992252723625.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260729111119.375614011@infradead.org>

The following commit has been merged into the x86/mm branch of tip:

Commit-ID:     c980eafc5b738f274b36fac634f06ff000a07038
Gitweb:        https://git.kernel.org/tip/c980eafc5b738f274b36fac634f06ff000a07038
Author:        Peter Zijlstra <peterz@infradead.org>
AuthorDate:    Wed, 29 Jul 2026 13:08:08 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 05 Aug 2026 14:19:35 +02:00

x86/mm: Use guard() in cpa_collapse_large_pages()

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260729111119.375614011@infradead.org
---
 arch/x86/mm/pat/set_memory.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
index b1e780a..fc6a1b2 100644
--- a/arch/x86/mm/pat/set_memory.c
+++ b/arch/x86/mm/pat/set_memory.c
@@ -417,7 +417,7 @@ static void cpa_collapse_large_pages(struct cpa_data *cpa)
 	int collapsed = 0;
 	int i;
 
-	spin_lock(&cpa_lock);
+	guard(spinlock)(&cpa_lock);
 
 	if (cpa->flags & (CPA_PAGES_ARRAY | CPA_ARRAY)) {
 		for (i = 0; i < cpa->numpages; i++)
@@ -432,10 +432,8 @@ static void cpa_collapse_large_pages(struct cpa_data *cpa)
 			collapsed += collapse_large_pages(addr, &pgtables);
 	}
 
-	if (!collapsed) {
-		spin_unlock(&cpa_lock);
+	if (!collapsed)
 		return;
-	}
 
 	flush_tlb_all();
 
@@ -443,8 +441,6 @@ static void cpa_collapse_large_pages(struct cpa_data *cpa)
 		list_del(&ptdesc->pt_list);
 		pagetable_free(ptdesc);
 	}
-
-	spin_unlock(&cpa_lock);
 }
 
 static void cpa_flush(struct cpa_data *cpa, int cache)

  reply	other threads:[~2026-08-05 12:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 11:08 [PATCH 0/3] x86/mm: DEBUG_PAGEALLOC musings Peter Zijlstra
2026-07-29 11:08 ` [PATCH 1/3] x86/mm: Use guard() in cpa_collapse_large_pages() Peter Zijlstra
2026-08-05 12:26   ` tip-bot2 for Peter Zijlstra [this message]
2026-07-29 11:08 ` [PATCH 2/3] x86/mm: Use guard() for pgd_lock Peter Zijlstra
2026-08-05 12:26   ` [tip: x86/mm] " tip-bot2 for Peter Zijlstra
2026-07-29 11:08 ` [PATCH 3/3] x86/mm: Fix and document DEBUG_PAGEALLOC Peter Zijlstra
2026-07-29 14:13   ` Mike Rapoport
2026-07-29 14:48     ` Peter Zijlstra
2026-07-29 19:07       ` Mike Rapoport
2026-07-30 10:43         ` Peter Zijlstra
2026-07-30 11:17           ` Mike Rapoport
2026-08-05 12:26   ` [tip: x86/mm] " tip-bot2 for Peter Zijlstra
2026-08-04 18:34 ` [PATCH 0/3] x86/mm: DEBUG_PAGEALLOC musings Dave Hansen
2026-08-04 20:01   ` Peter Zijlstra
2026-08-04 20:08     ` Dave Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178593280988.708.15483140992252723625.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®