public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@hpl.hp.com>
To: linux-kernel@vger.kernel.org
Cc: perfmon@napali.hpl.hp.com, linux-ia64@vger.kernel.org
Subject: perfmon2 context: thread_struct vs. task_struct?
Date: Wed, 22 Mar 2006 23:32:53 +0000	[thread overview]
Message-ID: <20060322233253.GB26602@frankl.hpl.hp.com> (raw)

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?

Thanks.

-- 
-Stephane

             reply	other threads:[~2006-03-22 23:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-22 23:32 Stephane Eranian [this message]
2006-03-23  2:37 ` perfmon2 context: thread_struct vs. task_struct? Andrew Morton
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=20060322233253.GB26602@frankl.hpl.hp.com \
    --to=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