[Cbe-oss-dev] [RFC] spufs: memory-add fix for CONFIG_NUMA

Dave Hansen haveblue at us.ibm.com
Wed Apr 12 04:33:08 EST 2006


On Tue, 2006-04-11 at 18:26 +0200, Arnd Bergmann wrote:
> 
> +static struct mem_section *sparse_index_alloc(int nid, int late)
>  {
>         struct mem_section *section = NULL;
>         unsigned long array_size = SECTIONS_PER_ROOT *
>                                    sizeof(struct mem_section);
>  
> -       section = alloc_bootmem_node(NODE_DATA(nid), array_size);
> +       if (late)
> +               section = kmalloc_node(array_size, GFP_KERNEL, nid);
> +       else
> +               section = alloc_bootmem_node(NODE_DATA(nid), array_size); 

Kill the "late" stuff.  Use "system_state >= SYSTEM_RUNNING" or
something equivalent.

Also, please don't add your own locking around __add_pages().  The
existing locking around the memory kobjects should work, if you use
them.  

> -               if (err)
> +               /* We want to keep adding the rest of the
> +                * sections if the first ones already exist
> +                */
> +               if (err && (err != -EEXIST))
>                         break;
>         }

Why would you be adding pages for an area that already exists?  I'd be
worried that this is papering over real errors.

-- Dave




More information about the cbe-oss-dev mailing list