From: Andi Kleen <andi@firstfloor.org>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] + sysctl-use-rcu-protected-sysctl-for-ocfs-group-add-helper.patch added to -mm tree
Date: Sat, 9 Jan 2010 07:41:08 +0100 [thread overview]
Message-ID: <20100109064108.GA20773@basil.fritz.box> (raw)
In-Reply-To: <m1r5q09jx0.fsf@fess.ebiederm.org>
> Accesses would be:
> char *str;
> rcu_read_lock();
> str = rcu_deref(NAME.str);
> ....
> rcu_read_unlock();
>
> Updates would be:
> char *next;
> mutex_lock(&rcu_string_mutex);
> next = rcu_string->data;
> if (next == rcu_string->str)
> next = rcu_string->data + rcu_string->size;
> memcpy(next, somestring_from_somewhere, rcu_string->size);
> next[rcu_string->size - 1] = '\0';
> rcu_string->str = next;
> synchronize_rcu();
> mutex_unlock(&rcu_string_mutex);
synchronize_rcu inside a lock is a bit nasty, but ok none of these
are critical.
>
> Thoughts?
It's not fully clear to me how this is better than my solution?
-Andi
--
ak at linux.intel.com -- Speaking for myself only.
next prev parent reply other threads:[~2010-01-09 6:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-08 23:54 + sysctl-use-rcu-protected-sysctl-for-ocfs-group-add-helper.patch added to -mm tree akpm
2010-01-09 0:08 ` [Ocfs2-devel] " Joel Becker
2010-01-09 0:55 ` Eric W. Biederman
2010-01-09 1:41 ` Andrew Morton
2010-01-09 3:00 ` Joel Becker
2010-01-09 5:26 ` Andrew Morton
2010-01-09 6:41 ` Andi Kleen [this message]
2010-01-09 6:44 ` Andi Kleen
2010-01-09 7:42 ` Joel Becker
2010-01-09 11:31 ` Andi Kleen
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=20100109064108.GA20773@basil.fritz.box \
--to=andi@firstfloor.org \
--cc=ocfs2-devel@oss.oracle.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.