From: Steffen Klassert <steffen.klassert@secunet.com>
To: Dan Kruchinin <dkruchinin@acm.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Herbert Xu <herbert@gondor.hengli.com.au>
Subject: Re: [PATCH 1/3] padata: separate serial and parallel cpumasks
Date: Tue, 6 Jul 2010 07:44:06 +0200 [thread overview]
Message-ID: <20100706054406.GR10072@secunet.com> (raw)
In-Reply-To: <20100706053612.GQ10072@secunet.com>
You removed everyone in the Cc, please don't do this unless you have
good reason for that. I've added the Cc'ed people again, perhaps
somebody has an opinion on this too.
On Tue, Jul 06, 2010 at 07:36:12AM +0200, Steffen Klassert wrote:
> On Mon, Jul 05, 2010 at 06:09:17PM +0400, Dan Kruchinin wrote:
> >
> > I tried to implement RCU protection on cpumask, but it appears a bit
> > ugly because we can not safely assign cpumask_var_t(that is allocated
> > via alloc_cpumask_var) to struct cpumask* via rcu_assign_pointer. The
> > root of problem lies in cpumask_var_t definition. Depending on
> > CONFIG_CPUMASK_OFFSTACK macro it may be a local variable on the stack
> > or a pointer to struct cpumask:
> > #ifdef CONFIG_CPUMASK_OFFSTACK
> > typedef struct cpumask *cpumask_var_t
> > ...
> > #else
> > typedef struct cpumask cpumask_var_t[1];
> > ...
> > #endif
>
> Hm, yes dealing with cpumasks is a bit special these days.
>
> >
> > In this case rcu_assign_pointer may be safely used only if we deal
> > with a pointer to cpumask_var_t that must be allocated via kmalloc
> > before using alloc_cpumask_var and rcu_assign_pointer. I think it's -
> > as I said earlier - a bit ugly and hard to read.
> > My be it's better to use rw spinlock instead? In our situation it
> > doesn't significantly differ from RCU. Also it'll make code more clear
> > and easy to read.
> >
>
> I think we can use RCU anyway. For instance we could use a structure
>
> struct pcrypt_cpumask {
> cpumask_var_t pmask;
> cpumask_var_t smask;
> };
>
> and add a pointer to a structure of that type to the instance context.
> Then we could use this pointer for RCU and replace the whole structure
> if a cpumask changes.
>
>
next prev parent reply other threads:[~2010-07-06 5:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTikeDE4hvZ3spyTBSHZsdQPc-2wlD5nTfb1aF-VD@mail.gmail.com>
2010-07-02 8:53 ` [PATCH 1/3] padata: separate serial and parallel cpumasks Steffen Klassert
[not found] ` <AANLkTinyPGjXjlvJxB8WYB3EYFBtANXMzpTdUixyBRHW@mail.gmail.com>
2010-07-02 9:17 ` Steffen Klassert
2010-07-02 9:32 ` Dan Kruchinin
2010-07-02 9:34 ` Dan Kruchinin
2010-07-02 11:11 ` Steffen Klassert
2010-07-02 13:01 ` Dan Kruchinin
2010-07-05 10:58 ` Steffen Klassert
[not found] ` <AANLkTimEgKGJ5pi7GzOnvP42ivJ4GCKX59LdKK0x4fnx@mail.gmail.com>
[not found] ` <20100706053612.GQ10072@secunet.com>
2010-07-06 5:44 ` Steffen Klassert [this message]
2010-07-06 7:40 ` Dan Kruchinin
2010-07-06 7:46 ` Steffen Klassert
2010-07-06 8:31 ` Dan Kruchinin
2010-07-06 13:28 ` Steffen Klassert
2010-07-06 16:30 ` Dan Kruchinin
2010-07-07 13:16 ` Steffen Klassert
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=20100706054406.GR10072@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=dkruchinin@acm.org \
--cc=herbert@gondor.hengli.com.au \
--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