From patchwork Thu Apr 27 18:19:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 9703327 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 A70F96032C for ; Thu, 27 Apr 2017 18:20:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E43628652 for ; Thu, 27 Apr 2017 18:20:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92AF528655; Thu, 27 Apr 2017 18:20:28 +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 3473228652 for ; Thu, 27 Apr 2017 18:20:28 +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=G/c0o8aHdWVVrRvv6pKT0mbU5qJDlUmzPsU2XwEC3lA=; b=oHxdyAQxaptbMj6iK0EhnzaYjs gbe1Nvq86kG91W924WxTKVvHUnlEfOSQAkdqsaWYtZbeAjeJxBZqs6jcTqZiI4WFACL5oZZA2amwS cNvsmoJnCQq23pmlyUqowVURm9DrHy29rYk20IBzUiDfCWpgnWtnx2xMAmL1rvlIVLXkKyIcQ5uLs wJJ329CiQBvYga2wfWQ9q2ggOzoSkpF62rCN1HQ0QaNvYTdRwN3W8/3ecF9MpV7hR+ciNqSKI+yPk RKKGA0vuBDis6vrOC6CUqhMO4qdkpChQCqHZZj+E0scwZVelXN7AmXZIQdmafHbC+K9QuK8lynjBi wkb1CStg==; 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 1d3o1j-0005gN-9g; Thu, 27 Apr 2017 18:20:27 +0000 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d3o0v-0003fC-Qe for linux-arm-kernel@lists.infradead.org; Thu, 27 Apr 2017 18:19:40 +0000 Received: by mail-qt0-x242.google.com with SMTP id o36so5496059qtb.2 for ; Thu, 27 Apr 2017 11:19:17 -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=MeEd+IMt67syEEILb5WLRaJVy+RLcGlhbsQvsUWKg9Q=; b=rK4yMz53xcpXLh79gK7z6A3MnRQCDkD4KlJPX2QYkWIMhh6hgE6mtdrfKrOVLfit1v WHk9cxfzF/1ozqM4ABNcXtw8YKGXNuaN7eP32Uj4v/7A7igTPJSd+jJclfyV5v93dcK9 Xu2ZP60ckh3ibnZaxdvinYhWC8eLsHKywnvy/ggY9r2Ir7OYu9In9J4nyrz6Avb1lAQt Jzbzn4KeEddqgPKYBWnJIroaoDgGn3qSHp104boq8oMIemyXooIvmkAhs6L3+Qb+pBGe LH6uGX9J93YnH4Z+Dkos812/fTAjUIvK60lxpCptUZKtSn0HTYP3xuC8UHB/kOG87WM5 nAfg== 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=MeEd+IMt67syEEILb5WLRaJVy+RLcGlhbsQvsUWKg9Q=; b=l7TXifqMWHmj/HHurhh9/qwB8oiwi4m+LxGng9WESzLKQWm47ynrqsZ4qy0RmHD4kQ nwgtQBi4wp8ZK0zjuNRN4Gm1ja03jcCgaDx1uGC7TIvuf9xEHQRMy8vQjuShoIvLvNA5 sBGTscHZcF2mc4XfFTHOcgtur8WmVj0lBsfLelQrZSyBKJBcb5I17k2QI4qTCHCsHcvj YneGa6+ob8dzNxKIdlnqvIF5R+2SFVAe3d0D5Ijb6Ijh7IT6vyaEoCcl2RLJCLigL1AS fP2/MZehHLid3bCDMpIM+/zYYGCtfB6/XFCYG9wJ2OquTGMP8NOsWV/pS6Y/9piQSTNd FzXw== X-Gm-Message-State: AN3rC/4DiJZZ+YinDSjt8uIhw8xVOtT+9CGrh/IOc7c7kAjY9vTKo0Lx DtaZS1SW7mtTfw== X-Received: by 10.200.42.238 with SMTP id c43mr6448278qta.144.1493317155576; Thu, 27 Apr 2017 11:19:15 -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.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Apr 2017 11:19:15 -0700 (PDT) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 3/3] arm64: Silence first allocation with CONFIG_ARM64_MODULE_PLTS=y Date: Thu, 27 Apr 2017 11:19:02 -0700 Message-Id: <20170427181902.28829-4-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_111938_320817_5854F3EE X-CRM114-Status: GOOD ( 11.42 ) 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_ARM64_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. Reviewed-by: Ard Biesheuvel Signed-off-by: Florian Fainelli Acked-by: Will Deacon --- arch/arm64/kernel/module.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c index 7f316982ce00..093c13541efb 100644 --- a/arch/arm64/kernel/module.c +++ b/arch/arm64/kernel/module.c @@ -32,11 +32,16 @@ void *module_alloc(unsigned long size) { + gfp_t gfp_mask = GFP_KERNEL; void *p; + /* Silence the initial allocation */ + if (IS_ENABLED(CONFIG_ARM64_MODULE_PLTS)) + gfp_mask |= __GFP_NOWARN; + p = __vmalloc_node_range(size, MODULE_ALIGN, module_alloc_base, module_alloc_base + MODULES_VSIZE, - GFP_KERNEL, PAGE_KERNEL_EXEC, 0, + gfp_mask, PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE, __builtin_return_address(0)); if (!p && IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) &&