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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59B3DCF58CC for ; Fri, 20 Sep 2024 05:10:45 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4X90pC6D6qz2yPR; Fri, 20 Sep 2024 15:10:43 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=150.107.74.76 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1726809043; cv=none; b=FU4jkUUkeWWIvCiXSaqiCE41a3GlBgBtScx1mtn+5FbxZOEYSnITpHaX+3+RGoqsXZAQqSe0SKydG1H34vQfar79x+3HNZVnHv+Wi4h8Zim2Fe/O5AFJpFUlO0+jvGQI9SIb/SwGslNcoXhBswzN5NK8batVVvrD/Um199QyqW4QaYXhHGeM7RKxzP+ULXwDMIhZzfvr+xRlG5lC+AJU/o4STNhdlIdbWyoqcQxnYeEem/6eDmqd+nGqlW7/yWxyI2GTPs6jjSXzPkaQfkDs/SvXhplEOp3Ofx4qoXRoIDXN12p0Cbn9ylYR33bSn7Itxtag1sR8u4PB40PKoWxH1A== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1726809043; c=relaxed/relaxed; bh=rRnqIQfUKl5hMqMziAAuyLYljr0XWCtIu8tELgZL7Kk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=E2ocj+wbwiVVeKX6clyYmruAlJDOvQV4BdoedL3bli+PDLDsgNblRWrYs13auVfHrPwKPv/0fE1G453CUKq2Ix9Jw/jVIYDI9J0rOEIew6YyijG8rRfoorW4tD8IRZE4lCh/ib51/hDuK7VrS+9YqRN4Wy2IQZb4NO7845EcG9XeZLxFzhx47q42Lf+CTfuyhmYWnQlItvncNAs2uBceBWHqT3FuPSASyvAaXAY2Zl8R7pWaMG08RCHa3nQ6R+89EgoC85LqXLaxXuVNN2xDRrRxbD21Y5kNYXGnuMofIOX6ODlD/SJveaj9/X6Qaw+y7LqAOh93jb3fomdak7200w== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=SMnj41MD; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=SMnj41MD; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4X90pC47FTz2yGL for ; Fri, 20 Sep 2024 15:10:43 +1000 (AEST) 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> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Post: List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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