Re: [PATCH: 001/012] Memory hotplug for new nodes v.2. (pgdat allocation)

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

 



On Fri, 2006-02-17 at 22:28 +0900, Yasunori Goto wrote:
> 
> +extern int kswapd(void *);

In a header, please.  

> +int new_pgdat_init(int nid, unsigned long start_pfn, unsigned long
> nr_pages)
> +{
> +       unsigned long zones_size[MAX_NR_ZONES] = {0};
> +       unsigned long zholes_size[MAX_NR_ZONES] = {0};
> +       unsigned long pernode_size = arch_pernode_size(nid);
> +       pg_data_t *pgdat;
> +       struct task_struct *p;
> +
> +       pgdat = kmalloc(pernode_size, GFP_KERNEL);
> +       if (!pgdat){
> +               printk(KERN_ERR "%s node_data allocation failed\n",
> +                       __FUNCTION__);
> +               return -ENODEV;
> +       }
> +
> +       memset(pgdat, 0, pernode_size);

kzalloc() instead of explicit kmalloc/memset, please.

I'm a teensy bit concerned that this doesn't share enough code with the
boot-time initialization.  For instance, the kthread_create() seems to
be a pretty darn generic piece.  I'd feel a lot more at ease if this
patch did something with _existing_ code instead of just adding.

Also, can the regular boot code use your set_node_data_array() function?
Can you take out the "_array" part of the name? 

-- Dave

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux