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 8CE39CF58CB for ; Fri, 20 Sep 2024 05:10:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15A6A6B0082; Fri, 20 Sep 2024 01:10:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10AB26B0083; Fri, 20 Sep 2024 01:10:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EECC06B0085; Fri, 20 Sep 2024 01:10:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D16A66B0082 for ; Fri, 20 Sep 2024 01:10:50 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 795361411C8 for ; Fri, 20 Sep 2024 05:10:50 +0000 (UTC) X-FDA: 82583941860.28.C9BC9C1 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by imf09.hostedemail.com (Postfix) with ESMTP id 2782D140003 for ; Fri, 20 Sep 2024 05:10:46 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=ellerman.id.au header.s=201909 header.b=SMnj41MD; spf=pass (imf09.hostedemail.com: domain of mpe@ellerman.id.au designates 150.107.74.76 as permitted sender) smtp.mailfrom=mpe@ellerman.id.au; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726808934; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rRnqIQfUKl5hMqMziAAuyLYljr0XWCtIu8tELgZL7Kk=; b=Vwiww6kssi4uRVmN3cjPwSi5Tr+rmnbJLR/tbq8Asb1xoccDIdNZTMDMqOX6A2+JnfDPOh JBdBOsUP0AJtqJ1J1P4vLu7nyaIBDzdeLhHJ2VWiPpTD0ra4BzomELB5Bs4gcRajb7FsYD uwCSJi+Ysr/0M7wZsFjUvHfv7jej16U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726808934; a=rsa-sha256; cv=none; b=KLYF06YJr0VUIQZOcCfAFN4KVwf4U5BDyJrat69lCSMi3ZVzn2Oytb4ApYOeAuZsdHMcRU Xs6QLzSPTFHDHfLnZa1M2pYnBVu6F3zXusQpFtcSArI1Z16yU9AgnMuIk9b0jvnNq5N7kK IgqIIZkcl3hV9yx7/+thtV/+M3YIusQ= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=ellerman.id.au header.s=201909 header.b=SMnj41MD; spf=pass (imf09.hostedemail.com: domain of mpe@ellerman.id.au designates 150.107.74.76 as permitted sender) smtp.mailfrom=mpe@ellerman.id.au; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1726809043; bh=rRnqIQfUKl5hMqMziAAuyLYljr0XWCtIu8tELgZL7Kk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=SMnj41MDT0Lf3PfeIXIT3YwHOI0uAuuDLjE0t47tRZRaNTFGPp7CmsiqP5xtDHrve GQpxRf3WsppyZZ4VsMpffig95QUjZAZcDTfAYoQRqb1kT/tFerPynOIHTZHPuzrIZ0 6IUod3m4WM+YcquTxyACp+qQoBmzjqHxZaUgk+jSzmb/iMutuZKenA1h2ctddPY4VB zq+UuDefISa1ohGSToaZ++xjvfQUbK1tokALiwcAwa1KGWQEeHrE7fds5GO8aUidii ZlBYq9K3KPr01kqIlLozoiNa0r5uQQx7O30KTZoarDO3+tCBmjhV32YlfcEEOMpICG jWz/PZdm+HR7A== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail.ozlabs.org (Postfix) with ESMTPSA id 4X90nx2nGtz4xD3; Fri, 20 Sep 2024 15:10:29 +1000 (AEST) From: Michael Ellerman To: Charlie Jenkins Cc: Geert Uytterhoeven , Christophe Leroy , Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Guo Ren , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Nicholas Piggin , 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 , "Liam R. Howlett" , Vlastimil Babka , Lorenzo Stoakes , Shuah Khan , Christoph Hellwig , Michal Hocko , "Kirill A. Shutemov" , Chris Torek , linux-arch@vger.kernel.org, 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 In-Reply-To: References: <20240905-patches-below_hint_mmap-v3-0-3cd5564efbbb@rivosinc.com> <20240905-patches-below_hint_mmap-v3-1-3cd5564efbbb@rivosinc.com> <87zfol468z.fsf@mail.lhotse> <1aca8e4c-1c12-4624-a689-147ff60b75d6@csgroup.eu> <8734m6s428.fsf@mail.lhotse> Date: Fri, 20 Sep 2024 15:10:28 +1000 Message-ID: <87y13mnc57.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2782D140003 X-Stat-Signature: t6opnmedpripe1e3skjbfky3u1fjuqew X-HE-Tag: 1726809046-184050 X-HE-Meta: U2FsdGVkX1+G9sDSVz+M3NJfWB6iHNLBT7xQJYgL9GL6SlWWnhxVy7v+jGHcO1d2t8yHpvuhqgHOIAs4tjh7IYOIdbdMMhthdl31T9uJijJOJwG8CeBGq7vUW+6EZ12wwH6/dlgNanf1TpyUG+EmJKrUn7Rswrv/YHAoV1BjQChR9Jv9CphgMnVMMW8bo7FA0f0rUmhQ7WmbI6ITZjEG1k+vxk27bch0WcF/0bM+0oCKxFcdAJeETVLieA6ngwMEGdQPEzVx0QU8VWljbywx7Uzlx/0rhmdeAQFoShEQU+svoAa9yrXODS6E8h5WHZXVev0dGKEpKvx/mjugEFQCEYCcrRbSlB7sI5UqL7zGJrNRqDAyRrsvwTdaXTZCp9bJ9eIlrdfIeIFEYWqef7U1cHqKs7zb508Ro6GiFIyn2GidZBNdfUXWWH6JUdQVd9QN5YDigVrV+cIk2h/K8Fchd2Sctazkhiv6g8VP9Po3TnXyIR5vbnIrUCdIBl29whhN/fGJhBKC4nl6L3+boEkwHkee/18Pu1RosM7oSf5aQVnYwDP5kgFDcaJmjs2V8pv9Ke21DNpa/h2SZsshsU4Fz6jNCA5MC7sgJ0tRa0wxzJFcfq3UUhNiV8HosuQ/TZvCATzSW5QGrffzZj8Gx34Y/+e9LKT0IAZH9Sbc7lPV+UVIVtRtdmFuH1GIzTFXRzwpa7kCZDQeUSUO+Na2OaTJH68WKjtDQ+4+hwlesjJgA/DVS3rswWwFJHYgQzf8XZgf5+gNbm2R+jRNDXmmDnu+sWM4F0Vhh/ZWX/7PPepOtiMxhT3c25vm2wgtWDJK2ykqZ9xgH3T6sESQG9r7zvNonjLUriH0J7zPbye/utHAOl3kGkaQqTg/iuOIO3GwmlNC4EUuzMjCLu36xcKbS4xKDodeo0eh8nrXh1dix+ytA46KPLY5j7RW1Dk7ce0aunpb4J4ZImVL/6PwhMe3F93 wcjtwkdp DPJQVk0GODwfGMiemkQ6ztfLjYEP/tI7Kzm9kv2kdaUnkoHjJyj7G8F31TY4AlzAeLdE8BRfQrRqz5anYjRfuw/HGEbBRSmRf032UQLKEsWsq+nDn3IpXZ8B2lKlLfdNiE5pvqk+DNfmTYG9gnnviakfxIC/3ZZFHuT5myY4huLxRSLFYyacOYbgoQWZ5DpqFN7jDDZuQse4P1YOxEpmvipxPD//uHirDRG3ZqTTMbSn+rz5eyYUHD1pag7oC7iJzmm9PkhB8eB1x3YoE2mry7kBeKFtm7ZXdj04B/ruNmLwYOANFCUKeV/vhipB/uHNdIeGUmLvtWxJ7TDZDYju8iYK0wm14GuXJkiARq2D5gP6F8QGifLWZAG/EC4bijvwuT7pFsYAebV2n3uA4L/r7xWxm2bTi4m12UCS/AwNb8/4KUT+igksjihyC1RZZ1Jnkes5qebLDZF7g+zSK5au1WpkhuNBhl8KCGbJ+ 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: Charlie Jenkins writes: > On Wed, Sep 11, 2024 at 11:38:55PM +1000, Michael Ellerman wrote: >> Geert Uytterhoeven writes: >> > Hi Christophe, >> > >> > On Tue, Sep 10, 2024 at 11:21=E2=80=AFAM Christophe Leroy >> > wrote: >> >> >>> diff --git a/include/uapi/linux/personality.h b/include/uapi/linu= x/personality.h >> >> >>> index 49796b7756af..cd3b8c154d9b 100644 >> >> >>> --- a/include/uapi/linux/personality.h >> >> >>> +++ b/include/uapi/linux/personality.h >> >> >>> @@ -22,6 +22,7 @@ enum { >> >> >>> WHOLE_SECONDS =3D 0x2000000, >> >> >>> STICKY_TIMEOUTS =3D 0x4000000, >> >> >>> ADDR_LIMIT_3GB =3D 0x8000000, >> >> >>> + ADDR_LIMIT_47BIT =3D 0x10000000, >> >> >>> }; >> >> >> >> >> >> I wonder if ADDR_LIMIT_128T would be clearer? >> >> >> >> >> > >> >> > I don't follow, what does 128T represent? >> >> >> >> 128T is 128 Terabytes, that's the maximum size achievable with a 47BIT >> >> address, that naming would be more consistant with the ADDR_LIMIT_3GB >> >> just above that means a 3 Gigabytes limit. >> > >> > Hence ADDR_LIMIT_128TB? >>=20 >> Yes it should be 128TB. Typo by me. > > 47BIT was selected because the usecase for this flag is for applications > that want to store data in the upper bits of a virtual address space. In > this case, how large the virtual address space is irrelevant, and only > the number of bits that are being used, and hence the number of bits > that are free. Yeah I understand that's how you came to the problem. But for the user API I think using the size of the address space is clearer, easier to explain, and matches the existing ADDR_LIMIT_3GB. cheers