Re: [PATCH] Fixes for RCU handling of task_struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 07, 2005 at 12:12:25PM +1100, Nick Piggin wrote:
> Andrew Morton wrote:
> 
> >>+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.
> >
> 
> Yes, and using atomic_t.counter in generic code is ugly, albeit
> compatible with all current implementations.
> 
> >I think Nick is working on patches which implement cmpxchg on all
> >architectures?
> 
> Yes, it is basically ready to go.

Would it simplify the rcuref.h code?  Or lib/dec_and_lock.c?

						Thanx, Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux