linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Guilherme G. Piccoli" <gpiccoli@canonical.com>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	jay.vosburgh@canonical.com, kernel@gpiccoli.net
Subject: Re: [PATCH] hugetlb: Add nohugepages parameter to prevent hugepages creation
Date: Tue, 15 Oct 2019 01:50:07 -0300	[thread overview]
Message-ID: <92e8451a-3a64-cde9-a879-10c0c9e857aa@canonical.com> (raw)
In-Reply-To: <c145a020-5ae0-e3a5-0251-199618cfaa9e@oracle.com>

On 14/10/2019 15:25, Mike Kravetz wrote:
>  [...]
> I don't know much about early_param(), so I will assume this works as you
> describe.  However, a quick grep shows hugepage options for ia64 also with
> early_param.
> 

Thanks a lot for the prompt and quite informative reply Mike.
I've checked this IA64 parameter after your mention, and it just sets
the hugepages size, I don't think it'll affect the purpose of this patch.


>> * The return when sysctl handler is prevented to progress due to
>> nohugepages is -EINVAL, but could be changed; I've just followed
>> present code there, but I'm OK changing that if we have suggestions.
> 
> It looks like you only have short circuited/prevented nr_hugepages via
> sysfs/sysctl.  Theoretically, one could set nr_overcommit_hugepages and
> still allocate hugetlb pages.  So, if you REALLY want to shut things down
> you need to stop this as well.
> 
> There is already a macro hugepages_supported() that can be set by arch
> specific code.  I wonder how difficult it would be to 'overwrite' the
> macro if nohugepages is specified.  Perhaps just a level of naming
> indirection.  This would use the existing code to prevent all hugetlb usage.
>

Outstanding! It's a much better idea to use hugepages_supported()
infrastructure, it prevents even the creation of hugepages-related sysfs
entries; I've worked a V2 with this modification, and it worked fine,
thanks for the suggestion.


> It seems like there may be some discussion about 'the right' way to
> do kdump.  I can't add to that discussion, but if such an option as
> nohugepages is needed, I can help.
> 

I think this parameter may be important/useful not only for kdump - it
is a legitimate way of disabling hugepages, something we don't currently
have on kernel. I'll submit a V2, for Ubuntu kdump specially this is
quite helpful!

Cheers,


Guilherme


      reply	other threads:[~2019-10-15  4:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 22:39 [PATCH] hugetlb: Add nohugepages parameter to prevent hugepages creation Guilherme G. Piccoli
2019-10-11 23:35 ` Qian Cai
2019-10-11 23:41   ` Guilherme Piccoli
2019-10-11 23:52     ` Qian Cai
2019-10-12  0:41       ` Guilherme Piccoli
2019-10-15 12:18         ` Michal Hocko
2019-10-15 13:58           ` Guilherme G. Piccoli
2019-10-15 14:05             ` Michal Hocko
2019-10-15 14:09               ` Guilherme G. Piccoli
2019-10-18 18:29                 ` Mike Kravetz
2019-10-24 16:21                   ` Guilherme G. Piccoli
2019-10-14 18:25 ` Mike Kravetz
2019-10-15  4:50   ` Guilherme G. Piccoli [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=92e8451a-3a64-cde9-a879-10c0c9e857aa@canonical.com \
    --to=gpiccoli@canonical.com \
    --cc=jay.vosburgh@canonical.com \
    --cc=kernel@gpiccoli.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    /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 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).