* [PATCH -rt] revert bh_lru_lock() to preempt_disable()
@ 2006-04-22 15:05 Daniel Walker
2006-05-03 20:47 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2006-04-22 15:05 UTC (permalink / raw)
To: mingo; +Cc: linux-kernel
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.
Signed-Off-By: Daniel Walker <dwalker@mvista.com>
Index: linux-2.6.16/fs/buffer.c
===================================================================
--- linux-2.6.16.orig/fs/buffer.c
+++ linux-2.6.16/fs/buffer.c
@@ -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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH -rt] revert bh_lru_lock() to preempt_disable()
2006-04-22 15:05 [PATCH -rt] revert bh_lru_lock() to preempt_disable() Daniel Walker
@ 2006-05-03 20:47 ` Ingo Molnar
2006-05-03 20:47 ` Daniel Walker
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2006-05-03 20:47 UTC (permalink / raw)
To: Daniel Walker; +Cc: linux-kernel
* Daniel Walker <dwalker@mvista.com> wrote:
> 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.
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -rt] revert bh_lru_lock() to preempt_disable()
2006-05-03 20:47 ` Ingo Molnar
@ 2006-05-03 20:47 ` Daniel Walker
2006-05-03 21:01 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2006-05-03 20:47 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel
On Wed, 2006-05-03 at 22:47 +0200, Ingo Molnar wrote:
> * Daniel Walker <dwalker@mvista.com> wrote:
>
> > 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.
>
> 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)
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -rt] revert bh_lru_lock() to preempt_disable()
2006-05-03 20:47 ` Daniel Walker
@ 2006-05-03 21:01 ` Ingo Molnar
2006-05-03 21:01 ` Daniel Walker
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2006-05-03 21:01 UTC (permalink / raw)
To: Daniel Walker; +Cc: linux-kernel
* Daniel Walker <dwalker@mvista.com> wrote:
> > 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)
>
> 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 ?
hm, you are right - that code can be in a preempt-off section. I've
applied your patch.
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -rt] revert bh_lru_lock() to preempt_disable()
2006-05-03 21:01 ` Ingo Molnar
@ 2006-05-03 21:01 ` Daniel Walker
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Walker @ 2006-05-03 21:01 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel
On Wed, 2006-05-03 at 23:01 +0200, Ingo Molnar wrote:
> * Daniel Walker <dwalker@mvista.com> wrote:
>
> > > 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)
> >
> > 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 ?
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-05-03 21:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-22 15:05 [PATCH -rt] revert bh_lru_lock() to preempt_disable() Daniel Walker
2006-05-03 20:47 ` Ingo Molnar
2006-05-03 20:47 ` Daniel Walker
2006-05-03 21:01 ` Ingo Molnar
2006-05-03 21:01 ` Daniel Walker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox