Re: [v5 PATCH] arm64: mm: force write fault for atomic RMW instructions
From: Christoph Lameter (Ampere)
Date: Fri Jun 28 2024 - 14:27:07 EST
On Fri, 28 Jun 2024, Catalin Marinas wrote:
Linux-specific (e.g. madvise()), I agree, but arm64-specific definitely
not. I'd argue that expecting the atomic_add(0) to only trigger a single
write fault is arch specific. You can't do this on arm32 or arm64
pre-LSE (I haven't checked other architectures).
The single write fault is x86 behavior. I am not sure how other
architectures handle that.
IIUC, OpenJDK added this feature about two years ago but the arm64
behaviour hasn't changed in the meantime. So it's not like we broke the
ABI and forcing user space to update.
The focus of OpenJDK may not be arm64 and they never saw the issue? We
only know this because we have an insider on staff. AFACIT we get pushback
from them as well. There are certainly numerous other open
source applications that behave in a similar way. We just dont know about
it.
This patch does feel a bit like working around a non-optimal user choice
in kernel space. Who knows, madvise() may even be quicker if you do a
single call for a larger VA vs touching each page.
Looks to me like unexpected surprising behavior on ARM64. madvise is
rather particular to Linux and its semantics are ever evolving.
A lot of these are proprietary.
Are you aware of other (proprietary) software relying on such pattern to
fault pages in as writeable?
I would not be told about such things by companies I did not work for and
if I have gotten knowledge about this in some way in the past then I would
not be allowed to talk about it.