From: miquels@cistron-office.nl (Miquel van Smoorenburg)
To: linux-kernel@vger.kernel.org
Subject: Re: [patch] procfs/procps threading performance speedup, 2.5.62
Date: Thu, 20 Feb 2003 16:47:15 +0000 (UTC) [thread overview]
Message-ID: <b330qj$sri$1@news.cistron.nl> (raw)
In-Reply-To: Pine.LNX.4.44.0302201656030.30000-100000@localhost.localdomain
In article <Pine.LNX.4.44.0302201656030.30000-100000@localhost.localdomain>,
Ingo Molnar <mingo@elte.hu> wrote:
>the fix for this is two-fold. First, it must be possible for procps to
>separate 'threads' from 'processes' without having to go into 16 thousand
>directories. I solved this by prefixing 'threads' (ie. non-group-leader
>threads) with a dot ('.') character in the /proc listing:
Why not put threads belonging to a thread group into /proc/17072/threads ?
> $ ls -a /proc
I'm seeing 17072 as a group-leader and the 'threads' as .17073 etc.
When you put all 'threads' into /proc/17072/threads, you'd get
/proc/17072/threads/17072, /proc/17072/threads/17073, etc.
/proc/17072 would show stats for the whole threads group, while
/proc/17072/threads/17072 would show stats for just that thread.
>the .17073 ... .17082 entries belong to the thread-group 17072.
Yuck ;(
>The key here is for procps to be able to parse threads without having to
>call into the kernel 16K times. The dot-approach also has the added
>benefit of 'hiding' threads in the default 'ls /proc' listing.
What is against /proc/<pid>/threads ?
>the other change needed was the ability to read comulative CPU usage
>statistics from the thread group leader. I've introduced 4 new fields in
>/proc/PID/stat for that purpose, the kernel keeps those uptodate across
>fork/exit and in the timer interrupt - it's very low-overhead.
That would also be solved with /proc/<pid> and /proc/<pid>/threads/<thread>
>another advantage of this approach is that old procps is fully compatible
>with the new kernel, and new procps is fully compatible with old kernels.
That would also be the case with /proc/<pid>/threads
Mike.
--
Anyone who is capable of getting themselves made President should
on no account be allowed to do the job -- Douglas Adams.
next prev parent reply other threads:[~2003-02-20 16:37 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-20 16:33 [patch] procfs/procps threading performance speedup, 2.5.62 Ingo Molnar
2003-02-20 16:47 ` Miquel van Smoorenburg [this message]
2003-02-20 16:55 ` Daniel Jacobowitz
2003-02-20 17:00 ` Nikita Danilov
2003-02-20 17:06 ` Linus Torvalds
2003-02-20 17:14 ` Ingo Molnar
2003-02-20 17:22 ` Linus Torvalds
2003-02-21 7:38 ` Oliver Xymoron
2003-02-20 17:23 ` Ingo Molnar
2003-02-22 20:52 ` Albert Cahalan
2003-02-22 21:55 ` Andrew Morton
2003-02-22 23:04 ` Albert Cahalan
2003-02-23 18:49 ` Ingo Molnar
2003-02-23 21:51 ` Albert D. Cahalan
2003-02-24 9:28 ` Ingo Molnar
2003-02-24 11:12 ` Albert D. Cahalan
2003-02-24 11:26 ` Ingo Molnar
2003-02-24 12:29 ` Albert D. Cahalan
2003-02-24 12:41 ` Ingo Molnar
2003-02-24 12:45 ` Ingo Molnar
2003-02-24 12:52 ` Ingo Molnar
2003-02-24 9:38 ` Ingo Molnar
2003-02-24 12:13 ` Albert D. Cahalan
2003-02-20 17:28 ` Jeff Garzik
2003-02-20 17:30 ` Ingo Molnar
2003-02-20 17:48 ` Linus Torvalds
2003-02-20 17:20 ` Linus Torvalds
2003-02-20 19:13 ` Daniel Jacobowitz
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='b330qj$sri$1@news.cistron.nl' \
--to=miquels@cistron-office.nl \
--cc=linux-kernel@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