mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thiago Farina <tfransosi@gmail.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2] cpumask: add cpumask_var_t documentation
Date: Thu, 28 Apr 2011 12:33:50 -0300	[thread overview]
Message-ID: <BANLkTim4RWbkEMuUDcGG5y-ApznqX+31uw@mail.gmail.com> (raw)
In-Reply-To: <20110429002847.3D77.A69D9226@jp.fujitsu.com>

On Thu, Apr 28, 2011 at 12:27 PM, KOSAKI Motohiro
<kosaki.motohiro@jp.fujitsu.com> wrote:
> cpumask_var_t has one nortable difference against cpumask_t.
> This patch adds the explanation.
>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
>  include/linux/cpumask.h |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> index 1e40dd0..471c98a 100644
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -617,6 +617,20 @@ static inline size_t cpumask_size(void)
>  *       ... use 'tmpmask' like a normal struct cpumask * ...
>  *
>  *     free_cpumask_var(tmpmask);
> + *
> + *
> + * However, one notable exception is there. cpumask_var_t is allocated
> + * only nr_cpu_ids bits

Maybe, instead of "is allocated only", "allocates only" ?


> (in the other hand, real cpumask_t always has
> + * NR_CPUS bits). therefore You don't have to dereference cpumask_var_t.

s/therefore You/Therefore you/ ?

> + *
> + *     cpumask_var_t tmpmask;
> + *     if (!alloc_cpumask_var(&tmpmask, GFP_KERNEL))
> + *             return -ENOMEM;
> + *
> + *     var = *tmpmask;
> + *
> + * This code makes NR_CPUS length memcopy and bring memroy corruption.

/s/memroy/memory

You are saying that I should not use this code? I'm confused, could
you explain a little bit?

> + * You have to use cpumask_copy() instead.
>  */

I don't get this. :(


>  #ifdef CONFIG_CPUMASK_OFFSTACK
>  typedef struct cpumask *cpumask_var_t;
> --
> 1.7.3.1
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

  reply	other threads:[~2011-04-28 15:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-28 15:27 KOSAKI Motohiro
2011-04-28 15:33 ` Thiago Farina [this message]
2011-04-28 15:43   ` [PATCH v3] " KOSAKI Motohiro
2011-04-28 15:48     ` Thiago Farina
2011-04-28 15:52       ` [PATCH v4] " KOSAKI Motohiro

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=BANLkTim4RWbkEMuUDcGG5y-ApznqX+31uw@mail.gmail.com \
    --to=tfransosi@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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

all inboxes | Powered by JetHome®