From patchwork Mon Jul 5 10:38:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Elver X-Patchwork-Id: 12358787 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.7 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F02DC07E9C for ; Mon, 5 Jul 2021 10:38:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2E81261416 for ; Mon, 5 Jul 2021 10:38:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E81261416 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E2BF06B0011; Mon, 5 Jul 2021 06:38:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E03636B0036; Mon, 5 Jul 2021 06:38:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA5326B005D; Mon, 5 Jul 2021 06:38:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id A7A376B0011 for ; Mon, 5 Jul 2021 06:38:32 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 22B3E824999B for ; Mon, 5 Jul 2021 10:38:32 +0000 (UTC) X-FDA: 78328185264.07.C02F90C Received: from mail-qv1-f73.google.com (mail-qv1-f73.google.com [209.85.219.73]) by imf20.hostedemail.com (Postfix) with ESMTP id D9610D0000A6 for ; Mon, 5 Jul 2021 10:38:31 +0000 (UTC) Received: by mail-qv1-f73.google.com with SMTP id h7-20020a0ceda70000b02902af042354f1so4928431qvr.9 for ; Mon, 05 Jul 2021 03:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=IGdOeKuUWgjZXs+/OzVZm4qLwJ1bVY9XzV5XRDS7Slk=; b=uWq6a/+AsN9sKSHYaIC/2GMkF/WGw5iy00TuGCWqSnzI0RnCljlhywUszemp4nPEuI kpq83xEOpdLCr+R5pIwOH8SxSwqLtFnTe+IfQNz7fLK46A2rkwFbDQT39Req7Mfux3B7 k7upz2s+FS25zdvlPLTkc48YDU2s76Rh9iHWScSakdenoBtGQbgyMsG65Nu7UNuDhkfd GNQqm1y2wR0A0EN6AHInn/+wsZVZM9ieJPZRflm0xAIxuq9M6sV0hF3+lufpnQBFJnv7 mnLChNgIqFGqEKKjh5iwjCdToYBFaFCSExbtxJAe7bO8SuzmTw5VVdXnVWcRQRwnNX3l 2vZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=IGdOeKuUWgjZXs+/OzVZm4qLwJ1bVY9XzV5XRDS7Slk=; b=VLowtt7tFaHu5yKyiLTwl8A+XdBLUzDkNNmwsgzMeOcXfzm5UxwVb5cgv4oRwZV0ur 18YA6f8dNzETxB7SObIAD2H/eOsQekymazIDJqi+ihtvCbWCwjIIWbcmBhVtKWrAgXF/ p1b2eSfRsqxndxOEr3RQoUXbGWpheQhKzH9bdXVfcqbAEUqKrR4ICDkdfgKn2dZj5yD5 r9zDrwCkxols81T/7F9u80CkiLt9f12j7eCma2OR1NL67e6jAV4rBVL6oBrAlpxrKSrB OUAWGPqIeWuuBKiJ/Cm7gbIfL+qKZL6jpx/37Nt8BqZChJnP6fMaZ4lbJARuaX/At/C/ GTTA== X-Gm-Message-State: AOAM532CkxTQu162UzCXtwvvS6piS1lDKfXYbyYmsKvXelmCTTF++jpg veQhzN+K5ewRSku/h0DEfyEj/cvRPw== X-Google-Smtp-Source: ABdhPJzXkKdnm3ZihoHytmojHy2P+zdHbx66PXDMYmG5rBgkY+gGzlJ3/h9ZhbCNcILjCwjA5kIhfGt8bg== X-Received: from elver.muc.corp.google.com ([2a00:79e0:15:13:dddd:647c:7745:e5f7]) (user=elver job=sendgmr) by 2002:a05:6214:1244:: with SMTP id q4mr12258497qvv.50.1625481511074; Mon, 05 Jul 2021 03:38:31 -0700 (PDT) Date: Mon, 5 Jul 2021 12:38:06 +0200 Message-Id: <20210705103806.2339467-1-elver@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog Subject: [PATCH] Revert "mm/page_alloc: make should_fail_alloc_page() static" From: Marco Elver To: elver@google.com, akpm@linux-foundation.org Cc: glider@google.com, dvyukov@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com, Andrii Nakryiko , Daniel Borkmann , Vlastimil Babka , Yang Shi , bpf@vger.kernel.org, Mel Gorman , Alexei Starovoitov Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b="uWq6a/+A"; spf=pass (imf20.hostedemail.com: domain of 3J-HiYAUKCIIkr1kxmuumrk.iusrot03-ssq1giq.uxm@flex--elver.bounces.google.com designates 209.85.219.73 as permitted sender) smtp.mailfrom=3J-HiYAUKCIIkr1kxmuumrk.iusrot03-ssq1giq.uxm@flex--elver.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: yez3zyf6uga94xs57f9z611dmzhu558n X-Rspamd-Queue-Id: D9610D0000A6 X-Rspamd-Server: rspam06 X-HE-Tag: 1625481511-616062 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: This reverts commit f7173090033c70886d925995e9dfdfb76dbb2441. Commit 76cd61739fd1 ("mm/error_inject: Fix allow_error_inject function signatures") explicitly made should_fail_alloc_page() non-static, due to worries of remaining compiler optimizations in the absence of function side-effects while being noinline. Furthermore, kernel/bpf/verifier.c pushes should_fail_alloc_page onto the btf_non_sleepable_error_inject BTF IDs set, which when enabling CONFIG_DEBUG_INFO_BTF results in an error at the BTFIDS stage: FAILED unresolved symbol should_fail_alloc_page To avoid the W=1 warning, add a function declaration right above the function itself, with a comment it is required in a BTF IDs set. Fixes: f7173090033c ("mm/page_alloc: make should_fail_alloc_page() static") Cc: Mel Gorman Cc: Alexei Starovoitov Signed-off-by: Marco Elver Acked-by: Mel Gorman --- mm/page_alloc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d6e94cc8066c..16e71d48d84e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3831,7 +3831,13 @@ static inline bool __should_fail_alloc_page(gfp_t gfp_mask, unsigned int order) #endif /* CONFIG_FAIL_PAGE_ALLOC */ -static noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order) +/* + * should_fail_alloc_page() is only called by page_alloc.c, however, is also + * included in a BTF IDs set and must remain non-static. Declare it to avoid a + * "missing prototypes" warning, and make it clear this is intentional. + */ +bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order); +noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order) { return __should_fail_alloc_page(gfp_mask, order); }