Where is PageHead defined in v5.0?

Igor Pylypiv igor.pylypiv at gmail.com
Wed Mar 27 20:23:05 EDT 2019


On Wed, Mar 27, 2019 at 4:51 PM Tobin C. Harding <me at tobin.cc> wrote:
>
> On Wed, Mar 27, 2019 at 07:34:58PM -0500, Jesse Simpson wrote:
> > Hi Tobin,
> >
> > I took a look on my system, and I wasn't able to find where PageHead is
> > defined either. I used grep to search for it as well as vim with ctags.
> > Maybe it's hidden away in some built-in.a or binary file.
>
> Cheers Jesse, confirmation that I've not gone mad - that's a win.
>
> I'll repost this to mm-linux tomorrow if no one on here knows.
>
> thanks,
> Tobin.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Hi Tobin and Jesse,

Neither grep nor ctags are going to help you here :)

PageHead is implicitly defined using macros __PAGEFLAG:
        __PAGEFLAG(Head, head, PF_ANY) CLEARPAGEFLAG(Head, head, PF_ANY)
        (https://elixir.bootlin.com/linux/v5.0.5/source/include/linux/page-flags.h#L517)

__PAGEFLAG defines TESTPAGEFLAG:
        (https://elixir.bootlin.com/linux/v5.0.5/source/include/linux/page-flags.h#L248)

and TESTPAGEFLAG defines PageHead:
        #define TESTPAGEFLAG(uname, lname, policy) \
        static __always_inline int Page##uname(struct page *page)
        (https://elixir.bootlin.com/linux/v5.0.5/source/include/linux/page-flags.h#L215)

See, it is simple :)

Thanks,
Igor



More information about the Kernelnewbies mailing list