From: Albert Cahalan <albert@users.sf.net>
To: Andrew Morton <akpm@digeo.com>
Cc: Albert Cahalan <albert@users.sourceforge.net>,
procps-list@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [patch] procfs/procps threading performance speedup, 2.5.62
Date: 22 Feb 2003 18:04:32 -0500 [thread overview]
Message-ID: <1045955073.19444.126.camel@cube> (raw)
In-Reply-To: <20030222135507.5f539bba.akpm@digeo.com>
On Sat, 2003-02-22 at 16:55, Andrew Morton wrote:
> Albert Cahalan <albert@users.sourceforge.net> wrote:
>> Note that the recent /proc/*/wchan addition was botched.
>> Caching is prevented due to race conditions. This could
>> be fixed by changing the file format to contain:
>> number, function name
>
> There is not enough detail here for it to be fixed.
>
> What are the race conditions?
>
> What is "number"?
By "number" I mean the numeric wchan. ("ps -o nwchan")
This value is provided in the /proc/*/stat files.
Most tools are stuck reading /proc/*/stat most of
the time. So the nwchan value is being read already.
You can't cache a mapping from nwchan to wchan,
because the values may change from the time you
read /proc/*/stat to the time you read /proc/*/wchan.
This forces reading /proc/*/wchan, even though top
has already seen the same value before and already
has the numeric version of it.
One more thing is needed. There should be a counter,
incremented every time a module is loaded or unloaded.
This allows the cache to be invalidated as needed.
I suppose /proc/stat is a decent place for the counter,
either at the end (safest) or right before intr.
Caching makes a major difference for wchan. Look how
few values are seen: ps -eonwchan= | sort -u | wc -l
Since the current /proc/*/wchan format isn't yet in
a stable kernel release, breaking the format wouldn't
be too bad. I like "%08x %s \n" and "%016lx %s \n"
(note the space on the end) for a nice fast parser and
ease of adding more fields. If you have something against
that space, then "%s %08x\n" and "%s %016lx\n" would do.
Any thoughts on the other stuff? Different modules
and files could have functions with the same name.
Maybe some info about this should be available, at
least if it doesn't slow things down much.
next prev parent reply other threads:[~2003-02-22 22:58 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
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 [this message]
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=1045955073.19444.126.camel@cube \
--to=albert@users.sf.net \
--cc=akpm@digeo.com \
--cc=albert@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=procps-list@redhat.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