lkml.org 
[lkml]   [2000]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Spinlocks, intr levels et al
Kanoj Sarcar wrote:
>
> I have read Documentation/spinlocks.txt.
>
> My problem is this: I have a lock L that is acquired from intr level,
> as well as from process context. Hence, L is grabbed/released with
> spin_lock_irqsave/spin_unlock_irqrestore. While L is held from process
> context, it is possible that the code needs to do an intercpu action
> (eg flush_tlb_all).

I think you cannot do any intercpu action with disabled interrupts: what
if both cpu's try to perform a different intercpu action?

IIRC I found 3 places that send ipi's with disabled interrupts:

* mtrr: it's easy to fix that, just move the "set_mtrr_prepare()" behind
the smp_call_function().

* panic(), machine_restart(): both functions call smp_send_stop(), and
this function uses smp_call_function to issue an ipi.
I don't know how to fix this problem, therefore I didn't post a patch.


> The only solution I can think of is to have a
> new routine spin_lock_irqsave_intercpu() that raises intr level,
> tries to get the lock, on failure drops the intr level, and retries.
>

This is only reliable if there is only _one_ such spinlock. As soon as
you have 2 users, you have a lock-up.

--
Manfred


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

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.049 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site