linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Question on hugepages_supported()
@ 2017-08-02  7:03 Christophe LEROY
  2017-08-02  7:28 ` Aneesh Kumar K.V
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe LEROY @ 2017-08-02  7:03 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev@lists.ozlabs.org

In include/linux/hugetlb.h, we find the following statement

#ifndef hugepages_supported
/*
  * Some platform decide whether they support huge pages at boot
  * time. Some of them, such as powerpc, set HPAGE_SHIFT to 0
  * when there is no such support
  */
#define hugepages_supported() (HPAGE_SHIFT != 0)
#endif

But in arch/powerpc/include/asm/page.h we find:

#ifdef CONFIG_HUGETLB_PAGE
extern unsigned int HPAGE_SHIFT;
#else
#define HPAGE_SHIFT PAGE_SHIFT
#endif


Is that correct ? SHouldn't HPAGE_SHIFT be defined to 0 when 
CONFIG_HUGETLB_PAGE is not defined ?

Christophe

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question on hugepages_supported()
  2017-08-02  7:03 Question on hugepages_supported() Christophe LEROY
@ 2017-08-02  7:28 ` Aneesh Kumar K.V
  0 siblings, 0 replies; 2+ messages in thread
From: Aneesh Kumar K.V @ 2017-08-02  7:28 UTC (permalink / raw)
  To: Christophe LEROY; +Cc: linuxppc-dev@lists.ozlabs.org

Christophe LEROY <christophe.leroy@c-s.fr> writes:

> In include/linux/hugetlb.h, we find the following statement
>
> #ifndef hugepages_supported
> /*
>   * Some platform decide whether they support huge pages at boot
>   * time. Some of them, such as powerpc, set HPAGE_SHIFT to 0
>   * when there is no such support
>   */
> #define hugepages_supported() (HPAGE_SHIFT != 0)
> #endif
>
> But in arch/powerpc/include/asm/page.h we find:
>
> #ifdef CONFIG_HUGETLB_PAGE
> extern unsigned int HPAGE_SHIFT;
> #else
> #define HPAGE_SHIFT PAGE_SHIFT
> #endif
>
>
> Is that correct ? SHouldn't HPAGE_SHIFT be defined to 0 when 
> CONFIG_HUGETLB_PAGE is not defined ?
>

But then hugepages_supported() is only defined if HUGETLB_PAGE is
enabled. So yes we can possibly say HPAGE_SHIFT = 0 if HUGETLB is
disabled, I am not sure it has any impact with the current code ?


-aneesh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-02  7:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-02  7:03 Question on hugepages_supported() Christophe LEROY
2017-08-02  7:28 ` Aneesh Kumar K.V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).