Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1496654ybi; Wed, 19 Jun 2019 22:11:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+WgPERg7VQEn6EVoKytuI4p7xPWvaFy3SUkULAtcvcxwDunAEaRNl/lWHdqBYWOzgAinM X-Received: by 2002:aa7:8acb:: with SMTP id b11mr127396701pfd.115.1561007505099; Wed, 19 Jun 2019 22:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561007505; cv=none; d=google.com; s=arc-20160816; b=bSLfDT4D6hWk7zGQEpTl7Rw8enI4lpa/kSvoeKg4oFWHQ4s15XHBik4nFIXHkjpRhg +YnnIzNX4wKgKg7Lbh43E6loMeWZ3LWgG99orZYwFS1SDOFkrM0y7h/x+075NG795qXw 7atKSxaJ/iYgSM7exX0OCGE7mTGEWH9Ve/tNjaCLYuy4zy5ydjHCiAbIjbfxYP7C7E/8 hcS+fjaf7w7E7uHt0qpBWW5JirXg7SPNfEmmHNwUj85N+WSAvZ2J047FaLYeDM0dZzMF q6O6OhsA2LBt7RJ0u3/jBt6MLR0p5A8RR2Srku0ws0P299rBwi3j0d/8+guJ1hRNSQ0K YRHw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=30VPFryCoEsVbaJedBbFHYEdEa2oyzBbCy4so5XhB44=; b=fOigfhFxjEfvcFr/QIHhr6GMn7aCmvaIKIPGLHZ0yuNytHXsIG+obqsWdy/gR+gG3W mKcbb1IRM6pMUGJ/twnIaUi04Qs7Zy5a1jCvZJGy0RLJURH3lQWMO476gRES9B8VGW+6 L5vSeAyxVAnsGWxdg5sYwhNkW4tPYPWnYrN28EtYvKKIberTFUhGRAjWjTYiV858tN7B s4WoYz3TSMteBJ4INUyGKiwViX4Xi/Llwewp5L01NvoZs/inYzlLaj8nFWe+cGk7cAxV X7Sy6ihMFDUTTTVP/pIOcaaOeAQgtTa3JzPm2Nuv1iTKV20+VHTWAeMLYKyLegRvAsIn FYWw== 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 16si18534542pfo.12.2019.06.19.22.11.29; Wed, 19 Jun 2019 22:11:45 -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 S1726567AbfFTFLY (ORCPT + 99 others); Thu, 20 Jun 2019 01:11:24 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:40273 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbfFTFLX (ORCPT ); Thu, 20 Jun 2019 01:11:23 -0400 X-Originating-IP: 79.86.19.127 Received: from alex.numericable.fr (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 6AFE360006; Thu, 20 Jun 2019 05:10:58 +0000 (UTC) From: Alexandre Ghiti To: Andrew Morton Cc: "James E . J . Bottomley" , Helge Deller , 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, Alexandre Ghiti Subject: [PATCH RESEND 6/8] parisc: Use mmap_base, not mmap_legacy_base, as low_limit for bottom-up mmap Date: Thu, 20 Jun 2019 01:03:26 -0400 Message-Id: <20190620050328.8942-7-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190620050328.8942-1-alex@ghiti.fr> References: <20190620050328.8942-1-alex@ghiti.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } } -- 2.20.1