linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86, perfctr: remove unused func avail_to_resrv_perfctr_nmi()
@ 2009-12-24  1:54 Naga Chumbalkar
  2009-12-24 15:04 ` Cyrill Gorcunov
  2009-12-28 10:07 ` [tip:perf/core] x86, perfctr: Remove " tip-bot for Naga Chumbalkar
  0 siblings, 2 replies; 6+ messages in thread
From: Naga Chumbalkar @ 2009-12-24  1:54 UTC (permalink / raw)
  To: x86; +Cc: Naga Chumbalkar, linux-kernel, gorcunov, oprofile-list, mingo, tglx

avail_to_resrv_perfctr_nmi() is neither EXPORT'd, nor used in the file.
So remove it.

Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
---
 arch/x86/include/asm/nmi.h             |    1 -
 arch/x86/kernel/cpu/perfctr-watchdog.c |   11 -----------
 2 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h
index 139d4c1..93da9c3 100644
--- a/arch/x86/include/asm/nmi.h
+++ b/arch/x86/include/asm/nmi.h
@@ -19,7 +19,6 @@ extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
 extern int check_nmi_watchdog(void);
 extern int nmi_watchdog_enabled;
 extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
-extern int avail_to_resrv_perfctr_nmi(unsigned int);
 extern int reserve_perfctr_nmi(unsigned int);
 extern void release_perfctr_nmi(unsigned int);
 extern int reserve_evntsel_nmi(unsigned int);
diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index 898df97..74f4e85 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -115,17 +115,6 @@ int avail_to_resrv_perfctr_nmi_bit(unsigned int counter)
 
 	return !test_bit(counter, perfctr_nmi_owner);
 }
-
-/* checks the an msr for availability */
-int avail_to_resrv_perfctr_nmi(unsigned int msr)
-{
-	unsigned int counter;
-
-	counter = nmi_perfctr_msr_to_bit(msr);
-	BUG_ON(counter > NMI_MAX_COUNTER_BITS);
-
-	return !test_bit(counter, perfctr_nmi_owner);
-}
 EXPORT_SYMBOL(avail_to_resrv_perfctr_nmi_bit);
 
 int reserve_perfctr_nmi(unsigned int msr)
-- 
1.6.2.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86, perfctr: remove unused func avail_to_resrv_perfctr_nmi()
  2009-12-24  1:54 [PATCH] x86, perfctr: remove unused func avail_to_resrv_perfctr_nmi() Naga Chumbalkar
@ 2009-12-24 15:04 ` Cyrill Gorcunov
  2009-12-28  8:38   ` Ingo Molnar
  2009-12-28 10:07 ` [tip:perf/core] x86, perfctr: Remove " tip-bot for Naga Chumbalkar
  1 sibling, 1 reply; 6+ messages in thread
From: Cyrill Gorcunov @ 2009-12-24 15:04 UTC (permalink / raw)
  To: Naga Chumbalkar; +Cc: x86, linux-kernel, oprofile-list, mingo, tglx

On Thu, Dec 24, 2009 at 01:54:47AM +0000, Naga Chumbalkar wrote:
> avail_to_resrv_perfctr_nmi() is neither EXPORT'd, nor used in the file.
> So remove it.
> 
> Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
> ---
>  arch/x86/include/asm/nmi.h             |    1 -
>  arch/x86/kernel/cpu/perfctr-watchdog.c |   11 -----------
>  2 files changed, 0 insertions(+), 12 deletions(-)
> 

Hi Naga, this looks good to me! Thanks.

Is there any plans to use this routine in future
so we shouldn't touch this snippet?

	-- Cyrill

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86, perfctr: remove unused func avail_to_resrv_perfctr_nmi()
  2009-12-24 15:04 ` Cyrill Gorcunov
@ 2009-12-28  8:38   ` Ingo Molnar
  2009-12-28  9:55     ` Cyrill Gorcunov
  0 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2009-12-28  8:38 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: Naga Chumbalkar, x86, linux-kernel, oprofile-list, tglx


* Cyrill Gorcunov <gorcunov@gmail.com> wrote:

> On Thu, Dec 24, 2009 at 01:54:47AM +0000, Naga Chumbalkar wrote:
> > avail_to_resrv_perfctr_nmi() is neither EXPORT'd, nor used in the file.
> > So remove it.
> > 
> > Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
> > ---
> >  arch/x86/include/asm/nmi.h             |    1 -
> >  arch/x86/kernel/cpu/perfctr-watchdog.c |   11 -----------
> >  2 files changed, 0 insertions(+), 12 deletions(-)
> > 
> 
> Hi Naga, this looks good to me! Thanks.
> 
> Is there any plans to use this routine in future
> so we shouldn't touch this snippet?

Not that i know of.

In fact we should transform/migrate the NMI watchdog driver by making it based 
on a kernel-internal created perf event. (which is what the NMI watchdog 
really is: a periodic NMI event occuring once per second and running a 
callback function.)

That would give us NMI watchdog support on all future x86 CPUs, automatically 
- without having to extend the arch/x86/kernel/cpu/perfctr-watchdog.c code for 
it.

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86, perfctr: remove unused func avail_to_resrv_perfctr_nmi()
  2009-12-28  8:38   ` Ingo Molnar
@ 2009-12-28  9:55     ` Cyrill Gorcunov
  2009-12-28 10:00       ` Ingo Molnar
  0 siblings, 1 reply; 6+ messages in thread
From: Cyrill Gorcunov @ 2009-12-28  9:55 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Naga Chumbalkar, x86, linux-kernel, oprofile-list, tglx

On Mon, Dec 28, 2009 at 09:38:45AM +0100, Ingo Molnar wrote:
> 
> * Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> 
> > On Thu, Dec 24, 2009 at 01:54:47AM +0000, Naga Chumbalkar wrote:
> > > avail_to_resrv_perfctr_nmi() is neither EXPORT'd, nor used in the file.
> > > So remove it.
> > > 
> > > Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
> > > ---
> > >  arch/x86/include/asm/nmi.h             |    1 -
> > >  arch/x86/kernel/cpu/perfctr-watchdog.c |   11 -----------
> > >  2 files changed, 0 insertions(+), 12 deletions(-)
> > > 
> > 
> > Hi Naga, this looks good to me! Thanks.
> > 
> > Is there any plans to use this routine in future
> > so we shouldn't touch this snippet?
> 
> Not that i know of.

ok, then we could apply this patch I think, at least for
a while.

> 
> In fact we should transform/migrate the NMI watchdog driver by making it based 
> on a kernel-internal created perf event. (which is what the NMI watchdog 
> really is: a periodic NMI event occuring once per second and running a 
> callback function.)

Yes, this would be great. I'll try to find out some time for this
task, though no promises :) If someone get it done earlier I would
really appreciate.

> 
> That would give us NMI watchdog support on all future x86 CPUs, automatically 
> - without having to extend the arch/x86/kernel/cpu/perfctr-watchdog.c code for 
> it.
> 
> 	Ingo
> 
	-- Cyrill

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86, perfctr: remove unused func avail_to_resrv_perfctr_nmi()
  2009-12-28  9:55     ` Cyrill Gorcunov
@ 2009-12-28 10:00       ` Ingo Molnar
  0 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2009-12-28 10:00 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: Naga Chumbalkar, x86, linux-kernel, oprofile-list, tglx


* Cyrill Gorcunov <gorcunov@gmail.com> wrote:

> > Not that i know of.
> 
> ok, then we could apply this patch I think, at least for a while.

yeah, i have applied it.

> > In fact we should transform/migrate the NMI watchdog driver by making it 
> > based on a kernel-internal created perf event. (which is what the NMI 
> > watchdog really is: a periodic NMI event occuring once per second and 
> > running a callback function.)
> 
> Yes, this would be great. I'll try to find out some time for this task, 
> though no promises :) If someone get it done earlier I would really 
> appreciate.

Feel free to do it. We could do it gradual. Maybe we could also then gradually 
remove perfctr code for CPU variants that already have perf events support. 

Plus later on we could carefully identify bits of APIC support code in 
perfctr.c and turn those into minimal perf events PMU drivers.

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip:perf/core] x86, perfctr: Remove unused func avail_to_resrv_perfctr_nmi()
  2009-12-24  1:54 [PATCH] x86, perfctr: remove unused func avail_to_resrv_perfctr_nmi() Naga Chumbalkar
  2009-12-24 15:04 ` Cyrill Gorcunov
@ 2009-12-28 10:07 ` tip-bot for Naga Chumbalkar
  1 sibling, 0 replies; 6+ messages in thread
From: tip-bot for Naga Chumbalkar @ 2009-12-28 10:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, nagananda.chumbalkar, tglx, gorcunov, mingo

Commit-ID:  fd2a50a0240f5f5b59070474eabd83a85720a406
Gitweb:     http://git.kernel.org/tip/fd2a50a0240f5f5b59070474eabd83a85720a406
Author:     Naga Chumbalkar <nagananda.chumbalkar@hp.com>
AuthorDate: Thu, 24 Dec 2009 01:54:47 +0000
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 28 Dec 2009 09:36:46 +0100

x86, perfctr: Remove unused func avail_to_resrv_perfctr_nmi()

avail_to_resrv_perfctr_nmi() is neither EXPORT'd, nor used in
the file. So remove it.

Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: oprofile-list@lists.sf.net
LKML-Reference: <20091224015441.6005.4408.sendpatchset@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/include/asm/nmi.h             |    1 -
 arch/x86/kernel/cpu/perfctr-watchdog.c |   11 -----------
 2 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h
index 139d4c1..93da9c3 100644
--- a/arch/x86/include/asm/nmi.h
+++ b/arch/x86/include/asm/nmi.h
@@ -19,7 +19,6 @@ extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
 extern int check_nmi_watchdog(void);
 extern int nmi_watchdog_enabled;
 extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
-extern int avail_to_resrv_perfctr_nmi(unsigned int);
 extern int reserve_perfctr_nmi(unsigned int);
 extern void release_perfctr_nmi(unsigned int);
 extern int reserve_evntsel_nmi(unsigned int);
diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index 898df97..74f4e85 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -115,17 +115,6 @@ int avail_to_resrv_perfctr_nmi_bit(unsigned int counter)
 
 	return !test_bit(counter, perfctr_nmi_owner);
 }
-
-/* checks the an msr for availability */
-int avail_to_resrv_perfctr_nmi(unsigned int msr)
-{
-	unsigned int counter;
-
-	counter = nmi_perfctr_msr_to_bit(msr);
-	BUG_ON(counter > NMI_MAX_COUNTER_BITS);
-
-	return !test_bit(counter, perfctr_nmi_owner);
-}
 EXPORT_SYMBOL(avail_to_resrv_perfctr_nmi_bit);
 
 int reserve_perfctr_nmi(unsigned int msr)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-12-28 10:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-24  1:54 [PATCH] x86, perfctr: remove unused func avail_to_resrv_perfctr_nmi() Naga Chumbalkar
2009-12-24 15:04 ` Cyrill Gorcunov
2009-12-28  8:38   ` Ingo Molnar
2009-12-28  9:55     ` Cyrill Gorcunov
2009-12-28 10:00       ` Ingo Molnar
2009-12-28 10:07 ` [tip:perf/core] x86, perfctr: Remove " tip-bot for Naga Chumbalkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).