The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Dave Hansen <dave.hansen@linux.intel.com>, linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	linux-mm@kvack.org, Lorenzo Stoakes <ljs@kernel.org>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Suren Baghdasaryan <surenb@google.com>,
	Vlastimil Babka <vbabka@kernel.org>
Subject: Re: [PATCH 1/6] mm: Make per-VMA locks available universally
Date: Fri, 8 May 2026 12:58:35 +0200	[thread overview]
Message-ID: <36346c42-2557-431f-aef5-0f92b0828e76@kernel.org> (raw)
In-Reply-To: <a07231f7-c5a1-4de0-8d4a-459d5ecb5676@kernel.org>

On 5/8/26 12:12, David Hildenbrand (Arm) wrote:
> On 4/29/26 20:19, Dave Hansen wrote:
>> From: Dave Hansen <dave.hansen@linux.intel.com>
>>
>> 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.
> 
>>
>> 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.
> 
> mm_struct is very likely not a problem.
> 
> 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.

-- 
Cheers,

David

  reply	other threads:[~2026-05-08 10:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260429181954.F50224AE@davehans-spike.ostc.intel.com>
     [not found] ` <20260429182005.00BF70D8@davehans-spike.ostc.intel.com>
2026-05-04 23:15   ` [PATCH 6/6] x86/mm: Avoid mmap lock for shadow stack pop fast path Edgecombe, Rick P
2026-05-05 16:39     ` Dave Hansen
2026-05-08 20:39       ` Lorenzo Stoakes
     [not found] ` <20260429181955.0C443845@davehans-spike.ostc.intel.com>
2026-05-08 10:12   ` [PATCH 1/6] mm: Make per-VMA locks available universally David Hildenbrand (Arm)
2026-05-08 10:58     ` David Hildenbrand (Arm) [this message]
2026-05-08 16:55       ` Lorenzo Stoakes
2026-05-08 16:52 ` [PATCH 0/6] mm: Make per-VMA locks available in all builds Lorenzo Stoakes
2026-05-08 17:01   ` Dave Hansen
     [not found] ` <20260429181957.7511C256@davehans-spike.ostc.intel.com>
2026-05-08 17:06   ` [PATCH 2/6] binder: Make shrinker rely solely on per-VMA lock Lorenzo Stoakes
     [not found] ` <20260429181959.BC9DABC5@davehans-spike.ostc.intel.com>
2026-05-08 17:26   ` [PATCH 3/6] mm: Add RCU-based VMA lookup that waits for writers Lorenzo Stoakes
2026-05-08 20:15     ` Lorenzo Stoakes
     [not found] ` <20260429182000.93887DFB@davehans-spike.ostc.intel.com>
2026-05-08 17:29   ` [PATCH 4/6] binder: Remove mmap_lock fallback Lorenzo Stoakes
     [not found] ` <20260429182002.BB61C7BC@davehans-spike.ostc.intel.com>
2026-05-08 17:32   ` [PATCH 5/6] tcp: Remove mmap_lock fallback path Lorenzo Stoakes

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=36346c42-2557-431f-aef5-0f92b0828e76@kernel.org \
    --to=david@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=surenb@google.com \
    --cc=vbabka@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