Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp327210ybd; Tue, 25 Jun 2019 22:21:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3rMmT2hftNaHaO62C6xwMcaZdFZu2atPVgXwHivT0f+GQ1MGYYC9jiVMQMBL/Iz0ggPSO X-Received: by 2002:a17:90a:ba94:: with SMTP id t20mr2376655pjr.8.1561526490313; Tue, 25 Jun 2019 22:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561526490; cv=none; d=google.com; s=arc-20160816; b=zPiznEZ6W0Mt1q1TJnKMwKBF0gbdgQwJJMrakU/J+UfBnuiCBv2bPbl8OeZRGy8cS0 RRlk0YvpjJnYDHdfM4OGfrAV4lXtfAuMkRAMsS5xk7PA4YPossw9/xGVXFCJbYi1urZN /YLSs/kWhv/zqWOecJlEQQUBN0qLuqdPH6kMSH6wLCH/dM8dHCDIOpvrWAFYYD+LqYE3 5spF98NZHFaXAgfSf/UK1knHPFoxMX9cRrIReTq2DuktABcigm3WGyV3rxEeogSW2+fv I9a7A3wXtW7kIwkjyVrVpcI/y1+E9t7wMZ97RI+3X3KyRh09Iuhtmx/MXxukjZqVu+xR c4uA== 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:in-reply-to :mime-version:user-agent:date:message-id:references:subject:cc:to :from; bh=5pjbrnpYwS/GXEKx778qKfAMNKb+zKXFQK12kH6bUDs=; b=xLTx+qFP/gHLfyBH7KVlplopeR0hjYr2C8UrauGPMAuOygvzfWXYiVivbmN+Ia2niW YhwvYmdGVM6CEXQbJ+/vDhH+90OcD+g88g4JvOLEzbjMC0d0SHI709aNbIVqrYl9YzkQ s5JabiKrADPAFBwTGqjIE5Qzby5NmkjX9Bfa6y0h3t5lekO4LdYRb+G2f4QnflbFSP+8 QjhiK5qKiD4jOoBOikQ4V/QmAlx1gh/a7AXpYtIm7b8/j1nlXJNpth62Rik+Pc+KrGRU cMefO/cRjAlMEGP781SxqaUapXnnILk4f9WxKEaJqBIhiT0nb9NVSU+JKRfM44FFbRi3 IHLw== ARC-Authentication-Results: i=1; mx.google.com; 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 r8si2174882pls.372.2019.06.25.22.21.13; Tue, 25 Jun 2019 22:21:30 -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; 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 S1726401AbfFZFVJ (ORCPT + 99 others); Wed, 26 Jun 2019 01:21:09 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:47667 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725308AbfFZFVJ (ORCPT ); Wed, 26 Jun 2019 01:21:09 -0400 X-Originating-IP: 79.86.19.127 Received: from [192.168.0.12] (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id BAAC4C0003; Wed, 26 Jun 2019 05:20:51 +0000 (UTC) From: Alex Ghiti To: Helge Deller 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, Andrew Morton Subject: Re: [PATCH RESEND 6/8] parisc: Use mmap_base, not mmap_legacy_base, as low_limit for bottom-up mmap References: <20190620050328.8942-1-alex@ghiti.fr> <20190620050328.8942-7-alex@ghiti.fr> <438124ff-6838-7ced-044c-ca57a6b9cc91@gmx.de> Message-ID: <7fb32983-3444-0747-4e5f-812d1b4d84c2@ghiti.fr> Date: Wed, 26 Jun 2019 01:20:51 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <438124ff-6838-7ced-044c-ca57a6b9cc91@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/25/19 10:09 AM, Helge Deller wrote: > 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 goal >> of this fallback is to find, as a last resort, space between the top-down >> 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 Thanks Helge, Alex > > 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_parisc.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 *filp, unsigned long addr, >> >> info.flags = 0; >> info.length = len; >> - info.low_limit = mm->mmap_legacy_base; >> + info.low_limit = mm->mmap_base; >> info.high_limit = mmap_upper_limit(NULL); >> info.align_mask = last_mmap ? (PAGE_MASK & (SHM_COLOUR - 1)) : 0; >> info.align_offset = 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_stack) >> { >> - mm->mmap_legacy_base = mmap_legacy_base(); >> - mm->mmap_base = mmap_upper_limit(rlim_stack); >> - >> if (mmap_is_legacy()) { >> - mm->mmap_base = mm->mmap_legacy_base; >> + mm->mmap_base = mmap_legacy_base(); >> mm->get_unmapped_area = arch_get_unmapped_area; >> } else { >> + mm->mmap_base = mmap_upper_limit(rlim_stack); >> mm->get_unmapped_area = arch_get_unmapped_area_topdown; >> } >> } >>