Re: [PATCH] mm: make reserve_bootmem can crossed the nodes

From: Yinghai Lu
Date: Thu Mar 13 2008 - 21:36:12 EST


On Thu, Mar 13, 2008 at 6:34 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> On Thu, 13 Mar 2008 16:45:42 -0700
> "Yinghai Lu" <yhlu.kernel@xxxxxxxxx> wrote:
> > int __init reserve_bootmem(unsigned long addr, unsigned long size,
> > int flags)
> > {
> > - return reserve_bootmem_core(NODE_DATA(0)->bdata, addr, size, flags);
> > + int ret;
> > + bootmem_data_t *bdata;
> > + list_for_each_entry(bdata, &bdata_list, list) {
> > + ret = can_reserve_bootmem_core(bdata, addr, size, flags);
> > + if (ret < 0)
> > + return ret;
> > + }
> > + list_for_each_entry(bdata, &bdata_list, list)
> > + reserve_bootmem_core(bdata, addr, size, flags);
> > + return 0;
> > }
>
> why list_for_each twice ?

first_for_each only check if we can reserve that.
second will do the reserve job.

Thanks

Yinghai Lu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/