public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	linux-kernel@vger.kernel.org, oleg@tv-sign.ru,
	dipankar@in.ibm.com, suzannew@cs.pdx.edu
Subject: Re: [PATCH] Fixes for RCU handling of task_struct
Date: Sun, 6 Nov 2005 14:43:56 -0800	[thread overview]
Message-ID: <20051106224356.GA22876@us.ibm.com> (raw)
In-Reply-To: <20051106134945.0e10cb60.akpm@osdl.org>

On Sun, Nov 06, 2005 at 01:49:45PM -0800, Andrew Morton wrote:
> Ingo Molnar <mingo@elte.hu> wrote:
> >
> > ...
> > 
> > RCU signal handling: send signals RCU-read-locked instead of 
> > tasklist_lock read-locked. This is a scalability improvement on SMP and 
> > a preemption-latency improvement under PREEMPT_RCU.
> > 
> > Signed-off-by: Paul E. McKenney <paulmck@us.ibm.com>
> > Signed-off-by: Ingo Molnar <mingo@elte.hu>
> > 
> > ...
> > +static inline int get_task_struct_rcu(struct task_struct *t)
> > +{
> > +	int oldusage;
> > +
> > +	do {
> > +		oldusage = atomic_read(&t->usage);
> > +		if (oldusage == 0) {
> > +			return 0;
> > +		}
> > +	} while (cmpxchg(&t->usage.counter,
> > +		 oldusage, oldusage + 1) != oldusage);
> > +	return 1;
> > +}
> 
> arm (at least) does not implement cmpxchg.
> 
> I think Nick is working on patches which implement cmpxchg on all
> architectures?

That he is, but the latest set of signal-RCU patches does not use
get_task_struct_rcu().  Attached is a patch that removes it.

That said, it would be good if there was a set of cmpxchg functions
for all architectures.

						Thanx, Paul

Signed-off-by: <paulmck@us.ibm.com>

---

diff -urpNa -X dontdiff linux-2.6.14-rt6/include/linux/sched.h linux-2.6.14-rt6-nocmpxchg/include/linux/sched.h
--- linux-2.6.14-rt6/include/linux/sched.h	2005-11-04 12:38:05.000000000 -0800
+++ linux-2.6.14-rt6-nocmpxchg/include/linux/sched.h	2005-11-06 14:41:26.000000000 -0800
@@ -1057,20 +1057,6 @@ extern void free_task(struct task_struct
 extern void __put_task_struct(struct task_struct *tsk);
 #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
 
-static inline int get_task_struct_rcu(struct task_struct *t)
-{
-	int oldusage;
-
-	do {
-		oldusage = atomic_read(&t->usage);
-		if (oldusage == 0) {
-			return 0;
-		}
-	} while (cmpxchg(&t->usage.counter,
-		 oldusage, oldusage + 1) != oldusage);
-	return 1;
-}
-
 extern void __put_task_struct_cb(struct rcu_head *rhp);
 
 static inline void put_task_struct(struct task_struct *t)

  reply	other threads:[~2005-11-06 22:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-31  2:05 [PATCH] Fixes for RCU handling of task_struct Paul E. McKenney
2005-10-31 14:04 ` Ingo Molnar
2005-10-31 14:08   ` Ingo Molnar
2005-11-01  4:51   ` Andrew Morton
2005-11-03 19:09     ` Paul E. McKenney
2005-11-04 17:41       ` Oleg Nesterov
2005-11-04 20:08         ` Paul E. McKenney
2005-11-05 16:32           ` Oleg Nesterov
2005-11-05 23:20             ` Paul E. McKenney
2005-11-06 12:01               ` Oleg Nesterov
2005-11-06 22:59                 ` Paul E. McKenney
2005-11-07 13:17                   ` Oleg Nesterov
2005-11-07 18:28                     ` Oleg Nesterov
2005-11-06 21:49   ` Andrew Morton
2005-11-06 22:43     ` Paul E. McKenney [this message]
2005-11-07  1:12     ` Nick Piggin
2005-11-07  4:58       ` Paul E. McKenney
2005-11-07  5:51         ` Nick Piggin
2005-11-07 18:10           ` Paul E. McKenney

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=20051106224356.GA22876@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=oleg@tv-sign.ru \
    --cc=suzannew@cs.pdx.edu \
    /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