From patchwork Thu Apr 27 18:19:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 9703317 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 A7A566032C for ; Thu, 27 Apr 2017 18:19:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9ED6628652 for ; Thu, 27 Apr 2017 18:19:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 937AE28655; Thu, 27 Apr 2017 18:19:36 +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 74FBF28652 for ; Thu, 27 Apr 2017 18:19:35 +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=FTVWamBtcXKWs6KC/2lPEDxykcWmJCVJb8wBfDMuum4=; b=DOK0yszXXI3YvJfZvX1pB5p5nc 5QWw3I0i4Ab+4rh7e/AOT1dw+0jMP0ShhUbLSC6we3E+FgKTuPAnf/469PepEmd01hfs1Hxud6iDz fRKJX9I0q93BiHqQh2V7kV/X7JZstI9fmjpJVgzl3L9VkH/bH+MioicdnhEoBNYFayR0ZMZZdUk+v 1VuVGgqEWAT/tgI4e6Sq77z8HZO2aDqqTSR/ntTJFVZdwov1P1RiwxzMWscbzsbGQwaTURzXhy8gA fGtDKAu/tPuTNydRPvBVAt447q0+TlopQt2cfDW+d5CpMaF+yGwcB3q2xluPo5nU3WaETBvjQAtRu 0bHsreuQ==; 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 1d3o0s-0003hr-KA; Thu, 27 Apr 2017 18:19:34 +0000 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d3o0p-0003ep-4I for linux-arm-kernel@lists.infradead.org; Thu, 27 Apr 2017 18:19:32 +0000 Received: by mail-qk0-x241.google.com with SMTP id o85so5871528qkh.0 for ; Thu, 27 Apr 2017 11:19:14 -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=PXhFe74FUEkrqGxz5UFSloO0TzWSBmbPQw4uf/40sv8=; b=NMuACHpq6/nWzKRv6n0AuAJIPKzB8R5cq1BDrUIWlhg/ukmgnk6Rl/OsV2Nn7xF41x 2Ec4m7MpYamFtQY083ew5zBSlaFIt1Dq8JQ5pSSgCvrYdO2TnByCP2T1JlQ4IcYJEJbn +JZAyA+unBJksS08l6L+3MeLXJ4vmvHfmF32Ef34HstQA7yXI+5gIg0aJyW4GlJKfHnj fsysQs+qEcg2yXOK4T2VvVWDqTRouCFN/Fic1cYrjPWDQkDnRV5MOKjncfvp5zwox867 j2LyqeQWZDLOdgX3U2a/e8uUYYZ1CFaL6G5n/c7yOAy/qGOS/UAIdMJWA7oeekclWlZQ 5kMg== 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=PXhFe74FUEkrqGxz5UFSloO0TzWSBmbPQw4uf/40sv8=; b=npdSyVgTrtexa+Nerf8HQgSztwdAE5BqY/kO1DNCzEAUoGMtnT5JjelcWMGQjKLMhH HTo2LuEZVUvUcX+vo+Xz8M565vz/dlPqJ/B7PZOX1sHfc643AlvJf4hrZhWmRADfC791 YlTUTWo3oV5ApdFRkOXgh4NkQTg3FSjKHuboKW9hh7X+dqx83FIYaE+Piib0gEOBlBZI 59LwrHutZT3/irn92xGIVqxY/QiLTC9wHcxGMl7XfRy2TXMN05EbAcknc9MeThQ2i5Qv /xxkj+eKIzuQpu3yd5zCUvC3ZQtcC3kCvHILxulCOoR9+gO1CciEY3jpD8NjTUrkbVwj 41sg== X-Gm-Message-State: AN3rC/5GmPLRj47NtCMVs8gXwLBNQOlroyE1IzyFZmM3aODIjpS3Z0QQ 5DEGrivpikcACQ== X-Received: by 10.55.4.71 with SMTP id 68mr6053198qke.90.1493317153606; Thu, 27 Apr 2017 11:19:13 -0700 (PDT) Received: from fainelli-desktop.irv.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id i64sm2119913qkd.5.2017.04.27.11.19.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Apr 2017 11:19:12 -0700 (PDT) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/3] ARM: Silence first allocation with CONFIG_ARM_MODULE_PLTS=y Date: Thu, 27 Apr 2017 11:19:01 -0700 Message-Id: <20170427181902.28829-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170427181902.28829-1-f.fainelli@gmail.com> References: <20170427181902.28829-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170427_111931_276457_B87ECC2D X-CRM114-Status: GOOD ( 12.19 ) 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 by setting __GFP_NOWARN. Signed-off-by: Florian Fainelli Acked-by: Russell King --- 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..3ff571c2c71c 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; + + /* Silence the initial allocation */ + if (IS_ENABLED(CONFIG_ARM_MODULE_PLTS)) + gfp_mask |= __GFP_NOWARN; + + 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;