Re: 2.6.7-rc2-mm1

Mikael Pettersson
2004-06-01T14:17:33Z

Christoph Hellwig writes:
> On Tue, Jun 01, 2004 at 03:43:45PM +0200, Mikael Pettersson wrote:
> > Been there, done that. open() on /proc/{$pid,self}/perfctr with
> > or without O_CREAT was the "get initial access" interface for
> > several years, until the semantics of /proc/$pid (and /proc/self)
> > completely changed in 2.6.0-test6.
> >
> > Virtual perfctrs wants something that denotes the real kernel
> > task, not that process-is-a-group-of-kernel-threads crap.
>
> I'm not on a nptl system here, so no thread groups in use, but don't
> we have /proc/$pid/$tid/ now?

Maybe. I didn't investigate the subdirectory semantics too
closely because at the time I wanted something that could
work in both 2.6 and 2.4. Hence the self-contained ioctl()
on a char-misc device approach in perfctr-2.6.

A file-system open() solution needs:
1. A simple predictable file name that denotes your own task.
2. Given a task id (however it's retrieved, but it's not getpid()),
a file name that denotes that and only that task.

> And yes, I agree with you that the change was utter crap, still wondering
> how it went in without proper review.

I'm biased :-) but I think the main reason had to do with
systems with many thousands of threads, which may have
made /proc and tools like top and ps behave poorly.

/Mikael