lkml.org 
[lkml]   [2008]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] cpumask: add alloc_cpumask_var_node
Hi Mike,

Just some simple comments.

On Mon, 15 Dec 2008 18:32:51 -0800 Mike Travis <travis@sgi.com> wrote:
>
> +/**
> + * alloc_cpumask_var - return an allocated struct cpumask
> + * @mask: pointer to cpumask_var_t where the cpumask is returned
> + * @cpu: GFP_ flags
^^^
flags

> + * alloc_cpumask_var_node - return an allocated struct cpumask on a
> + * specific node.
> + * @mask: pointer to cpumask_var_t where the cpumask is returned
> + * @cpu: GFP_ flags
^^^
flags

> + * @node: node to allocate memory on
> + *
> + * Only defined when CONFIG_CPUMASK_OFFSTACK=y, otherwise is
> + * a nop returning a constant 1 (in <linux/cpumask.h>)
> + * Returns TRUE if memory allocation succeeded, FALSE otherwise.
> + */
> +bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node)
> +{
> + if (likely(slab_is_available()))
> + *mask = kmalloc_node(cpumask_size(), flags, node);
> + else {
> +#ifdef CONFIG_DEBUG_PER_CPU_MAPS
> + printk(KERN_ERR
> + "=> alloc_cpumask_var_node: kmalloc not available!\n");
> + dump_stack();
> +#endif
> + *mask = NULL;
> + }
> +#ifdef CONFIG_DEBUG_PER_CPU_MAPS
> + if (!*mask) {
> + printk(KERN_ERR "=> alloc_cpumask_var_node: failed!\n");
> + dump_stack();
> + }
> +#endif

So if !slab_is_available() and CONFIG_DEBUG_PER_CPU_MAPS is set, we get
two stack dumps?

> + * free_cpumask_var - frees memory allocated for a struct cpumask.
> + * mask: cpumask to free
^
missing '@'

> + * free_bootmem_cpumask_var - frees bootmem memory allocated for a struct cpumask.
> + * mask: cpumask to free
^
here as well.

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2008-12-16 04:33    [W:0.558 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site