Stephane Eranian wrote:
Will,

On Mon, Oct 02, 2006 at 08:04:34PM -0400, William Cohen wrote:

Anil and Stephane did just free up 128 words in the thread structure on
ia64 (which is concatenated to the task structure) in this change:
http://tinyurl.com/nzngv by moving the PMU save areas out of the thread
structure and into the pfm_context. Is something similar possible for other
archs?


This change is already in the 2.2 code base. The PMU state is saved into a pfm_context struct. The only thing left in tasks_struct is a pointer
to that structure.


Yes, this change is in the existing perfmon 3.2 kernel support for the 2.6.18 kernel. The comment was about the solitary pointer in the newest perfmon patch set. Every byte is precious. :)


I am not sure I buy this argument although I can understand it for embedded
platforms.

I was exagerrating a bit about "Every bit is precious." However, not every kernel user is going to be using the perfmon per thread capability and having an extra pointer uses up 4 or 8 bytes. It doesn't take too many additions like this to make the task_struct much larger.

However, I think what is more interesting is the layout of the structure, i.e.,
the relative position of the fields. Are they positioned such that hot fields
are separated from cold fields to minimize the number of cachelines that
need to be loaded into the cache for the most common operations?

Hmmm, that does bring up an interesting use of perfmon. On ia64 perfmon could be set up to do sampling on memory references (or cache misses). Match the samples up with the task_struct fields would give developers some insight into problems with the task_struct layout. This would give the kernel developers a vested interest in perfmon support being incorporated into the kernel.

Jesse Beu, a ECE student at NCSU has developed some techniques to collect memory reference information using the PEBS hardware on the P4. The current implementation of the software only works on one userspace thread. Maybe that could be extended to work for kernel space. Jesse should be able to fill in the details on how this was implemented. Jesse, is there some way that your master's thesis can be made available?

-Will
_______________________________________________
perfmon mailing list
[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/

Reply via email to