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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD10AFA373B for ; Fri, 13 Sep 2024 10:08:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B52A46B00BD; Fri, 13 Sep 2024 06:08:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ACF716B00CD; Fri, 13 Sep 2024 06:08:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 923A66B00D0; Fri, 13 Sep 2024 06:08:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7256B6B00BD for ; Fri, 13 Sep 2024 06:08:38 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2325741AD5 for ; Fri, 13 Sep 2024 10:08:38 +0000 (UTC) X-FDA: 82559290716.03.D296EB8 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf23.hostedemail.com (Postfix) with ESMTP id 74CD6140008 for ; Fri, 13 Sep 2024 10:08:36 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of cmarinas@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726222087; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TweDDHI2ARS+GK98XoLAM8mQSvo7vXxoCmAiGX8qaco=; b=BcrSH8nQ3Q/T1CkzhzgUuQvXAVcV19Hwu3DQ5hUSZaEfU+VwiywqXApMTPsX4Mcj7BrvTy W7aOpbNY76AVMIvcoQ7pZPJ045+kmB37LG/AJzyV1QzyZtb4QaG3qwL5yMZOq7QNSCc9pA 4QamuxOZ+gShpn4b+Yb4hWIZhwjfpjs= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of cmarinas@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726222087; a=rsa-sha256; cv=none; b=bv5JZWRbn/DdCFIppFc3CsRcjJSyk0LVhBKAptc7iU9mKctHvXtfmzDHB/GdJV95D/ZejP rLXADTJSyBuLw36MF+mREEZPS7/QrGOlAktTF3AiDMsoPv1TuDer6oCmKcMbu/lbuQi3ux V3IPMyH3XJbST0HseyFmwXfmUiuZEIE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id A67CBA45BAF; Fri, 13 Sep 2024 10:08:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6077CC4CEC0; Fri, 13 Sep 2024 10:08:25 +0000 (UTC) Date: Fri, 13 Sep 2024 11:08:23 +0100 From: Catalin Marinas To: Charlie Jenkins Cc: "Liam R. Howlett" , Arnd Bergmann , guoren , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , "James E . J . Bottomley" , Helge Deller , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "David S . Miller" , Andreas Larsson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Muchun Song , Andrew Morton , Vlastimil Babka , Lorenzo Stoakes , shuah , Christoph Hellwig , Michal Hocko , "Kirill A. Shutemov" , Chris Torek , Linux-Arch , linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, "linux-csky@vger.kernel.org" , loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-abi-devel@lists.sourceforge.net Subject: Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits Message-ID: References: <9fc4746b-8e9d-4a75-b966-e0906187e6b7@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Stat-Signature: b5hihj6dym4gz73f33z7ary59yy3c38z X-Rspamd-Queue-Id: 74CD6140008 X-Rspamd-Server: rspam11 X-HE-Tag: 1726222116-376373 X-HE-Meta: U2FsdGVkX1/YV0L61pMmsERsxP3Qwdle3uivT3wCitoSOYfz818Wi2uTGbSDZ4tSQqOabDIYgItpHlWJcT/+a2ZjnG/R/7uWQYANcYRdxFCFbToqVJqWuiZypl+hEXIEYn8k/zAl7OUBkHg5KcY5nxJeFBWbqVKRYbu1UdKXT1UVFfNYToi+UxttMDfyTAKPAyTu85Lq11sqHxet+Zw4TtdWzH68WpgIO+sVxmdSqTXgdQy/kDxNohJ7F8FM6Zi1LpzBuHL1sr6lDw6DjCDqD3geqWt6lp1kWQfZ8yo/KlTxPsmGWMtT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OkCQJc5bz9+UW9p6cwyQGf8U+b+MaKSQ1Vrh45DLyz1XuXml3Zs14utE8Xr3HzhMFiCXTw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Sep 12, 2024 at 02:15:59PM -0700, Charlie Jenkins wrote: > On Thu, Sep 12, 2024 at 11:53:49AM +0100, Catalin Marinas wrote: > > On Wed, Sep 11, 2024 at 11:18:12PM -0700, Charlie Jenkins wrote: > > > Opting-in to the higher address space is reasonable. However, it is not > > > my preference, because the purpose of this flag is to ensure that > > > allocations do not exceed 47-bits, so it is a clearer ABI to have the > > > applications that want this guarantee to be the ones setting the flag, > > > rather than the applications that want the higher bits setting the flag. > > > > Yes, this would be ideal. Unfortunately those applications don't know > > they need to set a flag in order to work. > > It's not a regression, the applications never worked (on platforms that > do not have this default). The 47-bit default would allow applications > that didn't work to start working at the cost of a non-ideal ABI. That > doesn't seem like a reasonable tradeoff to me. If applications want to > run on new hardware that has different requirements, shouldn't they be > required to update rather than expect the kernel will solve their > problems for them? That's a valid point but it depends on the application and how much you want to spend updating user-space. OpenJDK is fine, if you need a JIT you'll have to add support for that architecture anyway. But others are arch-agnostic, you just recompile to your target. It's not an ABI problem, more of an API one. The x86 case (and powerpc/arm64) was different, the 47-bit worked for a long time before expanding it. So it made a lot of sense to keep the same default. Anyway, the prctl() can go both ways, either expanding or limiting the default address space. So I'd be fine with such interface. -- Catalin