Re: [PATCH 2/11] hugetlb: add nodemask arg to huge page alloc, free and surplus adjust fcns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2009-10-06 at 20:26 -0700, David Rientjes wrote:
> On Mon, 5 Oct 2009, Lee Schermerhorn wrote:
> 
> > Index: linux-2.6.31-mmotm-090925-1435/mm/hugetlb.c
> > ===================================================================
> > --- linux-2.6.31-mmotm-090925-1435.orig/mm/hugetlb.c	2009-09-28 10:12:20.000000000 -0400
> > +++ linux-2.6.31-mmotm-090925-1435/mm/hugetlb.c	2009-09-30 11:41:36.000000000 -0400

> >  #ifdef CONFIG_HIGHMEM
> > -static void try_to_free_low(struct hstate *h, unsigned long count)
> > +static void try_to_free_low(struct hstate *h, unsigned long count,
> > +						nodemask_t *nodes_allowed)
> >  {
> >  	int i;
> >  
> >  	if (h->order >= MAX_ORDER)
> >  		return;
> >  
> > +	if (!nodes_allowed)
> > +		nodes_allowed = &node_online_map;
> > +
> >  	for (i = 0; i < MAX_NUMNODES; ++i) {
> >  		struct page *page, *next;
> >  		struct list_head *freel = &h->hugepage_freelists[i];
> > +		if (!node_isset(i, *nodes_allowed))
> > +			continue;
> >  		list_for_each_entry_safe(page, next, freel, lru) {
> >  			if (count >= h->nr_huge_pages)
> >  				return;
> 
> Simply converting the iteration to use
> for_each_node_mask(i, *nodes_allowed) would be cleaner.

OK.  That's equivalent.  Anyway, MAX_NUMNODES should probably have been
'numa_node_ids" or such.  And, now, nodes_allowed can't [shouldn't!] be
NULL here, as we default way up in the sysctl/sysfs handlers.  I'll fix
this.

--
To unsubscribe from this list: send the line "unsubscribe linux-numa" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [Devices]

  Powered by Linux