Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH -tip] x86: ftrace - simplify wait_for_nmi

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


gorcunov at gmail

Jan 26, 2009, 7:28 AM

Post #1 of 4 (790 views)
Permalink
[PATCH -tip] x86: ftrace - simplify wait_for_nmi

Get rid of 'waited' stack variable.

Signed-off-by: Cyrill Gorcunov <gorcunov [at] gmail>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rostedt at goodmis

Jan 26, 2009, 7:41 AM

Post #2 of 4 (729 views)
Permalink
Re: [PATCH -tip] x86: ftrace - simplify wait_for_nmi [In reply to]

On Mon, 26 Jan 2009, Cyrill Gorcunov wrote:

> Get rid of 'waited' stack variable.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov [at] gmail>

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
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rostedt at goodmis

Jan 26, 2009, 9:38 PM

Post #3 of 4 (725 views)
Permalink
Re: [PATCH -tip] x86: ftrace - simplify wait_for_nmi [In reply to]

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 [at] gmail>
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 [at] gmail>
Signed-off-by: Steven Rostedt <srostedt [at] redhat>

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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


mingo at elte

Jan 27, 2009, 5:31 AM

Post #4 of 4 (715 views)
Permalink
Re: [PATCH -tip] x86: ftrace - simplify wait_for_nmi [In reply to]

* Steven Rostedt <rostedt [at] goodmis> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.