On Tue, Dec 18, 2018 at 8:52 PM Jane Chu <jane.chu(a)oracle.com>
wrote:
> On 12/18/2018 6:57 PM, Dan Williams wrote:
>
> On Tue, Dec 18, 2018 at 6:50 PM Jane Chu <jane.chu(a)oracle.com> wrote:
>
> Hi, Dan,
>
> While looking at a kernel Oops in the PMEM poison handling code path,
> I noticed that memory_failure_dev_pagemap() is missing from the
> System.map file in the 4.19 build.
>
> Are you talking about a generic upstream 4.19 build or some other kernel?
>
> Generic upstream 4.19 build.
>
> Are you aware of this?
>
> I would expect this to be the case in general for functions that are
> inlined. In this case I would expect memory_failure() to show up in
> System.map, but not memory_failure_dev_pagemap() since it's not
> exported and nothing outside mm/memory_failure.c consumes it.
>
> Not appear inlined, it is statically declared, refer to
>
https://elixir.bootlin.com/linux/v4.19.10/ident/memory_failure_dev_pagemap
>
> hwpoison_user_mappings() is also statically declared, and it's in System.map.
Right, but static functions are optionally inlined by the compiler, so
it's hit and miss. If you need memory_failure_dev_pagemap() to show in
System.map the only guaranteed ways are to mark it extern so the
compiler assumes it needs to emit a dedicated symbol for it, or leave
it static and mark it nolinline, i.e. __attribute__((__noinline__))
So that's what was missing in my understanding, thanks a lot for taking
the time explaining it!
-jane