[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Linux-cluster] no a storage question



i know this not the place, but since they so many kernel developers here...
i have a different question regarding locking in the kernel.

In the last issue of linux magazine there was an article about
locking. it presented the follwing  scenario.

spin_lock(lock)
...
spin_unlock(lock).

In uni processot mahcine with preemption enabled.
spin_lock saves flags and cli(). spin_unlock()  push flags out ( for nesting interrupts)

they said that this code :
Does not protect preemption.

no protection from preemption ? How ?
How can process B get some cpu while process A had disabled interrupts,
no scheduling (unwillingly ) can be made.Prior to the preemption the
kernel scehdular must run and set Process B as the one to run , and to the
best my knowledge, a schedular runs only in timer interrupt.
Or is it possible that the schduler timer routine isn't running in interrupt context ?


thank you
--
Raz

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]