From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [PATCH 3/4] hugetlb: interleave dequeueing of huge pages From: Lee Schermerhorn In-Reply-To: References: <20070906182134.GA7779@us.ibm.com> <20070906182430.GB7779@us.ibm.com> <20070906182704.GC7779@us.ibm.com> <1189796638.5315.50.camel@localhost> Content-Type: text/plain Date: Fri, 14 Sep 2007 16:09:51 -0400 Message-Id: <1189800591.5315.69.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Christoph Lameter Cc: Nishanth Aravamudan , wli@holomorphy.com, agl@us.ibm.com, linux-mm@kvack.org List-ID: On Fri, 2007-09-14 at 12:42 -0700, Christoph Lameter wrote: > On Fri, 14 Sep 2007, Lee Schermerhorn wrote: > > > On Fri, 2007-09-14 at 11:54 -0700, Christoph Lameter wrote: > > > On Thu, 6 Sep 2007, Nishanth Aravamudan wrote: > > > > > > > +static struct page *dequeue_huge_page(void) > > > > +{ > > > > + static int nid = -1; > > > > + struct page *page = NULL; > > > > + int start_nid; > > > > + int next_nid; > > > > + > > > > + if (nid < 0) > > > > + nid = first_node(node_states[N_HIGH_MEMORY]); > > > > + start_nid = nid; > > > > > > nid is -1 so the tests are useless. > > > > > start_nid is a [private] static variable. It is initialized to -1 at > > boot, and thereafter loops around nodes on each call, as huge pages are > > allocated. It is only == -1 on the very first call to this function. I > > think it has worked like this since hugetlbfs was added. > > Ahh not start_nid but nid is a static variable that is initialized to -1. > Could we move that out of dequeue_huge_page? Its confusing. Yeah, I mistyped... But, nid IS private to that function. This is a valid use of static. But, perhaps it could use a comment to call attention to it. Lee -- 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: email@kvack.org