From: Mike Kravetz <mike.kravetz@oracle.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
Michal Hocko <mhocko@suse.com>,
Muchun Song <songmuchun@bytedance.com>,
Heiko Carstens <hca@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] hugetlb: fix uninitialized subpool pointer
Date: Tue, 23 Feb 2021 16:27:27 -0800 [thread overview]
Message-ID: <3590f7a0-854d-04eb-6d73-7b3ef2ac49b5@oracle.com> (raw)
In-Reply-To: <ef62ac45-9ec9-2582-3e58-7efc0609221f@oracle.com>
On 2/23/21 3:21 PM, Mike Kravetz wrote:
> On 2/23/21 2:58 PM, Oscar Salvador wrote:
>> On 2021-02-23 23:55, Mike Kravetz wrote:
>>> Yes, that is the more common case where the once active hugetlb page
>>> will be simply added to the free list via enqueue_huge_page(). This
>>> path does not go through prep_new_huge_page.
>>
>> Right, I see.
>>
>> Thanks
>
> You got me thinking ...
> When we dynamically allocate gigantic pages via alloc_contig_pages, we
> will not use the buddy allocator. Therefore, the usual 'page prepping'
> will not take place. Specifically, I could not find anything in that
> path which clears page->private of the head page.
> Am I missing that somewhere? If not, then we need to clear that as well
> in prep_compound_gigantic_page. Or, just clear it in prep_new_huge_page
> to handle any change in assumptions about the buddy allocator.
>
> This is not something introduced with the recent field shuffling, it
> looks like something that existed for some time.
nm, we do end up calling the same page prepping code (post_alloc_hook)
from alloc_contig_range->isolate_freepages_range.
Just to make sure, I purpously dirtied page->private of every page as it
was being freed. Gigantic page allocation was just fine, and I even ran
ltp mm tests with this dirtying in place.
--
Mike Kravetz
next prev parent reply other threads:[~2021-02-24 0:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 21:55 [PATCH] hugetlb: fix uninitialized subpool pointer Mike Kravetz
2021-02-23 22:45 ` Oscar Salvador
2021-02-23 22:55 ` Mike Kravetz
2021-02-23 22:58 ` Oscar Salvador
2021-02-23 23:21 ` Mike Kravetz
2021-02-24 0:27 ` Mike Kravetz [this message]
2021-02-24 3:12 ` [External] " Muchun Song
2021-02-24 9:43 ` Michal Hocko
2021-02-24 11:10 ` [External] " Muchun Song
2021-02-24 11:36 ` Michal Hocko
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=3590f7a0-854d-04eb-6d73-7b3ef2ac49b5@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=gerald.schaefer@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=songmuchun@bytedance.com \
--cc=svens@linux.ibm.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).