From: Mel Gorman <mgorman@techsingularity.net>
To: Matteo Croce <mcroce@linux.microsoft.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>,
David Hildenbrand <david@redhat.com>,
Vlastimil Babka <vbabka@suse.cz>,
Dan Streetman <ddstreet@ieee.org>, Yang Shi <shy828301@gmail.com>,
Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 03/14] mm/page_alloc: Make should_fail_alloc_page a static function should_fail_alloc_page static
Date: Fri, 9 Jul 2021 10:30:40 +0100 [thread overview]
Message-ID: <20210709093040.GX3840@techsingularity.net> (raw)
In-Reply-To: <20210708211648.13659bb5@linux.microsoft.com>
On Thu, Jul 08, 2021 at 09:18:44PM +0200, Matteo Croce wrote:
> On Thu, 20 May 2021 09:47:58 +0100
> Mel Gorman <mgorman@techsingularity.net> wrote:
>
> > make W=1 generates the following warning for mm/page_alloc.c
> >
> > mm/page_alloc.c:3651:15: warning: no previous prototype for
> > ???should_fail_alloc_page??? [-Wmissing-prototypes] noinline bool
> > should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
> > ^~~~~~~~~~~~~~~~~~~~~~
> >
> > This function is deliberately split out for BPF to allow errors to be
> > injected. The function is not used anywhere else so it is local to
> > the file. Make it static which should still allow error injection
> > to be used similar to how block/blk-core.c:should_fail_bio() works.
> >
> > Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> > ---
> > mm/page_alloc.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index aaa1655cf682..26cc1a4e639b 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -3648,7 +3648,7 @@ static inline bool
> > __should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
> > #endif /* CONFIG_FAIL_PAGE_ALLOC */
> >
> > -noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int
> > order) +static noinline bool should_fail_alloc_page(gfp_t gfp_mask,
> > unsigned int order) {
> > return __should_fail_alloc_page(gfp_mask, order);
> > }
>
>
> Hi Mel,
>
> It seems that this breaks builds with CONFIG_DEBUG_INFO_BTF=y.
> Maybe that warning was a false positive because
> should_fail_alloc_page() is referenced via a macro?
>
> I proposed to revert it, feel free to propose another fix.
>
The alternative fix of making the symbol global was rejected. eBPF needs
to figure out a way of instrumenting code that is is unused by the kernel
and not globally visible but I don't know how that might be achieved.
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2021-07-09 9:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-20 8:47 [PATCH 00/14] Clean W=1 build warnings for mm/ Mel Gorman
2021-05-20 8:47 ` [PATCH 01/14] mm/vmscan: Remove kerneldoc-like comment from isolate_lru_pages Mel Gorman
2021-05-20 8:47 ` [PATCH 02/14] mm/vmalloc: Include header for prototype of set_iounmap_nonlazy Mel Gorman
2021-05-20 8:47 ` [PATCH 03/14] mm/page_alloc: Make should_fail_alloc_page a static function should_fail_alloc_page static Mel Gorman
2021-07-08 19:18 ` Matteo Croce
2021-07-09 9:30 ` Mel Gorman [this message]
2021-05-20 8:47 ` [PATCH 04/14] mm/mapping_dirty_helpers: Remove double Note in kerneldoc Mel Gorman
2021-05-20 8:48 ` [PATCH 05/14] mm/early_ioremap: Add prototype for early_memremap_pgprot_adjust Mel Gorman
2021-05-20 8:48 ` [PATCH 06/14] mm/memcontrol.c: Fix kerneldoc comment for mem_cgroup_calculate_protection Mel Gorman
2021-05-20 23:24 ` Chris Down
2021-05-20 8:48 ` [PATCH 07/14] mm/memory_hotplug: Fix kerneldoc comment for __try_online_node Mel Gorman
2021-05-20 10:42 ` David Hildenbrand
2021-05-20 8:48 ` [PATCH 08/14] mm/memory_hotplug: Fix kerneldoc comment for __remove_memory Mel Gorman
2021-05-20 10:42 ` David Hildenbrand
2021-05-20 8:48 ` [PATCH 09/14] mm/zbud: Add kerneldoc fields for zbud_pool Mel Gorman
2021-05-20 8:48 ` [PATCH 10/14] mm/z3fold: Add kerneldoc fields for z3fold_pool Mel Gorman
2021-05-20 8:48 ` [PATCH 11/14] mm/swap: Make swap_address_space an inline function Mel Gorman
2021-05-20 8:48 ` [PATCH 12/14] mm/mmap_lock: Remove dead code for !CONFIG_TRACING configurations Mel Gorman
2021-05-20 8:48 ` [PATCH 13/14] mm/page_alloc: Move prototype for find_suitable_fallback Mel Gorman
2021-05-20 8:48 ` [PATCH 14/14] mm/swap: Make NODE_DATA an inline function on CONFIG_FLATMEM Mel Gorman
2021-05-20 22:51 ` [PATCH 00/14] Clean W=1 build warnings for mm/ Yang Shi
2021-05-25 11:48 ` Vlastimil Babka
2021-05-25 14:25 ` Mel Gorman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210709093040.GX3840@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=ddstreet@ieee.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mcroce@linux.microsoft.com \
--cc=mhocko@kernel.org \
--cc=shy828301@gmail.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox