[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1236362436.3882.80.camel@pc1117.cambridge.arm.com>
Date: Fri, 06 Mar 2009 18:00:36 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Dave Hansen <dave@...ux.vnet.ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
jan sonnek <ha2nny@...il.com>, linux-kernel@...r.kernel.org,
viro@...iv.linux.org.uk, Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Andy Whitcroft <apw@...dowen.org>
Subject: Re: Regression - locking (all from 2.6.28)
On Fri, 2009-03-06 at 09:26 -0800, Dave Hansen wrote:
> On Fri, 2009-03-06 at 17:18 +0000, Catalin Marinas wrote:
> > > > Are the pgdat->node_start_pfn and pgdat->node_spanned_pages always
> > > > valid? Thanks.
> > >
> > > The variables themselves? I'm sure there's a window in early boot where
> > > they aren't valid, but other than that they should be OK unless you're
> > > int the middle of a hotplug operation.
> > >
> > > See pgdat_resize_(un)lock() in include/linux/memory_hotplug.h.
> >
> > I wouldn't hold a lock for that long. It's not really critical to scan
> > all the page structures at a time as there are subsequent scans as well,
> > so some can be missed.
>
> I think you should be more worried about consistency rather than missing
> entries. Take these two lines of code:
>
> start_pfn = node->node_start_pfn;
> /* hotplug occurs here */
> end_pfn = start_pfn + node->node_spanned_pages;
>
> What if someone comes in and adds memory to the node, at the beginning
> of the node, after you have calculated start_pfn? Try to think of what
> value you'll get for end_pfn and whether it is consistent and was *ever*
> valid at all. Would that oops the kernel?
I assume pfn_valid() should handle this and kmemleak wouldn't scan the
page, unless we need locks around pfn_valid as well but I haven't seen
any used in the kernel.
--
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists