[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080507073017.GJ32195@elte.hu>
Date: Wed, 7 May 2008 09:30:17 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Christoph Lameter <clameter@....com>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: Spinlocks waiting with interrupts disabled / preempt disabled.
* Christoph Lameter <clameter@....com> wrote:
> @@ -132,10 +132,14 @@ unsigned long __lockfunc _write_lock_irq
> {
> unsigned long flags;
>
> +retry:
> local_irq_save(flags);
> - preempt_disable();
> - _raw_write_lock(lock);
> - return flags;
> + if (_write_trylock(lock))
> + return flags;
> + local_irq_restore(flags);
> + while (!write_can_lock(lock))
> + cpu_relax();
> + goto retry;
> }
> EXPORT_SYMBOL(_write_lock_irqsave);
hm, this is done on a too high level and will turn off some debugging
code. I.e. if we dont just loop long but truly deadlock here we wont
call lib/spinlock_debug.c's _raw_write_lock() code that does some sanity
checks in the debug case.
so how about doing this on a deeper level and adding a new
__raw_write_lock_flags() primitive that would look at the flags value
and could enable interrupts in the lowlevel code?
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists