Re: [PATCH] IA64/perfmon: kill dead code, clean irq handling

Previous thread: LTP ustat01 test fails on NFSROOT by Kumar Gala on Tuesday, October 23, 2007 - 6:52 pm. (12 messages)

Next thread: [PATCH] 9p: fix memory leak in v9fs_get_sb by Latchesar Ionkov on Tuesday, October 23, 2007 - 7:46 pm. (1 message)
To: <tony.luck@...>, <linux-ia64@...>
Cc: Andrew Morton <akpm@...>, LKML <linux-kernel@...>
Date: Tuesday, October 23, 2007 - 7:09 pm

By deleting unused code, this makes perfmon irq handling more efficient,
as well as reducing code size.

* remove unused pfm_install_alt_pmu_interrupt()
* remove unused pfm_remove_alt_pmu_interrupt()

* remove now-unused pfm_alt_intr_handler pointer, and associated
function call in perfmon interrupt handler.

* remove unused 'irq' argument from pfm_do_interrupt_handler()

* un-indent code in pfm_interrupt_handler() now that
pfm_alt_intr_handler is no longer used.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/ia64/kernel/perfmon.c | 123 ++++++---------------------------------------
include/asm-ia64/perfmon.h | 2
2 files changed, 17 insertions(+), 108 deletions(-)

42a3391c5a27b411c80e942853e0b913911119d5
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 59169bf..12fc846 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -504,9 +504,6 @@ typedef struct {
static pfm_stats_t pfm_stats[NR_CPUS];
static pfm_session_t pfm_sessions; /* global sessions information */

-static DEFINE_SPINLOCK(pfm_alt_install_check);
-static pfm_intr_handler_desc_t *pfm_alt_intr_handler;
-
static struct proc_dir_entry *perfmon_dir;
static pfm_uuid_t pfm_null_uuid = {0,};

@@ -5526,7 +5523,7 @@ stop_monitoring:
}

static int
-pfm_do_interrupt_handler(int irq, void *arg, struct pt_regs *regs)
+pfm_do_interrupt_handler(void *arg, struct pt_regs *regs)
{
struct task_struct *task;
pfm_context_t *ctx;
@@ -5600,30 +5597,28 @@ pfm_interrupt_handler(int irq, void *arg)
struct pt_regs *regs = get_irq_regs();

this_cpu = get_cpu();
- if (likely(!pfm_alt_intr_handler)) {
- min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min;
- max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max;

- start_cycles = ia64_get_itc();
+ min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min;
+ max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max;

- ret = pfm_do_interrupt_handler(irq, arg, regs);
+ start_cycles = ia6...

To: Jeff Garzik <jeff@...>
Cc: <tony.luck@...>, <linux-ia64@...>, Andrew Morton <akpm@...>, LKML <linux-kernel@...>, <joshua.i.stone@...>, <juan.villacis@...>
Date: Thursday, October 25, 2007 - 4:46 am

Jeff,

I have not problem with the patch except maybe for those two functions.
How do you know they are not used?
Have you checked the VTUNE open-source driver?
--
-Stephane
-

To: <eranian@...>
Cc: <tony.luck@...>, <linux-ia64@...>, Andrew Morton <akpm@...>, LKML <linux-kernel@...>, <joshua.i.stone@...>, <juan.villacis@...>
Date: Thursday, October 25, 2007 - 4:51 am

I was hoping some IA-64 person could speak authoritatively on the subject :)

Jeff

-

To: Jeff Garzik <jeff@...>, <eranian@...>
Cc: Luck, Tony <tony.luck@...>, <linux-ia64@...>, Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Stone, Joshua I <joshua.i.stone@...>
Date: Thursday, October 25, 2007 - 7:05 am

Hi,

The VTune sampling driver currently uses this hook for cases where it
needs to do its own handling of the PMU on platforms that Perfmon2 may
not yet (fully, correctly) recognize at the time of the kernel's
release.

-juan

-----Original Message-----
From: Jeff Garzik [mailto:jeff@garzik.org]
Sent: Thursday, October 25, 2007 1:52 AM
To: eranian@hpl.hp.com
Cc: Luck, Tony; linux-ia64@vger.kernel.org; Andrew Morton; LKML; Stone,
Joshua I; Villacis, Juan
Subject: Re: [PATCH] IA64/perfmon: kill dead code, clean irq handling

I was hoping some IA-64 person could speak authoritatively on the
subject :)

Jeff
-

To: Villacis, Juan <juan.villacis@...>
Cc: Jeff Garzik <jeff@...>, <eranian@...>, Luck, Tony <tony.luck@...>, <linux-ia64@...>, Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Stone, Joshua I <joshua.i.stone@...>
Date: Thursday, October 25, 2007 - 7:17 am

So killing it might be a good way to make the vtune folks more cooperative.
Remember we don't keep hooks for crappy out of tree code around.
-

Previous thread: LTP ustat01 test fails on NFSROOT by Kumar Gala on Tuesday, October 23, 2007 - 6:52 pm. (12 messages)

Next thread: [PATCH] 9p: fix memory leak in v9fs_get_sb by Latchesar Ionkov on Tuesday, October 23, 2007 - 7:46 pm. (1 message)