From: Michal Hocko <mhocko@suse.cz>
To: Cliff Wickman <cpw@sgi.com>
Cc: cmetcalf@tilera.com, dave@linux.vnet.ibm.com, dhillf@gmail.com,
dwg@au1.ibm.com, kamezawa.hiroyuki@gmail.com,
khlebnikov@openvz.org, lee.schermerhorn@hp.com, mgorman@suse.de,
shhuiw@gmail.com, viro@zeniv.linux.org.uk, linux-mm@kvack.org
Subject: Re: [PATCH v2] list corruption by gather_surp
Date: Wed, 1 Aug 2012 08:51:10 +0200 [thread overview]
Message-ID: <20120801065110.GA4436@tiehlicka.suse.cz> (raw)
In-Reply-To: <20120731231306.GA25248@sgi.com>
On Tue 31-07-12 18:13:06, Cliff Wickman wrote:
>
> On Mon, Jul 30, 2012 at 02:22:24PM +0200, Michal Hocko wrote:
> > On Fri 27-07-12 17:32:15, Cliff Wickman wrote:
> > > From: Cliff Wickman <cpw@sgi.com>
> > >
> > > v2: diff'd against linux-next
> > >
> > > I am seeing list corruption occurring from within gather_surplus_pages()
> > > (mm/hugetlb.c). The problem occurs in a RHEL6 kernel under a heavy load,
> > > and seems to be because this function drops the hugetlb_lock.
> > > The list_add() in gather_surplus_pages() seems to need to be protected by
> > > the lock.
> > > (I don't have a similar test for a linux-next kernel)
> >
> > Because you cannot reproduce or you just didn't test it with linux-next?
> >
> > > I have CONFIG_DEBUG_LIST=y, and am running an MPI application with 64 threads
> > > and a library that creates a large heap of hugetlbfs pages for it.
> > >
> > > The below patch fixes the problem.
> > > The gist of this patch is that gather_surplus_pages() does not have to drop
> >
> > But you cannot hold spinlock while allocating memory because the
> > allocation is not atomic and you could deadlock easily.
> >
> > > the lock if alloc_buddy_huge_page() is told whether the lock is already held.
> >
> > The changelog doesn't actually explain how does the list gets corrupted.
> > alloc_buddy_huge_page doesn't provide the freshly allocated page to use
> > so nobody could get and free it. enqueue_huge_page happens under hugetlb_lock.
> > I am sorry but I do not see how we could race here.
>
> I finally got my test running on a linux-next kernel and could not
> reproduce the problem.
> So I agree that no race seems possible now. Disregard this patch.
>
> I'll offer the fix to the distro of the old kernel on which I saw the
> problem.
But please note that the patch is not correct as mentioned above.
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2012-08-01 6:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 22:32 [PATCH v2] list corruption by gather_surp Cliff Wickman
2012-07-28 13:14 ` Hillf Danton
2012-07-30 12:22 ` Michal Hocko
2012-07-31 23:13 ` Cliff Wickman
2012-08-01 6:51 ` 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=20120801065110.GA4436@tiehlicka.suse.cz \
--to=mhocko@suse.cz \
--cc=cmetcalf@tilera.com \
--cc=cpw@sgi.com \
--cc=dave@linux.vnet.ibm.com \
--cc=dhillf@gmail.com \
--cc=dwg@au1.ibm.com \
--cc=kamezawa.hiroyuki@gmail.com \
--cc=khlebnikov@openvz.org \
--cc=lee.schermerhorn@hp.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=shhuiw@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/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).