Re: lockdep false positive? -- firewire-core transaction timer vs.scsi-core host lock

From: Peter Zijlstra
Date: Wed Aug 18 2010 - 04:59:21 EST


On Wed, 2010-08-18 at 09:01 +0200, Clemens Ladisch wrote:
> +retry:
> spin_lock_irqsave(&card->lock, flags);
> list_for_each_entry(t, &card->transaction_list, link) {
> if (t == transaction) {
> + if (!del_timer(&t->split_timeout_timer)) {
> + /* wait for the timer to cancel it */
> + spin_unlock_irqrestore(&card->lock, flags);
> + cpu_relax();
> + goto retry;
> + }

Open-coding spin loops like that is really ugly, and could cause trouble
for -rt.

Also, I believe that if you want the very same semantics as before, you
need to use try_to_del_timer_sync(), not del_timer().

Also, if del_timer_sync() is not allowed from any interrupt context
(including softirq) then doing the spin-loop like that doesn't actually
solve anything.

Thomas, any comments?
--
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/