Re: [RFC][PATCH 2/2] add a counter for writers spinning on a rwlock

From: Peter Zijlstra
Date: Mon Jan 26 2009 - 12:42:27 EST


On Mon, 2009-01-26 at 09:36 -0800, Mandeep Baines wrote:

> Unfortunately, this can't be done for hung_task. It writes to the
> task_struct here:

Don't top post!

> static void check_hung_task(struct task_struct *t, unsigned long now,
> unsigned long timeout)
> {
> unsigned long switch_count = t->nvcsw + t->nivcsw;
>
> if (t->flags & PF_FROZEN)
> return;
>
> if (switch_count != t->last_switch_count || !t->last_switch_timestamp) {
> t->last_switch_count = switch_count;
> t->last_switch_timestamp = now;
> return;
> }
>
> It is able to get away with using only a read_lock because no one else
> reads or writes to these fields.

How would RCU be different here?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/