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 C938EC433EF for ; Tue, 4 Jan 2022 16:22:12 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JSyYv1BThz2ywZ for ; Wed, 5 Jan 2022 03:22:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=145.40.68.75; helo=ams.source.kernel.org; envelope-from=cmarinas@kernel.org; receiver=) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JSyYQ251rz2x9p for ; Wed, 5 Jan 2022 03:21:46 +1100 (AEDT) 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 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-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "alex@ghiti.fr" , Steve Capper , Will Deacon , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "will@kernel.org" , Paul Mackerras , "akpm@linux-foundation.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7E517C4332F for ; Tue, 4 Jan 2022 16:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iWRIvnlEKe9Z+OIBtT/kHIs1uFVxq+1zxj5aBX8euY8=; b=l+ETLCsmBOfy9S Cq911v3df5534ILr2yQ4Vas1D3fIZdF3i1nRnEAVjrb0rAsk+XE6H7F3Ror5nqxPtE8x2inDQvOW4 APU5iQSM8619TpTTCmnBFaYrjLsPs0i1yFWvIib9IUNL2y8tj2gZ8fuWojG9Lfdvxp33tF4NkB9vR 9raebTnsXbKTmS4FMCPmY1BiqnWyxW7wFLLZOPFSXmspUFFs0GmSvYsfiVcQDkDTC1SOABGbdLR/z nDIbHzMqJtfPrjTPG5ym74dxEgPZs6Wav03CY+hhC3aKR9bnM4b0q3oF4C3qckIlfJIoV/tImcl9u tz2BuXOt7oSNrwWRBbgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4mZI-00CFfK-OO; Tue, 04 Jan 2022 16:21:48 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4mZE-00CFeB-O6 for linux-arm-kernel@lists.infradead.org; Tue, 04 Jan 2022 16:21:46 +0000 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220104_082144_970151_A9678A87 X-CRM114-Status: GOOD ( 24.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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