revert bh_lru_lock() to preempt_disable()
PATCH 1/1 revert bh_lru_lock() to preempt_disable()
The bh_lru_lock() was set to disable interrupt to protect
from IPI's, which are only on SMP . So I don't think it's needed in UP PREEMPT_RT configs.
fs/buffer.c +1 -1
@@ -1326,7 +1326,7 @@ struct bh_lru { static DEFINE_PER_CPU(struct bh_lru, bh_lrus) = {{ NULL }}; -#if defined(CONFIG_SMP ) || defined(CONFIG_PREEMPT_RT ) +#if defined(CONFIG_SMP )#define bh_lru_lock () local_irq_disable()#define bh_lru_unlock () local_irq_enable()#else
Quoted 3 lines · Daniel Walker
The
bh_lru_lock()was set to disable interrupt to protect from
IPI's, which are only on SMP . So I don't think it's needed in UPPREEMPT_RTconfigs.
i agree that this is a problem, but the fix is incorrect. What would be the right approach is to convert the PER_CPU bh_lrus to PER_CPU_LOCKED, and to use the appropriate primitives to use them. That automatically makes this code rt-safe. (it isnt right now)
Ingo
Quoted 10 lines · Ingo Molnar
Quoted 3 lines · Daniel Walker
The
bh_lru_lock()was set to disable interrupt to protect from
IPI's, which are only on SMP . So I don't think it's needed in UPPREEMPT_RTconfigs.i agree that this is a problem, but the fix is incorrect. What would be the right approach is to convert the
PER_CPUbh_lrustoPER_CPU_LOCKED, and to use the appropriate primitives to use them. That automatically makes this code rt-safe. (it isnt right now)
Hmm, in UP it should be safe to access per cpu data under either a preempt_disable or local_irq_disable . I'm not sure how RT changes that .. Is there some other part of the code that isn't rt-safe, which I've overlooked ?
Daniel
Quoted 9 lines · Daniel Walker
Quoted 4 lines
i agree that this is a problem, but the fix is incorrect. What would be the right approach is to convert the
PER_CPUbh_lrustoPER_CPU_LOCKED, and to use the appropriate primitives to use them. That automatically makes this code rt-safe. (it isnt right now)Hmm, in UP it should be safe to access per cpu data under either a
preempt_disableorlocal_irq_disable. I'm not sure how RT changes that .. Is there some other part of the code that isn't rt-safe, which I've overlooked ?
hm, you are right - that code can be in a preempt-off section. I've applied your patch.
Ingo
Quoted 7 lines · Ingo Molnar
Quoted 5 lines · Daniel Walker
Quoted 4 lines
i agree that this is a problem, but the fix is incorrect. What would be the right approach is to convert the
PER_CPUbh_lrustoPER_CPU_LOCKED, and to use the appropriate primitives to use them. That automatically makes this code rt-safe. (it isnt right now)
Quoted 7 lines
Quoted 4 lines
Hmm, in UP it should be safe to access per cpu data under either a
preempt_disableorlocal_irq_disable. I'm not sure how RT changes that .. Is there some other part of the code that isn't rt-safe, which I've overlooked ?hm, you are right - that code can be in a preempt-off section. I've applied your patch.
We could switch it to locked types if it's a latency concern..
Daniel