From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F9EDC4451C for ; Wed, 22 Jul 2026 08:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aee5s1edqbgsHAo4tjJhHBYFBXZbzIQhAfflgu0Qfl0=; b=lkRTVkAnpmGX3d746Cp8JH3FZM ZUw31lu+Z96Wx/b2L66LdXP9XnzmqjYnlXxnVChTWSdsAGVoiksUGFDowksZLxIiD6OkvCbD/Z93E xXDOfNheOZ3fhmLkCUOZLvg/8IKBJ+7MVc+VKeRJVy//mGl3FRJYEIvF9QQyIz+JoTBcXHIAVowaJ zTzZELZVbnSraQt3hXkQl3JnHZsvg6q9fGsKUnT/1Oqy4bl/puHhoAbRf1k/J8MAfB8ZyEnN+WWMk uVPwlaUBTRChAiil1cICdk6zcSvLIA3c5922PWAg6NWEa5lzYFJ4F98qhA1XBzPvISbHMhDdUMuYx yvYIc+cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wmSkM-0000000BJIZ-0Ir5; Wed, 22 Jul 2026 08:56:10 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wmSkJ-0000000BJII-3u1F; Wed, 22 Jul 2026 08:56:08 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 098AB60A6B; Wed, 22 Jul 2026 08:56:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C7D71F000E9; Wed, 22 Jul 2026 08:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784710566; bh=aee5s1edqbgsHAo4tjJhHBYFBXZbzIQhAfflgu0Qfl0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=LDc46chI52fVENs42kG9+KBWM0nMhxZUJWhF2TcA//k7EVRXGYtJIEDCNw2MhaQxf rAF7wicCMnhKVgjkDR5Va+tqdiK93/9KRL0amUDK1fkF/CYvi+4b0yXY0txmWTHBzm FN3BEIyh2bx7nj0aCMQm2RenxGNCsPp3x2xisyF711bY3BDHZJZ9cBgDQ/wkNXvhIf qeOmqal8BqfD6umsvhZ23KsidOUZWvPxo4euKNMG6AxVL0LbwZcNyrf3FjZpQ5BNd/ UqsVNpLJjq1PTHsuaT0kzYYLLQVD1E7gJWUegOsyo5+fFSYuWRWanDXNRVLIlnutd/ QQ65f9GU69gTg== Date: Wed, 22 Jul 2026 09:55:46 +0100 From: "Lorenzo Stoakes (ARM)" To: Mike Rapoport Cc: linux-mm@kvack.org, Albert Ou , Andrew Morton , Andy Lutomirski , Borislav Petkov , Brendan Jackman , Catalin Marinas , Dave Hansen , David Hildenbrand , Huacai Chen , Ingo Molnar , Ingo Molnar , Kevin Brodsky , "Liam R. Howlett" , Michal Hocko , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , "H. Peter Anvin" , Suren Baghdasaryan , Thomas Gleixner , Vlastimil Babka , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, loongarch@lists.linux.dev, x86@kernel.org, Dave Hansen Subject: Re: [PATCH RFC 01/18] x86/mm/pat: Don't gate cpa_lock on debug_pagealloc_enabled() Message-ID: References: <20260721-generic-set-memory-v0-1-v1-0-2c1fc62306b3@kernel.org> <20260721-generic-set-memory-v0-1-v1-1-2c1fc62306b3@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 21, 2026 at 09:30:26PM +0300, Mike Rapoport wrote: > On Tue, Jul 21, 2026 at 06:16:33PM +0100, Lorenzo Stoakes (ARM) wrote: > > On Tue, Jul 21, 2026 at 07:23:24PM +0300, Mike Rapoport (Microsoft) wrote: > > > The splitting and merging of kernel page table mappings between small and > > > large is protected by cpa_lock. The merging is relatively new but the > > > splitting is ancient. > > > > > > The splitting has a locking optimization: since DEBUG_PAGEALLOC forces all > > > mappings to 4k, there are no large pages to split. So the code that *might* > > > cause a split can just skip the locking (and a few other things). > > > > > > This is entertaining, but it adds complexity and makes for weird locking > > > rules. Plus it's all for a debugging feature which makes the kernel super > > > slow in the first place. Optimizing something which is already super slow > > > and not used in production is not the best way to spend our complexity > > > budget. > > > > > > Stop gating cpa_lock on debug_pagealloc_enabled() to simplify the code > > > and the locking rules. > > > > > > [ dhansen: flesh out changelog ] > > > > > > Suggested-by: Dave Hansen > > > Signed-off-by: Mike Rapoport (Microsoft) > > > Signed-off-by: Dave Hansen > > > Link: https://patch.msgid.link/20260715144519.934289-1-rppt@kernel.org > > > Link: https://lore.kernel.org/all/aab44f08-89f8-47fe-bee4-0ab6b25968c6@intel.com/ > > > > Hmm this patch is already taken separately though? ([0]) (obv. commented there > > already with review feedback). > > > > Intended to be with this series as some kind of background or? Probably better > > to separate out given it's a live patch > > From the cover letter: > > Patch 1 is already applied to the tip tree and I posted patch 2 > separately [4], but I included them both here for the completeness. Well that'll teach me for skipping the cover letter ;) Fair enough! > > > Thanks, Lorenzo > > -- > Sincerely yours, > Mike. Cheers, Lorenzo