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 363B9C433EF for ; Tue, 4 Jan 2022 16:21:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 882F96B0071; Tue, 4 Jan 2022 11:21:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8096B6B0072; Tue, 4 Jan 2022 11:21:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D2C16B0073; Tue, 4 Jan 2022 11:21:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 5A1456B0071 for ; Tue, 4 Jan 2022 11:21:45 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0CF38180CB05F for ; Tue, 4 Jan 2022 16:21:45 +0000 (UTC) X-FDA: 78993120570.19.5C428F5 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf26.hostedemail.com (Postfix) with ESMTP id 991F314000E for ; Tue, 4 Jan 2022 16:21:44 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4796DB81732; Tue, 4 Jan 2022 16:21:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A6DCC36AED; Tue, 4 Jan 2022 16:21:39 +0000 (UTC) Date: Tue, 4 Jan 2022 16:21:36 +0000 From: Catalin Marinas To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "alex@ghiti.fr" , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" , Steve Capper , Will Deacon Subject: Re: [PATCH v6 04/14] mm, hugetlbfs: Allow for "high" userspace addresses Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 991F314000E X-Stat-Signature: zrpiyt6d61r3uqituoo44u6p5ar6iypx Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf26.hostedemail.com: domain of cmarinas@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=cmarinas@kernel.org X-HE-Tag: 1641313304-577785 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: On Fri, Dec 17, 2021 at 10:27:28AM +0000, Christophe Leroy wrote: > This is a complement of f6795053dac8 ("mm: mmap: Allow for "high" > userspace addresses") for hugetlb. > > This patch adds support for "high" userspace addresses that are > optionally supported on the system and have to be requested via a hint > mechanism ("high" addr parameter to mmap). > > Architectures such as powerpc and x86 achieve this by making changes to > their architectural versions of hugetlb_get_unmapped_area() function. > However, arm64 uses the generic version of that function. > > So take into account arch_get_mmap_base() and arch_get_mmap_end() in > hugetlb_get_unmapped_area(). To allow that, move those two macros > out of mm/mmap.c into include/linux/sched/mm.h > > If these macros are not defined in architectural code then they default > to (TASK_SIZE) and (base) so should not introduce any behavioural > changes to architectures that do not define them. > > For the time being, only ARM64 is affected by this change. > > Signed-off-by: Christophe Leroy > Cc: Steve Capper > Cc: Will Deacon > Cc: Catalin Marinas > --- > fs/hugetlbfs/inode.c | 9 +++++---- > include/linux/sched/mm.h | 8 ++++++++ > mm/mmap.c | 8 -------- > 3 files changed, 13 insertions(+), 12 deletions(-) This would be an ABI change but I'm fine with it. Basically with this patch, getting hugetblfs addresses above 48-bit require explicit hint passed to mmap(). I wonder whether we should add a fixes tag (or at least the cc stable): Fixes: f6795053dac8 ("mm: mmap: Allow for "high" userspace addresses") Cc: # 5.0.x I think the original commit should have changed hugetlb_get_unmapped_area() to have the same behaviour as arch_get_unmapped_area(). Steve, any thoughts? FWIW, Reviewed-by: Catalin Marinas