public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Mike Travis <travis@sgi•com>
Cc: Rusty Russell <rusty@rustcorp•com.au>,
	Ingo Molnar <mingo@redhat•com>,
	linux-next@vger•kernel.org, LKML <linux-kernel@vger•kernel.org>
Subject: Re: [PATCH 1/1] cpumask: add alloc_cpumask_var_node
Date: Tue, 16 Dec 2008 14:30:45 +1100	[thread overview]
Message-ID: <20081216143045.2afa85a7.sfr@canb.auug.org.au> (raw)
In-Reply-To: <49471353.9070204@sgi.com>

[-- Attachment #1: Type: text/plain, Size: 1752 bytes --]

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/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-12-16  3:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16  2:32 [PATCH 1/1] cpumask: add alloc_cpumask_var_node Mike Travis
2008-12-16  3:30 ` Stephen Rothwell [this message]
2008-12-16  3:47   ` Mike Travis
2008-12-16  4:19     ` [PATCH 1/1] cpumask: add alloc_cpumask_var_node V2 Mike Travis
2008-12-17 11:48       ` Rusty Russell
2008-12-17 18:11         ` Mike Travis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081216143045.2afa85a7.sfr@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=mingo@redhat$(echo .)com \
    --cc=rusty@rustcorp$(echo .)com.au \
    --cc=travis@sgi$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox