lkml.org 
[lkml]   [2005]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateThu, 22 Sep 2005 15:05:37 +1000
FromNick Piggin <>
SubjectRe: [PATCH] RT: Checks for cmpxchg in get_task_struct_rcu()
Daniel Walker wrote:

> +#else
> + raw_local_irq_disable();
> + oldusage = atomic_read(&t->usage);
> + if (oldusage == 0) {
> + raw_local_irq_enable();
> + return 0;
> + }

Isn't this still racy if another cpu drops the last reference
to task struct here? Or can't that happen?

When you said "disable preempt", I had some silly idea that this
function was only used in PREEMPT_RT mode, and that you would
simply disallow architectures without cmpxchg from configuring
PREEMPT_RT.

> + atomic_inc(&t->usage);
> + raw_local_irq_enable();
> +#endif

--
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com

-
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/

\
 
 \ /
  Last update: 2005-09-22 07:07    [from the cache]
©2003-2010