All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Christophe LEROY <christophe.leroy@c-s.fr>
Cc: "linuxppc-dev\@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: Question on hugepages_supported()
Date: Wed, 02 Aug 2017 12:58:38 +0530	[thread overview]
Message-ID: <87a83i1l95.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <bbc6ae12-1705-32e1-109b-baefead9444b@c-s.fr>

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

      reply	other threads:[~2017-08-02  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02  7:03 Question on hugepages_supported() Christophe LEROY
2017-08-02  7:28 ` Aneesh Kumar K.V [this message]

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=87a83i1l95.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.