Re: [RFC] [PATCH] Power Managed memory base enabling

Mark Gross
2007-03-09T21:26:28Z

On Fri, Mar 09, 2007 at 01:27:36PM -0800, David Rientjes wrote:
> On Fri, 9 Mar 2007, Mark Gross wrote:
>
> > +int __nearest_non_pm_node(int nid)
> > +{
> > + int i, dist, closest, temp;
> > +
> > + if (!__power_managed_node(nid))
> > + return nid;
> > + dist = closest= 255;
> > + for_each_node(i) {
>
> Shouldn't this be for_each_online_node(i) ?

yes.

thanks,

--mgross

>
> > + if (__power_managed_node(i))
> > + continue;
> > +
> > + if (i != nid) {
> > + temp = __node_distance(nid, i );
> > + if (temp < dist) {
> > + closest = i;
> > + dist = temp;
> > + }
> > + }
> > + }
> > + BUG_ON(closest == 255);
> > + return closest;
> > +}