From: Ingo Molnar <mingo@elte.hu>
To: Daniel Walker <dwalker@mvista.com>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org
Subject: Re: v2.6.21-rt2
Date: Wed, 16 May 2007 23:32:59 +0200 [thread overview]
Message-ID: <20070516213259.GC19850@elte.hu> (raw)
In-Reply-To: <1179350448.20519.25.camel@imap.mvista.com>
* Daniel Walker <dwalker@mvista.com> wrote:
> > > http://lkml.org/lkml/2007/5/3/368
> >
> > hm - trace_hardirqs_on() should never be called with irqs on -
> > lockdep could break for example. Could you try to fix the call site
> > instead?
>
> If that's the case why check if they're enabled inside
> trace_hardirqs_on() ? If that check fails you still still get the
> warning in my original release ..
yeah, indeed you are right - it checks the soft flag. But even then, the
better fix is to check for hardirqs-off first and not to flip around the
preempt count check in irqs_off_preempt_count() - i.e. something like
the patch below. Does this solve the warning you've triggered with
irqsoff-tracing enabled?
Ingo
Index: linux-rt.q/kernel/latency_trace.c
===================================================================
--- linux-rt.q.orig/kernel/latency_trace.c
+++ linux-rt.q/kernel/latency_trace.c
@@ -1963,7 +1963,7 @@ void notrace trace_hardirqs_on(void)
local_save_flags(flags);
- if (!irqs_off_preempt_count() && irqs_disabled_flags(flags))
+ if (irqs_disabled_flags(flags) && !irqs_off_preempt_count())
__stop_critical_timing(CALLER_ADDR0, 0 /* CALLER_ADDR1 */);
}
@@ -1975,7 +1975,7 @@ void notrace trace_hardirqs_off(void)
local_save_flags(flags);
- if (!irqs_off_preempt_count() && irqs_disabled_flags(flags))
+ if (irqs_disabled_flags(flags) && !irqs_off_preempt_count())
__start_critical_timing(CALLER_ADDR0, 0 /* CALLER_ADDR1 */,
INTERRUPT_LATENCY);
}
@@ -1989,7 +1989,7 @@ void notrace trace_hardirqs_on_caller(un
local_save_flags(flags);
- if (!irqs_off_preempt_count() && irqs_disabled_flags(flags))
+ if (irqs_disabled_flags(flags) && !irqs_off_preempt_count())
__stop_critical_timing(caller_addr, 0 /* CALLER_ADDR1 */);
}
@@ -1999,7 +1999,7 @@ void notrace trace_hardirqs_off_caller(u
local_save_flags(flags);
- if (!irqs_off_preempt_count() && irqs_disabled_flags(flags))
+ if (irqs_disabled_flags(flags) && !irqs_off_preempt_count())
__start_critical_timing(caller_addr, 0 /* CALLER_ADDR1 */,
INTERRUPT_LATENCY);
}
next prev parent reply other threads:[~2007-05-16 21:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-16 18:04 v2.6.21-rt2 Ingo Molnar
2007-05-16 20:54 ` v2.6.21-rt2 Daniel Walker
2007-05-16 21:01 ` v2.6.21-rt2 Ingo Molnar
2007-05-16 21:20 ` v2.6.21-rt2 Daniel Walker
2007-05-16 21:32 ` Ingo Molnar [this message]
2007-05-16 21:47 ` v2.6.21-rt2 Daniel Walker
2007-05-16 22:04 ` v2.6.21-rt2 Ingo Molnar
2007-05-16 22:22 ` v2.6.21-rt2 Daniel Walker
2007-05-16 23:32 ` v2.6.21-rt2 Free Ekanayaka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070516213259.GC19850@elte.hu \
--to=mingo@elte.hu \
--cc=dwalker@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox