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 1EFA1C433FE for ; Thu, 9 Dec 2021 09:50:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C34C6B0071; Thu, 9 Dec 2021 04:50:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 673826B0073; Thu, 9 Dec 2021 04:50:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53B3B6B0074; Thu, 9 Dec 2021 04:50:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id 43FC06B0071 for ; Thu, 9 Dec 2021 04:50:25 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 04E918994C for ; Thu, 9 Dec 2021 09:50:15 +0000 (UTC) X-FDA: 78897785190.28.39F1307 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf07.hostedemail.com (Postfix) with ESMTP id AA47740005 for ; Thu, 9 Dec 2021 09:50:14 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id p18so3447574plf.13 for ; Thu, 09 Dec 2021 01:50:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=dflFa57KzKY7miq+oyqL8dKoeanSyMiQ37rQN5fCdoo=; b=hSPPIGtTqBk+SmIs7bjQkgAd5gyMcHBS3ZjLqd+5UqIjZ17nfbytSiaBWT8xWtdKxi 6y5NybwuBgMxW03+gjYkLqtgAjWrl6CPBoMeE3YkLBvk59H1XlB+NAhh7ymmfCFTmT5G VYYQgAn+eV3uoQUzoDZ65L62QhWGznavzTEhpPr/K2H8FbWfMlV3cijHGTUteCzCFmXO Ta+ZnlYSBlpp4c4BL4oARIkInvSme3Z4IoifXmF/knJdxvFJJWYUG6C0L+k/TLFQH++q Ki7++aPkAX5x4uAT2XFfODKECO0xvS6IwICKeCe3FvH8wzNjbKORxujyV48thLG3F51V 4AZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=dflFa57KzKY7miq+oyqL8dKoeanSyMiQ37rQN5fCdoo=; b=t11vqKcP8kIgYBpvNlEupEoMti2gYh4UtN7bHiBNbBsvuEKiO1iu+e+7x7LgaKYzQH o/l3ai8skknngMSxGkeS4DiEKKNM5LfmQSQ+pkDRlzkzLEmjIqI9YPhhu7D5yKtW+JXQ J6kP1LVbeXDBFuL0+TBNFG7Ij2lWGRLAAedoF20bane8f/PvoiirNzQYCBEjhmtFMgTS L6/xveXOh2fSfeBh0j9P45sWEXIZSVkX0BgC9SyhAu/yEDURNKP0IJDqoZUnfOk0cfab QT8VSlOryoB6yCiox12JhtZdGBaSDK0li1S7FCKDVGUz3si9aRpqmzWzVy6hUFINf0dZ 1zhg== X-Gm-Message-State: AOAM5301C2W5AqaGnDZGH2RCTfonEdUSzufcpYLfi/Q1jlKPeVfjHA9o OwdwIhvXS709tQOCvrXzg3I= X-Google-Smtp-Source: ABdhPJyY2fdAACtiJPICzx8niudtj7D9tiYJtKmUUH+J5Ymcu4yJcVh8uUq3Z3w9yYkhJiN/99VgAA== X-Received: by 2002:a17:903:185:b0:141:f5f3:dae with SMTP id z5-20020a170903018500b00141f5f30daemr66362344plg.56.1639043413657; Thu, 09 Dec 2021 01:50:13 -0800 (PST) Received: from localhost (203-219-139-206.static.tpgi.com.au. [203.219.139.206]) by smtp.gmail.com with ESMTPSA id f15sm7099488pfe.171.2021.12.09.01.50.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 01:50:13 -0800 (PST) Date: Thu, 09 Dec 2021 19:50:07 +1000 From: Nicholas Piggin Subject: Re: [PATCH v4 06/10] powerpc/mm: Use generic_get_unmapped_area() and call it from arch_get_unmapped_area() To: "alex@ghiti.fr" , Benjamin Herrenschmidt , Christophe Leroy , Michael Ellerman , Paul Mackerras Cc: "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linuxppc-dev@lists.ozlabs.org" References: <8f54a8d097c402d808147b2044365ebfda2862dd.1638976229.git.christophe.leroy@csgroup.eu> In-Reply-To: <8f54a8d097c402d808147b2044365ebfda2862dd.1638976229.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Message-Id: <1639042828.6q5z2bujam.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: AA47740005 X-Stat-Signature: 5iommhs9bcuizukyhcz1ma4htegntof7 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hSPPIGtT; spf=pass (imf07.hostedemail.com: domain of npiggin@gmail.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=npiggin@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1639043414-845759 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: Excerpts from Christophe Leroy's message of December 9, 2021 3:18 am: > Use the generic version of arch_get_unmapped_area() which > is now available at all time instead of its copy > radix__arch_get_unmapped_area() >=20 > Instead of setting mm->get_unmapped_area() to either > arch_get_unmapped_area() or generic_get_unmapped_area(), > always set it to arch_get_unmapped_area() and call > generic_get_unmapped_area() from there when radix is enabled. >=20 > Do the same with radix__arch_get_unmapped_area_topdown() >=20 > Signed-off-by: Christophe Leroy > --- > arch/powerpc/mm/mmap.c | 127 ++--------------------------------------- > 1 file changed, 6 insertions(+), 121 deletions(-) >=20 > diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c > index 9b0d6e395bc0..46781d0103d1 100644 > --- a/arch/powerpc/mm/mmap.c > +++ b/arch/powerpc/mm/mmap.c > @@ -81,115 +81,15 @@ static inline unsigned long mmap_base(unsigned long = rnd, > } > =20 > #ifdef HAVE_ARCH_UNMAPPED_AREA > -#ifdef CONFIG_PPC_RADIX_MMU > -/* > - * Same function as generic code used only for radix, because we don't n= eed to overload > - * the generic one. But we will have to duplicate, because hash select > - * HAVE_ARCH_UNMAPPED_AREA > - */ > -static unsigned long > -radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, > - unsigned long len, unsigned long pgoff, > - unsigned long flags) > -{ > - struct mm_struct *mm =3D current->mm; > - struct vm_area_struct *vma; > - int fixed =3D (flags & MAP_FIXED); > - unsigned long high_limit; > - struct vm_unmapped_area_info info; > - > - high_limit =3D DEFAULT_MAP_WINDOW; > - if (addr >=3D high_limit || (fixed && (addr + len > high_limit))) > - high_limit =3D TASK_SIZE; Does 64s radix need to define arch_get_mmap_end() to do the above now? Otherwise great to consolidate this with core code, nice patch. Thanks, Nick