From patchwork Wed Jun 19 05:08:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 11003367 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 519CE186E for ; Wed, 19 Jun 2019 05:10:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4230328B4C for ; Wed, 19 Jun 2019 05:10:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 360F828B4F; Wed, 19 Jun 2019 05:10:20 +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=unavailable 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 CDBAA28B4D for ; Wed, 19 Jun 2019 05:10:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F250D6B0003; Wed, 19 Jun 2019 01:10:18 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id ED51C8E0002; Wed, 19 Jun 2019 01:10:18 -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 D9FA28E0001; Wed, 19 Jun 2019 01:10:18 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id 8E61E6B0003 for ; Wed, 19 Jun 2019 01:10:18 -0400 (EDT) Received: by mail-ed1-f72.google.com with SMTP id i44so24445722eda.3 for ; Tue, 18 Jun 2019 22:10:18 -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=suPCocrA3QM64gsofO1CrTBeyBcHKAtqoGrxzUvLo4k=; b=YDtqX88FesVO+co+I7guJgHYPCt2IGk5xyXMQTOsqEUL88Z6sm/pv1Al5rbjQkhgkY T1Neu0wJKr7LqqIAS3N+f7AnNlWTiXSTb8nQTAmrVlBsk5iDTNodM5H1zaiVdGupjjsm QwuBMGfEj41dsdUZ2hktfYnUXWz2aYySgG4OvQy/JdDcqEnZOvbJyJBo7qPMERNpOCt3 hljHXkigVsGCWXm+i/6n5BrFbHgflS2OstZaMhsG74wFiyw24fJT8Ddvcp9Boi4SrHOg 6VA3u/0mglNBhBz+fEzKSzL6Szp5adzx1WgH5VSWY05CSXLjxEt9nwgnSYotNmxKeMM1 gMHQ== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.200 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr X-Gm-Message-State: APjAAAU1BGpHgBhTNh1zIdu2ktIG024lqefVd6I39B2fFiG2YaMHJiZC rMhOsOB7zLkr1DxcKJXQx8puXgQrSJBodN+eCqjj9LdrIb7l2CWCkuWPPQlG2R51WCkeR93Aox5 HSBNcReb+NDMM1QSfYsLc4V4SW5kIfGAjFwpRD5Mz8SjLffkSAEHT/7r81FgW4F0= X-Received: by 2002:a17:906:1845:: with SMTP id w5mr44109095eje.0.1560921018097; Tue, 18 Jun 2019 22:10:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdJzhUFp8L1oJd5JOAl33GR9sFAGAjrHisw/PnLpruOEqrAeqvRtPWMK0aMETFAJ/0B57Q X-Received: by 2002:a17:906:1845:: with SMTP id w5mr44109040eje.0.1560921017058; Tue, 18 Jun 2019 22:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560921017; cv=none; d=google.com; s=arc-20160816; b=ZUGG62bu1MdrJLUdoeT+Yw0G5lnIN/TMhR5UMOK2eOExjA5K6MczG7NzZvPk+btdDK 0R7nH353P0eonQLUkUknFQihAVmqEl7mQYID6+Lf7Jg/ceJaYy+xw9YP4IUczaKUdyQl HWWA2gFpVHrUj8t6n6kpDDJRAPqFR3Z9eCICZ+TO6r1435iGu9GWoh+P2lTotIyChT5O H20V75luhbvsNVDkSfTkgvmLKsUUiRQqIluARVCdNTGp1nsXBzNhDzQ3xeJTHQG0O/zP UFcy0DZy+zOBNLPIkHFN/qHtccLVBawvvzf6RKR7PhrDGfX7rr72JB4PjPZbfRuyK1ad dkjA== 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=suPCocrA3QM64gsofO1CrTBeyBcHKAtqoGrxzUvLo4k=; b=fDTPDoggLUVN70Q9ab+ghdQlG0J93LOj2LysuTLgDUjYmBDMmnqMEFe9Uf93YrRgh1 j3je3Wh4iBSWZeakUCuvlSbD/VLAwkSA59WtMNnZ5gc7CxDNT0RXOFQK7IKYKaiMPEfl VYaRcpmM7poSFygLFg42mEQZ3EL7IT6rdSI8mi0oCXryZ/CX2hc/4jLMbkyHnYdYjhcs wkxIF6Mif8aSTEuuNUkOQ1pB7KpDIpoPv3fx0cqt7kZGHsoYY17SYt+eTLztislbXUye mmZgmKtPGRQp4zkL2v8XNXVz7OpHkAHoxQ6bmdI3r+cAJjv8cB8Sm05A3NV7GwKRw2DQ ZhXA== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 217.70.183.200 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) smtp.mailfrom=alex@ghiti.fr Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net. [217.70.183.200]) by mx.google.com with ESMTPS id h40si13160243edh.219.2019.06.18.22.10.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2019 22:10:17 -0700 (PDT) Received-SPF: neutral (google.com: 217.70.183.200 is neither permitted nor denied by best guess record for domain of alex@ghiti.fr) client-ip=217.70.183.200; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.200 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 relay7-d.mail.gandi.net (Postfix) with ESMTPSA id C1E8920008; Wed, 19 Jun 2019 05:10:11 +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 1/8] s390: Start fallback of top-down mmap at mm->mmap_base Date: Wed, 19 Jun 2019 01:08:37 -0400 Message-Id: <20190619050844.5294-2-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/s390/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c index cbc718ba6d78..4a222969843b 100644 --- a/arch/s390/mm/mmap.c +++ b/arch/s390/mm/mmap.c @@ -166,7 +166,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); if (addr & ~PAGE_MASK)