Why timer interrupt is disabled?

David Woodhouse dwmw2 at infradead.org
Fri May 25 12:37:42 EDT 2001


andreev at niisi.msk.ru said:
>   Locking of io_request_lock and disabling interrupts, are mading in
> block devices common driver. I read the kernel-api documentation in
> Documentation/DocBook/kernel-api/r10011.html: " A global spin lock
> $io_request_lock must be held while manipulating the requests on the
> request queue."

Ah - but we're _not_ manipulating the requests on the request queue. We're 
servicing the request at the head of the queue, which is a special case - 
the queueing code knows that drivers are likely to be looking at the 
request at the head of the queue even while the io_request_lock is not held.


andreev at niisi.msk.ru said:
> While we are reading or writing data to the flash, the timer interrupt
>  is happens. Next, the schedule() called, and an other process begins
> to  write or read data to the flash.

The kernel is not preemptively scheduled. Unless the first process 
explicitly calls schedule(), it's not going to lose the CPU. Only processes 
in user mode are scheduled from the timer IRQ.

--
dwmw2






More information about the linux-mtd mailing list