Re: [PATCH v2] mm/page_owner: ignore everything below the IRQ entry point

From: Andrew Morton
Date: Mon Mar 26 2018 - 15:52:36 EST


On Mon, 26 Mar 2018 19:47:17 +0530 Vaneet Narang <v.narang@xxxxxxxxxxx> wrote:

> Hi Dmitry,
>
> >Every user of stack_depot should filter out irq frames, without that
> >stack_depot will run out of memory sooner or later. so this is a
> >change in the right direction.
> >
> >Do we need to define empty version of in_irqentry_text? Shouldn't only
> >filter_irq_stacks be used by kernel code?
>
> We thought about this but since we were adding both the APIs filter_irq_stacks & in_irqentry_text
> in header file so we thought of defining empty definition for both as both the APIs are accessible
> to the module who is going to include header file.
>
> If you think empty definition of in_irqentry_text() is not requited then we will modify & resend the
> patch.
>

filter_irq_stacks() is too large to be inlined.

The CONFIG_STACKTRACE=n versions should be regular C functions, not
macros. But stacktrace.c decided to do them all as macros,
unfortunately.

in_irqentry_text() is probably too large to be inlined as well, and
should return bool.

Declarations for __irqentry_text_start and friends already exist in
include/asm-generic/sections.h (and, for some reason, also in
arch/arm/include/asm/traps.h) and should not be duplicated in
include/linux/stacktrace.h.