March 23, 2015
6:53 a.m.
Hi, all: Going through fs/buffer.c, I find that bh_lru_lock() is a macro which can be local_irq_disable() or preempt_disable(). #ifdef CONFIG_SMP #define bh_lru_lock() local_irq_disable() #define bh_lru_unlock() local_irq_enable() #else #define bh_lru_lock() preempt_disable() #define bh_lru_unlock() preempt_enable() #endif In SMP system, bh_lru_lock just disables local interrupt, if current kernel is preemptible, how can bh_lru_lock protect critical region? or In UP system, is making the kernel just non-preemptible safe enough when an interrupt occur and its handler may modify critical region?