From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05B6E236453 for ; Fri, 8 May 2026 16:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778259317; cv=none; b=gN7hpgIDRtvf2T3vqGmLi+V6ZvKGiHuXmIZ92HFFIAx50CT3Q3sw4xp15KUar5yafcLlvqrlf/EGMTEblJUpGFtGkdcPWyyCSzaoszLyCylWVeFKb+bJ0A3sgZlNTr3RrfL0FgrbSMqwbkc/aTnFdvBG/kpq89mPYL+iTzshmfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778259317; c=relaxed/simple; bh=YQtlp0u+sG2vviBnH9W6K4oHZICYOV4aRbxMZGpCCxI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cvBBh8hbmDKaaCyo/2ge8HP+Q43k8iNc+B7VMhc1JXsyIzhWrY9FWsM7PCX8oszNvxBbdO83dpbrpLfj2eoraXTiXn5xD0xVo8YlSokUZz39Psj/S7eYMapO3v7ORUz7mkYt0perW7TcSvwec0S1IiOi97jRsntV0Oc27yJpWLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XHfqzmeS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XHfqzmeS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 486FDC2BCB0; Fri, 8 May 2026 16:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778259316; bh=YQtlp0u+sG2vviBnH9W6K4oHZICYOV4aRbxMZGpCCxI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XHfqzmeSFYwl0UXAEAQkmb2d4Mqu3WMnmnaUT6Z4Sh7ccxkrn4YJaGo4xFX7GDz3s qMCOma3ZrnjlpLXH3y2ZUFudIPKgTgQ6ejBbnLqEL3D2iYFSAufQ9TUR68Q++9Oqxv 7aCyB30nI5BJ99pdF6Xgl44z0tT9eXdlfLr7uvEnDFnvmH2DY3BLr1mJDK1apflq8P r34v9wrwlubmrKDpj3hY/J+R+B6FcY4Istk0c6GrLJ0GkQy27tVgdSspVhLxS5efQd w8yy++64zC0Pk65lCh40DvPgtkl/6ycsQ+91kYhDCvhje1XG21r24PEyFdJO65t8Rj eZgrZFIemSoQQ== Date: Fri, 8 May 2026 17:55:10 +0100 From: Lorenzo Stoakes To: "David Hildenbrand (Arm)" Cc: Dave Hansen , linux-kernel@vger.kernel.org, Andrew Morton , "Liam R. Howlett" , linux-mm@kvack.org, Shakeel Butt , Suren Baghdasaryan , Vlastimil Babka Subject: Re: [PATCH 1/6] mm: Make per-VMA locks available universally Message-ID: References: <20260429181954.F50224AE@davehans-spike.ostc.intel.com> <20260429181955.0C443845@davehans-spike.ostc.intel.com> <36346c42-2557-431f-aef5-0f92b0828e76@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36346c42-2557-431f-aef5-0f92b0828e76@kernel.org> On Fri, May 08, 2026 at 12:58:35PM +0200, David Hildenbrand (Arm) wrote: > On 5/8/26 12:12, David Hildenbrand (Arm) wrote: > > On 4/29/26 20:19, Dave Hansen wrote: > >> From: Dave Hansen > >> > >> The per-VMA locks have been around for several years. They've had some > >> bugs worked out of them and have seen quite wide use. However, they > >> are still only available when architectures explicitly enable them. > >> Remove the conditional compilation around the per-VMA locks, making > >> them available on all architectures and configs. > > > > Yes, we should really just make it now just a fixed part of the kernel design. Agreed > > > >> > >> The approach up to now seemed to be to add ARCH_SUPPORTS_PER_VMA_LOCK > >> when the architecture started using per-VMA locks in the fault > >> handler. But, contrary to the naming, the Kconfig option does not > >> really indicate whether the architecture supports per-VMA locks or > >> not. It is more of a marker for whether the architecture is likely to > >> benefit from per-VMA locks. > >> > >> To me, the most important thing side-effect of universal availability > >> is letting per-VMA locks be used in SMP=n configs. This lets us use > >> per-VMA locking in all x86 code without fallbacks. > >> > >> Overall, this just generally makes the kernel simpler. Just look at > >> the diffstat. It also opens the door to users that want to use the > >> per-VMA locks in common code. Doing *that* can bring additional > >> simplifications. > >> > >> The downside of this is adding some fields to vm_area_struct and > >> mm_struct. > > > > I'd assume most distributions would already enable it. Yes, and I think any modern system will treat it as a necessity! > > > > mm_struct is very likely not a problem. No not at all that's a lost cause :)) But also less improtant as less propagated, obviously. > > > > On x86-64, the smallest size for vma_area_struct possible (make allnoconfig) > > seems to be 68bytes. The largest size (make allyesconfig) with lockdep and all > > that is 256bytes. Without lockdep we are at 192 bytes: independent of per-VMA locks. > > > > I'd expect that on most 64bit configs we usually end up with 192 bytes today. > > > > Given that our slab sizes are ...32/64/96/128/192/..., I guess we'd have to be > > lucky to jump between sizes on most configs. > > As Vlastimil reminded me, the have separate slab caches, so they are better > packed. So I don't think a small increase there would really be a problem. Good to have this information also! > > -- > Cheers, > > David Cheers, Lorenzo