From: Mike Kravetz <mike.kravetz@oracle.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
Jing Xiangfeng <jingxiangfeng@huawei.com>,
"mhocko@kernel.org" <mhocko@kernel.org>,
"hughd@google.com" <hughd@google.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrea Arcangeli <aarcange@redhat.com>,
"kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>,
linux-kernel@vger.kernel.org, Alexandre Ghiti <alex@ghiti.fr>
Subject: Re: [PATCH v4] mm/hugetlb: Fix unsigned overflow in __nr_hugepages_store_common()
Date: Wed, 6 Mar 2019 16:17:35 -0800 [thread overview]
Message-ID: <acfbbd1d-2889-1737-d84c-03bbf0f03657@oracle.com> (raw)
In-Reply-To: <20190306094130.q5v7qfgbekatnmyk@d104.suse.de>
On 3/6/19 1:41 AM, Oscar Salvador wrote:
> On Mon, Mar 04, 2019 at 08:15:40PM -0800, Mike Kravetz wrote:
>> In addition, the code in __nr_hugepages_store_common() which tries to
>> handle the case of not being able to allocate a node mask would likely
>> result in incorrect behavior. Luckily, it is very unlikely we will
>> ever take this path. If we do, simply return ENOMEM.
>
> Hi Mike,
>
> I still thnk that we could just get rid of the NODEMASK_ALLOC machinery
> here, it adds a needlessly complexity IMHO.
> Note that before "(5df66d306ec9: mm: fix comment for NODEMASK_ALLOC)",
> the comment about the size was wrong, showing a much bigger size that it
> actually was, and I would not be surprised if people started to add
> NODEMASK_ALLOC here and there because of that.
>
> Actually, there was a little talk about removing NODEMASK_ALLOC altogether,
> but some further checks must be done before.
Thanks for the information. I too saw or remembered a large byte value. :(
A quick grep doesn't reveal any configurable way to get NODE_SHIFT larger
than 10. Of course, that could change. So, it does seem a bit funny that
NODEMASK_ALLOC() kicks into dynamic allocation mode with NODE_SHIFT > 8.
Although, my desktop distro has NODE_SHIFT set to 10.
>> Reported-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
>> Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
>
> But the overall change looks good to me:
>
> Reviewed-by: Oscar Salvador <osalvador@suse.de>
Thanks.
I'm going to leave as is for now and put off removal of the dynamic allocation
for a later time. Unless, you get around to removing NODEMASK_ALLOC
altogether. :)
--
Mike Kravetz
next prev parent reply other threads:[~2019-03-07 0:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-23 1:32 Jing Xiangfeng
2019-02-25 0:45 ` Mike Kravetz
2019-02-25 3:17 ` David Rientjes
2019-02-25 16:49 ` Mike Kravetz
2019-02-25 18:19 ` Mike Kravetz
2019-02-25 19:17 ` David Rientjes
2019-02-26 2:22 ` Jing Xiangfeng
2019-02-26 6:21 ` David Rientjes
2019-02-26 19:32 ` Mike Kravetz
2019-02-26 22:36 ` Andrew Morton
2019-02-27 0:03 ` Mike Kravetz
2019-03-04 13:48 ` Oscar Salvador
2019-03-05 0:03 ` Naoya Horiguchi
2019-03-05 4:15 ` Mike Kravetz
2019-03-05 21:16 ` Andrew Morton
2019-03-05 21:35 ` Mike Kravetz
2019-03-05 21:41 ` Alex Ghiti
2019-03-06 9:41 ` Oscar Salvador
2019-03-07 0:17 ` Mike Kravetz [this message]
2019-03-04 6:00 ` Naoya Horiguchi
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=acfbbd1d-2889-1737-d84c-03bbf0f03657@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=hughd@google.com \
--cc=jingxiangfeng@huawei.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=osalvador@suse.de \
--cc=rientjes@google.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