From patchwork Tue Apr 25 22:33:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 9699953 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BA9AF601D3 for ; Tue, 25 Apr 2017 22:36:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B13212846B for ; Tue, 25 Apr 2017 22:36:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3A2F2857F; Tue, 25 Apr 2017 22:36:30 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2F09C2846B for ; Tue, 25 Apr 2017 22:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=LskduKL7+JsR2hzcPusYzGEVLYSSjsOv/6IUxfRwFTg=; b=h5pvKqkIfBZemTRp5ikriTGmf8 AtBiD+ueEfUQpycSJWSSpIiekiJiE78zaNE2cmUNIMfOzabhUQMjEVaE5swx7sS2te2VHcN9g8ukx 10ibbLO4ckM5C6jHEACIpclV5QOAvp4XpoBSLqIP7IbH7Hq7je5eHk757Hpk8ALUJ1KisDo8seYhG ls2kq7b896R7TwveWY+VMz1flmwOw8Bt4JTYjeIo3apF6fN9nFU5WLSvSAwSUVOfs5+OkfCzmEjcU s6xSDKD2x5fBTvJmNLh0cDS6CW7gdagWBSVse4DXb2b2c3iMBQtx1j5hbfWgwO+EqXnntEg+ehazt Ujn7JVmQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d394O-0008Tf-Te; Tue, 25 Apr 2017 22:36:28 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d3946-0007wJ-89 for linux-arm-kernel@lists.infradead.org; Tue, 25 Apr 2017 22:36:15 +0000 Received: by mail-pf0-x244.google.com with SMTP id g23so12805007pfj.1 for ; Tue, 25 Apr 2017 15:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IVh/8SwKhjjtVbT3x/nQzBCRET3+8U8uEC7n0meKn/g=; b=fZTZRWyVBEeCXSZQk66n1EfF+dYSOcPd4q05kZbDfmhQjhNkETc3O6bxxk+hr90i8U U3ZLawc3YqrBPvnThjuRA9qOxS7ohZUZX6qusi8vF10gcQVbdWXlpJeYwWuqe6XaVoNK uYmJkWL5dhwkPLJiqQnBXa0nU5Yk98j6M71n7uT1/EZvPV/Uyose8qu4GSYsL/Ex94uZ w8qzbdNJOMQ6NsvUBeiJoKFtsn/Y9E7hP3XPwKBO7WGRyroDswt/CYRhAoEk3R1vDO85 bH1EttAGn8VQBVGyBhIpfrfMXQ0fTnyUYkMhJTTL7VmX2MknzEyu/0nHmFJ09RJqB67w 7KgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IVh/8SwKhjjtVbT3x/nQzBCRET3+8U8uEC7n0meKn/g=; b=ckQClbxAFurbWCnKmDQz3Y7vAc/gTLE48aD8b5A0cI0x5KH5qnIwv0L4SiC2i8/MDO qvT2pEBGOFpsJqy13FELk1yK4zU+SCVGWPwM6Gw5DWU9d+XBFHgZEqoLDlOxMSeNXB2r ox5Id8+zh64OAuhQVpwfj6EfSSZg/F1r1UXiZVLEvFFKzq5quC9vHhaRpSuaAyYfGhAb vFqoKEajpLsPovypv/DGij6i/TWs/pJzDvxkx/sFGGgMlMTA9xj++eN6J101H/n6Sv7h w8Ni7IcgMA/IIWJNj+dBiUpl6M9WFQTBbuurN5eZob2KKM032MgWjpvNNxJKFAtNrnlt gedQ== X-Gm-Message-State: AN3rC/7pFXsMo/jigUvV8a+gRP1USqDCpCRtIsbcTekupzByA8j/ObKK 3SgUqyKiCT+EhQ== X-Received: by 10.98.91.69 with SMTP id p66mr29094266pfb.2.1493159749332; Tue, 25 Apr 2017 15:35:49 -0700 (PDT) Received: from fainelli-desktop.irv.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id c83sm38182747pfd.113.2017.04.25.15.35.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 15:35:48 -0700 (PDT) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] ARM: Silence non PLT allocation with CONFIG_ARM_MODULE_PLTS=y Date: Tue, 25 Apr 2017 15:33:28 -0700 Message-Id: <20170425223332.6999-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170425223332.6999-1-f.fainelli@gmail.com> References: <20170425223332.6999-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170425_153610_539992_CAA8DA08 X-CRM114-Status: GOOD ( 12.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , open list , Ard Biesheuvel , Catalin Marinas , Will Deacon , Russell King , Chris Wilson , "open list:MEMORY MANAGEMENT" , Michal Hocko , "Kirill A. Shutemov" , angus@angusclark.org, Andrey Ryabinin , Andrew Morton , zijun_hu MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When CONFIG_ARM_MODULE_PLTS is enabled, the first allocation using the module space fails, because the module is too big, and then the module allocation is attempted from vmalloc space. Silence the first allocation failure in that case, since that scares people out. Signed-off-by: Florian Fainelli --- arch/arm/kernel/module.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index 80254b47dc34..503d1a39464a 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c @@ -40,8 +40,15 @@ #ifdef CONFIG_MMU void *module_alloc(unsigned long size) { - void *p = __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, - GFP_KERNEL, PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE, + gfp_t gfp_mask = GFP_KERNEL; + void *p; + +#if IS_ENABLED(CONFIG_ARM_MODULE_PLTS) + /* Silence the initial allocation */ + gfp_mask |= __GFP_NOWARN; +#endif + p = __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, + gfp_mask, PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE, __builtin_return_address(0)); if (!IS_ENABLED(CONFIG_ARM_MODULE_PLTS) || p) return p;