Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp258067ybi; Tue, 18 Jun 2019 22:12:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyham3jVqmlBdWkEG4ifYThhbZDvQd6x+VQAQQEWld6HTEKUE797/gPFJRv5lynKsfPkIVn X-Received: by 2002:a17:902:8207:: with SMTP id x7mr16924243pln.63.1560921129385; Tue, 18 Jun 2019 22:12:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560921129; cv=none; d=google.com; s=arc-20160816; b=YdFnSflEm5i4YTHiIRzkyZpHX9R7bBYi6fExfcTX7556Chsy0Z+h4TLiXvRmUeauVX O/K+NNFv7WRy9YmQXRFtAe8FVeLlmYhRdOauGuUkKTs+2gDTE3GLwWpBMORgX0iTOMAC r17zLNa1L2fjKU1gdGj98cmwt6S1DmG9GHKICxbQYq3SBHX0iH9av7PWS6Bvk8X3AssX rbIWyMeWppjlYQsZGuTNa6Ym9UcIX6H4G2t2QL13WtgFybpNqx7njlCH6l/VPIyxGZJb vcxVdVOXtGdAodS81B78RzmZDaX2huCRKsOQNYD2w+BPUyAFUPbW0JHJ4543TcwNFeNk GnGA== 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=srNjincvqY5G24pyZeONdm1hP7PP/oYRsoEsOQD60iY=; b=AVQlG6Tgb/4f5dOmltwZeGIvkedZ6ylhM0IFqANRK7g1zduXi+y/88FHMjb0XMzft5 HK9HbcpC25N5zHI3w+arCuqGXx4XscQBW5aTF0IhjnHstIPOjpPcfmqVOvT8jlIApsJe pYAwI5oRmwihsG6/6c/540RDo2eytL6VRWRXGxIxJ+3rMIs0eL4mANsEcCK/GqERFGtv OGXa6Ck9q5tycTTvJ9mr0BLTSd3oym9gkoka28Degu7pjOA4Sd/z1XgL+FRqMqr0uVSm 6PYYPwPKVC7mXtaVCPBRJfnPUOmjK+w+oMwxK0+vgOxdEUvda+fezVxPNWdmvnfP5VtH 04NQ== 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 d5si15774415pfc.131.2019.06.18.22.11.53; Tue, 18 Jun 2019 22:12:09 -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 S1730595AbfFSFLm (ORCPT + 99 others); Wed, 19 Jun 2019 01:11:42 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:50481 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbfFSFLm (ORCPT ); Wed, 19 Jun 2019 01:11:42 -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 DC9AB60010; Wed, 19 Jun 2019 05:11:16 +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 2/8] sh: Start fallback of top-down mmap at mm->mmap_base Date: Wed, 19 Jun 2019 01:08:38 -0400 Message-Id: <20190619050844.5294-3-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619050844.5294-1-alex@ghiti.fr> References: <20190619050844.5294-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 In case of mmap failure in top-down mode, 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. Signed-off-by: Alexandre Ghiti --- arch/sh/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c index 6a1a1297baae..4c7da92473dd 100644 --- a/arch/sh/mm/mmap.c +++ b/arch/sh/mm/mmap.c @@ -135,7 +135,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, if (addr & ~PAGE_MASK) { VM_BUG_ON(addr != -ENOMEM); info.flags = 0; - info.low_limit = TASK_UNMAPPED_BASE; + info.low_limit = mm->mmap_base; info.high_limit = TASK_SIZE; addr = vm_unmapped_area(&info); } -- 2.20.1