linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Muchun Song <songmuchun@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Oscar Salvador <osalvador@suse.de>,
	Heiko Carstens <hca@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [External] Re: [PATCH] hugetlb: fix uninitialized subpool pointer
Date: Wed, 24 Feb 2021 12:36:30 +0100	[thread overview]
Message-ID: <YDY6PkTcUOXZE/Xg@dhcp22.suse.cz> (raw)
In-Reply-To: <CAMZfGtXBKvz6wg-N5LpwMcensRiiwnKYa5XDnGi2ueBMa0Q+NA@mail.gmail.com>

On Wed 24-02-21 19:10:42, Muchun Song wrote:
> On Wed, Feb 24, 2021 at 5:43 PM Michal Hocko <mhocko@suse.com> wrote:
> >
> > On Tue 23-02-21 13:55:44, Mike Kravetz wrote:
> > > Gerald Schaefer reported a panic on s390 in hugepage_subpool_put_pages()
> > > with linux-next 5.12.0-20210222.
> > > Call trace:
> > >   hugepage_subpool_put_pages.part.0+0x2c/0x138
> > >   __free_huge_page+0xce/0x310
> > >   alloc_pool_huge_page+0x102/0x120
> > >   set_max_huge_pages+0x13e/0x350
> > >   hugetlb_sysctl_handler_common+0xd8/0x110
> > >   hugetlb_sysctl_handler+0x48/0x58
> > >   proc_sys_call_handler+0x138/0x238
> > >   new_sync_write+0x10e/0x198
> > >   vfs_write.part.0+0x12c/0x238
> > >   ksys_write+0x68/0xf8
> > >   do_syscall+0x82/0xd0
> > >   __do_syscall+0xb4/0xc8
> > >   system_call+0x72/0x98
> > >
> > > This is a result of the change which moved the hugetlb page subpool
> > > pointer from page->private to page[1]->private.  When new pages are
> > > allocated from the buddy allocator, the private field of the head
> > > page will be cleared, but the private field of subpages is not modified.
> > > Therefore, old values may remain.
> >
> > Very interesting. I have expected that the page->private would be in a
> > reasonable state when allocated. On the other hand hugetlb doesn't do
> > __GFP_COMP so tail pages are not initialized by the allocator.
> 
> It seems that the buddy allocator does not initialize the private field
> of the tail page even when we specify __GFP_COMP.

Yes it doesn't. What I meant to say is that even if it did a lack of
__GFP_COMP would result in not doing so. I do not remember why hugetlb
doesn't use __GFP_COMP but I believe this was never the case.
-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2021-02-24 11:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 21:55 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
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 [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=YDY6PkTcUOXZE/Xg@dhcp22.suse.cz \
    --to=mhocko@suse.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=mike.kravetz@oracle.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