lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z5J4__VslSFk3A78@casper.infradead.org>
Date: Thu, 23 Jan 2025 17:14:39 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Barry Song <21cnbao@...il.com>
Cc: lokeshgidra@...gle.com, Liam.Howlett@...cle.com, aarcange@...hat.com,
	akpm@...ux-foundation.org, axelrasmussen@...gle.com,
	bgeffon@...gle.com, david@...hat.com, jannh@...gle.com,
	kaleshsingh@...gle.com, kernel-team@...roid.com,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, ngeoffray@...gle.com, peterx@...hat.com,
	rppt@...nel.org, ryan.roberts@....com, selinux@...r.kernel.org,
	surenb@...gle.com, timmurray@...gle.com
Subject: Re: [PATCH v7 4/4] userfaultfd: use per-vma locks in userfaultfd
 operations

On Thu, Jan 23, 2025 at 05:14:27PM +1300, Barry Song wrote:
> However, we’ve noticed that userfaultfd still remains one of the largest users
> of mmap_lock for write operations, with the other—binder—having been recently
> addressed by Carlos Llamas's "binder: faster page installations" series:
> 
> https://lore.kernel.org/lkml/20241203215452.2820071-1-cmllamas@google.com/
> 
> The HeapTaskDaemon(Java GC) might frequently perform userfaultfd_register()
> and userfaultfd_unregister() operations, both of which require the mmap_lock
> in write mode to either split or merge VMAs. Since HeapTaskDaemon is a

I don't think that's an innate necessity.  It does require quite some
work in order to fix it though.  Since it was so much work, nobody's
been motivated to fix it ... but now you are!  Congratulations ;-)

The reason we need the mmap_lock in write mode is that the VMA tree is
currently protected by that mmap_lock.  It shouldn't be.  Logically, it
should be protected by the ma_lock spinlock.  But today we use external
locking (ie the mmap_lock) because fixing that was a huge amount of work
that we didn't have time to do.

This MAP_VOLATILE idea is never going to fly.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ