* [PATCH -tip] x86: ftrace - simplify wait_for_nmi
@ 2009-01-26 15:28 Cyrill Gorcunov
2009-01-26 15:41 ` Steven Rostedt
0 siblings, 1 reply; 4+ messages in thread
From: Cyrill Gorcunov @ 2009-01-26 15:28 UTC (permalink / raw)
To: Steven Rostedt, Ingo Molnar
Cc: LKML, H. Peter Anvin, Thomas Gleixner, Frederic Weisbecker
Get rid of 'waited' stack variable.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
arch/x86/kernel/ftrace.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
Index: linux-2.6.git/arch/x86/kernel/ftrace.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/ftrace.c
+++ linux-2.6.git/arch/x86/kernel/ftrace.c
@@ -133,15 +133,14 @@ void ftrace_nmi_exit(void)
static void wait_for_nmi(void)
{
- int waited = 0;
+ if (!atomic_read(&in_nmi))
+ return;
- while (atomic_read(&in_nmi)) {
- waited = 1;
+ do {
cpu_relax();
- }
+ } while(atomic_read(&in_nmi));
- if (waited)
- nmi_wait_count++;
+ nmi_wait_count++;
}
static int
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -tip] x86: ftrace - simplify wait_for_nmi
2009-01-26 15:28 [PATCH -tip] x86: ftrace - simplify wait_for_nmi Cyrill Gorcunov
@ 2009-01-26 15:41 ` Steven Rostedt
2009-01-27 5:38 ` Steven Rostedt
0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2009-01-26 15:41 UTC (permalink / raw)
To: Cyrill Gorcunov
Cc: Ingo Molnar, LKML, H. Peter Anvin, Thomas Gleixner,
Frederic Weisbecker
On Mon, 26 Jan 2009, Cyrill Gorcunov wrote:
> Get rid of 'waited' stack variable.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Thanks Cyrill,
Either I or Ingo will pull it in.
-- Steve
> ---
> arch/x86/kernel/ftrace.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> Index: linux-2.6.git/arch/x86/kernel/ftrace.c
> ===================================================================
> --- linux-2.6.git.orig/arch/x86/kernel/ftrace.c
> +++ linux-2.6.git/arch/x86/kernel/ftrace.c
> @@ -133,15 +133,14 @@ void ftrace_nmi_exit(void)
>
> static void wait_for_nmi(void)
> {
> - int waited = 0;
> + if (!atomic_read(&in_nmi))
> + return;
>
> - while (atomic_read(&in_nmi)) {
> - waited = 1;
> + do {
> cpu_relax();
> - }
> + } while(atomic_read(&in_nmi));
>
> - if (waited)
> - nmi_wait_count++;
> + nmi_wait_count++;
> }
>
> static int
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -tip] x86: ftrace - simplify wait_for_nmi
2009-01-26 15:41 ` Steven Rostedt
@ 2009-01-27 5:38 ` Steven Rostedt
2009-01-27 13:31 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2009-01-27 5:38 UTC (permalink / raw)
To: Cyrill Gorcunov
Cc: Ingo Molnar, LKML, H. Peter Anvin, Thomas Gleixner,
Frederic Weisbecker
Ingo,
The following patch is in:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
branch: tip/devel
Cyrill Gorcunov (1):
x86: ftrace - simplify wait_for_nmi
----
arch/x86/kernel/ftrace.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---------------------------
commit e4733771167c00aa8bf8791307ca47f1c0420f55
Author: Cyrill Gorcunov <gorcunov@gmail.com>
Date: Mon Jan 26 18:28:02 2009 +0300
x86: ftrace - simplify wait_for_nmi
Get rid of 'waited' stack variable.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 1b43086..4d33224 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -133,15 +133,14 @@ void ftrace_nmi_exit(void)
static void wait_for_nmi(void)
{
- int waited = 0;
+ if (!atomic_read(&in_nmi))
+ return;
- while (atomic_read(&in_nmi)) {
- waited = 1;
+ do {
cpu_relax();
- }
+ } while(atomic_read(&in_nmi));
- if (waited)
- nmi_wait_count++;
+ nmi_wait_count++;
}
static int
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -tip] x86: ftrace - simplify wait_for_nmi
2009-01-27 5:38 ` Steven Rostedt
@ 2009-01-27 13:31 ` Ingo Molnar
0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2009-01-27 13:31 UTC (permalink / raw)
To: Steven Rostedt
Cc: Cyrill Gorcunov, LKML, H. Peter Anvin, Thomas Gleixner,
Frederic Weisbecker
* Steven Rostedt <rostedt@goodmis.org> wrote:
>
> Ingo,
>
> The following patch is in:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
>
> branch: tip/devel
>
>
> Cyrill Gorcunov (1):
> x86: ftrace - simplify wait_for_nmi
>
> ----
> arch/x86/kernel/ftrace.c | 11 +++++------
> 1 files changed, 5 insertions(+), 6 deletions(-)
Pulled, thanks guys!
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-27 13:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 15:28 [PATCH -tip] x86: ftrace - simplify wait_for_nmi Cyrill Gorcunov
2009-01-26 15:41 ` Steven Rostedt
2009-01-27 5:38 ` Steven Rostedt
2009-01-27 13:31 ` Ingo Molnar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.