From: Stephane Eranian <eranian@hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] kill pointless perfmon abstractions
Date: Wed, 08 Oct 2003 18:51:14 +0000 [thread overview]
Message-ID: <marc-linux-ia64-106564008123438@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-106562954910433@msgid-missing>
John,
On Wed, Oct 08, 2003 at 05:05:10PM +0100, John Levon wrote:
>
> Another small patch, there's no benefit to having the extra code
> here.
>
Well, it is because you only know part of the story ;-< These abstractions
are here to mask differences between the various kernels out there.
Internally I try to maintain the same perfmon-2 (perfmon.c/perfmon.h)
for 2.6, 2.4, RH EL, and Suse SLES. All of those have slight differences which
are abstracted by the code you are trying to remove in this patch.
The version I export to David contains only the support for 2.6, the
version-specific definitions are maintained in a separate header file in
my tree. Only the section relevant to 2.6 is included in David's perfmon.c file.
I have tried to keep those abstractions to a minimum and avoid all #ifdef.
>
> Index: linux-ia64/arch/ia64/kernel/perfmon.c
> =================================> RCS file: /home/cvs/linux-2.5/arch/ia64/kernel/perfmon.c,v
> retrieving revision 1.35
> diff -u -a -p -r1.35 perfmon.c
> --- linux-ia64/arch/ia64/kernel/perfmon.c 19 Sep 2003 21:01:14 -0000 1.35
> +++ linux-ia64/arch/ia64/kernel/perfmon.c 8 Oct 2003 13:57:44 -0000
> @@ -544,14 +542,8 @@ static struct vm_operations_struct pfm_v
> close: pfm_vm_close
> };
>
> -#define pfm_wait_task_inactive(t) wait_task_inactive(t)
> #define pfm_get_cpu_var(v) __ia64_per_cpu_var(v)
> #define pfm_get_cpu_data(a,b) per_cpu(a, b)
> -typedef irqreturn_t pfm_irq_handler_t;
> -#define PFM_IRQ_HANDLER_RET(v) do { \
> - put_cpu_no_resched(); \
> - return IRQ_HANDLED; \
> - } while(0);
>
> static inline void
> pfm_put_task(struct task_struct *task)
> @@ -2588,7 +2567,7 @@ pfm_task_incompatible(pfm_context_t *ctx
> /*
> * make sure the task is off any CPU
> */
> - pfm_wait_task_inactive(task);
> + wait_task_inactive(task);
>
> /* more to come... */
>
> @@ -4686,7 +4665,7 @@ pfm_check_task_state(pfm_context_t *ctx,
>
> UNPROTECT_CTX(ctx, flags);
>
> - pfm_wait_task_inactive(task);
> + wait_task_inactive(task);
>
> PROTECT_CTX(ctx, flags);
>
> @@ -5407,7 +5386,7 @@ report_spurious:
> return -1;
> }
>
> -static pfm_irq_handler_t
> +static irqreturn_t
> pfm_interrupt_handler(int irq, void *arg, struct pt_regs *regs)
> {
> unsigned long start_cycles, total_cycles;
> @@ -5436,7 +5415,9 @@ pfm_interrupt_handler(int irq, void *arg
>
> pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles;
> }
> - PFM_IRQ_HANDLER_RET();
> +
> + put_cpu_no_resched();
> + return IRQ_HANDLED;
> }
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
-Stephane
next prev parent reply other threads:[~2003-10-08 18:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-08 16:05 [PATCH] kill pointless perfmon abstractions John Levon
2003-10-08 18:51 ` Stephane Eranian [this message]
2003-10-08 19:37 ` John Levon
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=marc-linux-ia64-106564008123438@msgid-missing \
--to=eranian@hpl.hp.com \
--cc=linux-ia64@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