Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3710098ybd; Tue, 25 Jun 2019 07:12:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBOXiUHD0oFvT4mNpVPor4kLquyvmcXE4PkTdRj8pu1qeiz/974u7JMSr6kFEI36DDN5/F X-Received: by 2002:a65:560f:: with SMTP id l15mr15708038pgs.94.1561471979198; Tue, 25 Jun 2019 07:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561471979; cv=none; d=google.com; s=arc-20160816; b=YzdS9JIRaQcqyqhbFBL6aS7AXGyiug6NU+N/MHW9ZB1neiN/yCIdlwOr1c8xi2r9Qf eksKC3Smfz43l+lQBGr5Av+lVxbVHsIrK3ZTkYtVn5hMmG33XxScrBkJ+m/7tcbfqeHd nXrA1yhRmu5o71tWYeizcYRF1qNjy4w9cl3yGvqq63MktS9Pv/DWiZlWBkzG7YwZqxp9 584wPVmQplBodLPJEQ25WGyNy+tB5bdQtfoCRP9wn5cD3rSUzRjuaZi09Evrp/nQRYOZ +XCSlD8ZId8W31wd/7dPWeykIwMan4kCmOMEgd/z1nIdi2/jDzef74xY/1xHMYmsoovl cV+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=rL9ctXGhDlIewEfxgOy17p+7G9lfmX8egjYPfK7F3z8=; b=Pals6pZPP1EGlta9HevL8r5YMtPhKe2rZU+nH/AYD++/I6bbcGYTPGgiunW0TKkA+a irTqe6sLWE7tS41epSmjDofDUhqebJdmQO+rxhlBs9w/ofghwvb//cU61QN/FT8TONu4 wuH5ET1c7xtpzfyl+l9/oeznxSVRY0xoS6vAa7qfGf0yY1RStuZo98aLQWyWQkkj+wre P3D7eGk+Hi2DYkKH4QO48l9HqD0mrJZsiLVEvEty1/tIGD4gs2IlpneYgi7WteMsH+N6 j9mpDBNRi0LCdGPgQksNOs8w0UJWlPVXVoMEtrcmwQfdh/Gs4AAKc0l9V4f3DxJcOUy0 F7/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=edsbQroI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si13410808pfi.92.2019.06.25.07.12.42; Tue, 25 Jun 2019 07:12:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=edsbQroI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729496AbfFYOLF (ORCPT + 99 others); Tue, 25 Jun 2019 10:11:05 -0400 Received: from mout.gmx.net ([212.227.15.19]:46075 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729432AbfFYOLF (ORCPT ); Tue, 25 Jun 2019 10:11:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561471750; bh=O/AVriiFXTyhIO2mqpq3Ioyp28ORdxttZFv5ecPR+mc=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=edsbQroIWHv5PrtjtfjZNIhaA6vbnnEhe2iPxwgKuAPNIOGmyRqiQTBnaT/rlfHpm upx5WA233sSsPfr45ICeSv79Qf5cEZ7WBrUjnMGLpmwlqPsbkccAq0Vt0A31t0Dihd HbD3PjlIvvSVLRMDuhhPe5yAPKH6w2z6pgXdr9n4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.20.60] ([92.116.144.45]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lb5nF-1iQLEd1s3V-00kkGd; Tue, 25 Jun 2019 16:09:10 +0200 Subject: Re: [PATCH RESEND 6/8] parisc: Use mmap_base, not mmap_legacy_base, as low_limit for bottom-up mmap To: Alexandre Ghiti , Andrew Morton Cc: "James E . J . Bottomley" , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Yoshinori Sato , Rich Felker , "David S . Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org References: <20190620050328.8942-1-alex@ghiti.fr> <20190620050328.8942-7-alex@ghiti.fr> From: Helge Deller Openpgp: preference=signencrypt Autocrypt: addr=deller@gmx.de; keydata= xsBNBFDPIPYBCAC6PdtagIE06GASPWQJtfXiIzvpBaaNbAGgmd3Iv7x+3g039EV7/zJ1do/a y9jNEDn29j0/jyd0A9zMzWEmNO4JRwkMd5Z0h6APvlm2D8XhI94r/8stwroXOQ8yBpBcP0yX +sqRm2UXgoYWL0KEGbL4XwzpDCCapt+kmarND12oFj30M1xhTjuFe0hkhyNHkLe8g6MC0xNg KW3x7B74Rk829TTAtj03KP7oA+dqsp5hPlt/hZO0Lr0kSAxf3kxtaNA7+Z0LLiBqZ1nUerBh OdiCasCF82vQ4/y8rUaKotXqdhGwD76YZry9AQ9p6ccqKaYEzWis078Wsj7p0UtHoYDbABEB AAHNHEhlbGdlIERlbGxlciA8ZGVsbGVyQGdteC5kZT7CwJIEEwECADwCGwMGCwkIBwMCBhUI AgkKCwQWAgMBAh4BAheAFi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lGYGNAKlvp07SimS6vBEIXk/3h5Vq4Hwgg0Z8+FRGtYZyD KrhlU0uMP9QTB5WAUvxvGy8= Message-ID: <438124ff-6838-7ced-044c-ca57a6b9cc91@gmx.de> Date: Tue, 25 Jun 2019 16:09:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190620050328.8942-7-alex@ghiti.fr> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:oGeLQJsmVPbobDimclHPwWqvExkEWwDRtzy5sld1Sw9SxJAviNo VuQB0COfpiok+m5jvyYs01Ly4kyUgKDpl5OpmZGb/VVWXwVEOjDdoK9ZoeMc+DIU6pRZJt0 JvuTryyyRf7udxOK0xUojwH4decoxd3bBxJesqe7Pgv28mN4zgXudEpsMh5cxdU6PS/wnLK yVxaq1UtwUSVfYPzYTqGQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:jsCViK54bZY=:vmFM6D3KKJj8EdDNSBPHOx lzUVh6ZBu/d0aTycPJ2LhVS/jmSEMNKPUmN3LvgGTC6YrnAIyz3rS6JQHslHLHWyVmxE4saQa +fQQxuXvHwKqXtKwuVz1hK0lYc3/+2wJMpQLabsnIWgBZttOakJB1ypeAt861TLVxq6y4Wp2v X+wgqwjaG5GHOp6o1uZY2R09MQlMboRqyVThCNzlbRJkML3FJs+AkqChxGbXXVQWtlFrvLXlp /r3i63bR7dwqQ/lVdxROq6jgqeBusB/XX8j2vLZEUrJ5oArlXLrKS4j26V6FxvFU0bNT+dRnA 7T0eeUu8Nw9iOswaCkE1tAwWK9ID6QyD6FIvV1alI5qogfR9w6xnfQ2n1gULDBVOQVSV4Ckpa ICrDPCmYhGv81wPmTrpCtIeqk1wryhgnH//XfwDUcW5aGAP2B6EXzeFjgshbKCI8igg0nlo1V 0knzlxwd/g1dibOMDu2rlQhdYlQhXk/i4y47JiykhczbUlWLD9ZTAkuIARhRE9nTbApTXWk9k igKE6AKH1j1BVDP3QXtoI7Bfa/0R2y2jNvbGEJdS2hm5Grxf7WlQqutaCHBEeKUZGIugchGJH gBPQthXqSgnYQKIaUipVcFiGN7ASlZu/AyHXOmnK+cxPqp+7nZOrdLA+R1oJQoAPzKx+4exHU KKp9xUrQDhsXVEuYzRfJoNZ130+WizBAcQg2gPW6pPmtkkNgbWquLNhsc2clAT2FoPbOI8x7B kmAyyqfuC1EDnNrjeRo0iCSK3LYKk/fcvbZfxZa1RWn2M8ddvI9a22Bp9qq97UDj+WtLC7vzT chRiiAJr+z8rfg0rrxA0L/LuHLgBMrOxgWiOumM4Jze/YlpuDan2OZTHh/dmz0N/PThNRJo7g +cenmgWIQdaMLxxQNZ8xfIKQPhNB7txhrtbTU98rZVX8j5AONAf6BJ93pAiB33GQIZCMzB+hD ieobmt2ei079i9U2TIxlya1W2BfBpxKI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20.06.19 07:03, Alexandre Ghiti wrote: > Bottom-up mmap scheme is used twice: > > - for legacy mode, in which mmap_legacy_base and mmap_base are equal. > > - in case of mmap failure in top-down mode, where there is no need to go > through the whole address space again for the bottom-up fallback: the go= al > of this fallback is to find, as a last resort, space between the top-dow= n > mmap base and the stack, which is the only place not covered by the > top-down mmap. > > Then this commit removes the usage of mmap_legacy_base field from parisc > code. > > Signed-off-by: Alexandre Ghiti Boot-tested on parisc and seems to work nicely, thus: Acked-by: Helge Deller Helge > --- > arch/parisc/kernel/sys_parisc.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_pa= risc.c > index 5d458a44b09c..e987f3a8eb0b 100644 > --- a/arch/parisc/kernel/sys_parisc.c > +++ b/arch/parisc/kernel/sys_parisc.c > @@ -119,7 +119,7 @@ unsigned long arch_get_unmapped_area(struct file *fi= lp, unsigned long addr, > > info.flags =3D 0; > info.length =3D len; > - info.low_limit =3D mm->mmap_legacy_base; > + info.low_limit =3D mm->mmap_base; > info.high_limit =3D mmap_upper_limit(NULL); > info.align_mask =3D last_mmap ? (PAGE_MASK & (SHM_COLOUR - 1)) : 0; > info.align_offset =3D shared_align_offset(last_mmap, pgoff); > @@ -240,13 +240,11 @@ static unsigned long mmap_legacy_base(void) > */ > void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_st= ack) > { > - mm->mmap_legacy_base =3D mmap_legacy_base(); > - mm->mmap_base =3D mmap_upper_limit(rlim_stack); > - > if (mmap_is_legacy()) { > - mm->mmap_base =3D mm->mmap_legacy_base; > + mm->mmap_base =3D mmap_legacy_base(); > mm->get_unmapped_area =3D arch_get_unmapped_area; > } else { > + mm->mmap_base =3D mmap_upper_limit(rlim_stack); > mm->get_unmapped_area =3D arch_get_unmapped_area_topdown; > } > } >