From patchwork Wed Jun 19 05:08:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 11003375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22594112C for ; Wed, 19 Jun 2019 05:11:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1161028B4C for ; Wed, 19 Jun 2019 05:11:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04BF828B50; Wed, 19 Jun 2019 05:11:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9305628B4D for ; Wed, 19 Jun 2019 05:11:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CDA726B0003; Wed, 19 Jun 2019 01:11:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C8A848E0002; Wed, 19 Jun 2019 01:11:40 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B522D8E0001; Wed, 19 Jun 2019 01:11:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 6B5CB6B0003 for ; Wed, 19 Jun 2019 01:11:40 -0400 (EDT) Received: by mail-ed1-f71.google.com with SMTP id o13so24451699edt.4 for ; Tue, 18 Jun 2019 22:11:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=srNjincvqY5G24pyZeONdm1hP7PP/oYRsoEsOQD60iY=; b=Ql1euMJDp67c2PS1OiZsJzlduoCW0K7omssxOSc+k3mtZd5aJYdfxxknSRR17wlZbq azG8wYu7bzdU5VxsCalrn1OaB9x0E11hWpkjr3aANOmsxgYVSdU+vJbMyXKeUDoxHtY+ PeHrETfsYDposjNAnobEuArUkn/TiweCJqVnNbRL5eehyQHDgfYlowi+FnYS4PBop+lV EqE7tDcGGLJKodHq1qLyfqalcEjqMrCae/XB0o4jH+TZCxDbTA/jYTx+Wb6tcOhpmahY xN62sHps+5aldZyU3VR09WrGqjWZ9VXVd3yFyBhrjjjtb6jvr7XIszRrMbANEcCA6/Tp BvGQ== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.195 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr X-Gm-Message-State: APjAAAWD/D1bxLpR6gTWYbuz2sNJ4qlhP9khNO2M4LaKBESaWliIUIyL sgM6fWfwXhxMKDTP11Ajh4dcZ63q1rsm+GukxExClEWLLnZY/qDr6CgCIFEzvKZ9AAp1MXnae68 0uN3/5wi4IWuu/M7Id+x5xKo8gtQyotdnLYQ5Pk7GqFm6Sq5n8j4nKRnZuhkZ6Kg= X-Received: by 2002:a17:906:774e:: with SMTP id o14mr7508004ejn.175.1560921099960; Tue, 18 Jun 2019 22:11:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDQjR1vfstl9qAMysWC8THO91Dj79C6PZUz/QR2BGZueQRNCo7ZGPiGzRlUEBG/SAHmbk8 X-Received: by 2002:a17:906:774e:: with SMTP id o14mr7507954ejn.175.1560921098903; Tue, 18 Jun 2019 22:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560921098; cv=none; d=google.com; s=arc-20160816; b=EdU7KM20Fo7LMODTLLgwsC/zx7XjfOQWFlOMSN9Ha81kxVkUV4/CD/708tte4z6WCn +/npX5e4DQ33sK5E6xHZpE2iPHpwjoJbi3Ovj86/L5LGKx1l1FGCtoSzCcg4m5tnPI7v M7UMzJnNwc4/8HAoM8zBNg5QiFivkYPnUaIFZHESn4WHnaqTyAFTzfJFPXCYWPgPCi3T eyfOJBzznQKI669J0IRDwQX52BzLMJXvAjYufJHxAdrOhsxvK9Q3gsjW2x0BIU1jV9CX vjyVC+KnCi8NY316DE8jVlEsmNOc/d1il3n/cSY0B0LNH5I6oNT4reIb+Z/gKM9sYJsR r02g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=srNjincvqY5G24pyZeONdm1hP7PP/oYRsoEsOQD60iY=; b=ExP1VT+mXSdi62xPEZpYLF2sLFEW6iadpBhQq6c3yV8+B0RlyYqLvfGbCNWIJIavQa GKbFUsRa8QWBzYbIhhH0uDRc3imWUAfHV0pqcRIMPCTy3bwgi7I2k0VtP4+RekCJ9MMz 05iggjzaW12QILeum3HNi5MjiXNMyvXUX2s/ZKJaEoPsu54J1OHZpiacRKz8/IVmuqOQ rz22xXzmTkPBkZOW9QZyMEancEeRdRu8N3JBv4qzmizWgHnAdXr4out44Jl5hgtEGRVs //Q94uyCI4i1inzm5LIKoHb/WDQTdjukjMERIUg51PG7ukYWXZKYjZrUwO96ZfYg08ep 8teg== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 217.70.183.195 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net. [217.70.183.195]) by mx.google.com with ESMTPS id h44si12885044eda.49.2019.06.18.22.11.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2019 22:11:38 -0700 (PDT) Received-SPF: neutral (google.com: 217.70.183.195 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) client-ip=217.70.183.195; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.195 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr 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 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: X-Virus-Scanned: ClamAV using ClamSMTP 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); }