From: Andrew Morton <akpm@osdl.org>
To: eranian@hpl.hp.com
Cc: linux-kernel@vger.kernel.org, perfmon@napali.hpl.hp.com,
linux-ia64@vger.kernel.org
Subject: Re: perfmon2 context: thread_struct vs. task_struct?
Date: Thu, 23 Mar 2006 02:37:36 +0000 [thread overview]
Message-ID: <20060322183736.4a3bb1c2.akpm@osdl.org> (raw)
In-Reply-To: <20060322233253.GB26602@frankl.hpl.hp.com>
Stephane Eranian <eranian@hpl.hp.com> wrote:
>
> Hello,
>
> The perfmon2 subsystem maintains a structure per-thread
> that contains the save-area for the performance counters
> and related software state. The save area is used on
> context-switch. There can only be one context per thread.
> The context is dynamically allocated as such it does not
> consume memory in each thread. It is dyanmically attached
> to the thread to monitor.
>
> In the current implementation, the context (pfm_context)
> pointer is implemented in the thread_struct on the basis
> that this is somewhat related to machine state.
>
> Historically, the perfmon subsystem only existed on IA-64
> which made the thread_struct (an arch-specific structure)
> the obvious place to put this.
>
> Nowadays, perfmon2 supports most major architectures. It
> may make sense to move the void *pfm_context pointer from
> the thread_struct into the task_struct. This would save
> some indirections, make it readily available to other
> archiectures when it is ported.
>
> I admit I am not quite clear as to what goes where between
> thread_struct and task_struct.
>
> Would it make sense to move the pointer to the perfmon2
> context into the task_struct?
I'd say so, yes. Especialy if the struct is the same on all architectures,
is referred to from non-arch-specific code and is absent if
CONFIG_PERFMON=n.
next prev parent reply other threads:[~2006-03-23 2:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-22 23:32 perfmon2 context: thread_struct vs. task_struct? Stephane Eranian
2006-03-23 2:37 ` Andrew Morton [this message]
2006-03-23 5:41 ` Stephane Eranian
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=20060322183736.4a3bb1c2.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=eranian@hpl.hp.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perfmon@napali.hpl.hp.com \
/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