From: jw schultz <jw@pegasys.ws>
To: LKML <linux-kernel@vger.kernel.org>
Subject: Re: dcache_rcu [performance results]
Date: Mon, 4 Nov 2002 16:00:10 -0800 [thread overview]
Message-ID: <20021105000010.GA21914@pegasys.ws> (raw)
In-Reply-To: <1025970000.1036430954@flay>
On Mon, Nov 04, 2002 at 09:29:14AM -0800, Martin J. Bligh wrote:
> > Clearly dcache_lock is the killer when 'ps' command is used in
> > the benchmark. My guess (without looking at 'ps' code) is that
> > it has to open/close a lot of files in /proc and that increases
> > the number of acquisitions of dcache_lock. Increased # of acquisition
> > add to cache line bouncing and contention.
>
> Strace it - IIRC it does 5 opens per PID. Vomit.
I just did, had the same reaction. This is ugly.
It opens stat, statm, status, cmdline and environ apparently
regardless of what will be in the ouput. At least environ
will fail on most pids if you aren't root, saving on some of
the overhead. It compunds this by doing so for every pid
even if you have explicitly requested only one pid by
number.
Clearly ps could do with a cleanup. There is no reason to
read environ if it wasn't asked for. Deciding which files
are needed based on the command line options would be a
start.
I'm thinking that ps, top and company are good reasons to
make an exception of one value per file in proc. Clearly
open+read+close of 3-5 "files" each extracting data from
task_struct isn't more efficient than one "file" that
generates the needed data one field per line.
Don't get me wrong. I believe in the one field per file
rule but ps &co are the exception that proves (tests) the
rule. Especially on the heavily laden systems with
tens of thousands of tasks. We could do with a something
between /dev/kmem and five files per pid.
--
________________________________________________________________
J.W. Schultz Pegasystems Technologies
email address: jw@pegasys.ws
Remember Cernan and Schmitt
next prev parent reply other threads:[~2002-11-04 23:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-30 10:49 [PATCH 2.5.44] dcache_rcu Maneesh Soni
2002-10-31 10:53 ` dcache_rcu [performance results] Dipankar Sarma
2002-11-02 1:36 ` Andrew Morton
2002-11-02 9:13 ` Dipankar Sarma
2002-11-04 17:29 ` Martin J. Bligh
2002-11-05 0:00 ` jw schultz [this message]
2002-11-05 1:14 ` ps performance sucks (was Re: dcache_rcu [performance results]) Martin J. Bligh
2002-11-05 3:57 ` Werner Almesberger
2002-11-05 4:42 ` Erik Andersen
2002-11-05 5:44 ` Martin J. Bligh
2002-11-05 5:59 ` Alexander Viro
2002-11-05 6:05 ` Martin J. Bligh
2002-11-05 6:15 ` Robert Love
2002-11-05 6:13 ` Erik Andersen
2002-11-05 6:14 ` Werner Almesberger
2002-11-05 4:26 ` jw schultz
2002-11-05 5:51 ` Martin J. Bligh
2002-11-05 19:57 ` Kai Henningsen
2002-11-05 21:33 ` Erik Andersen
2002-11-05 22:09 ` Karim Yaghmour
[not found] <20021030161912.E2613@in.ibm.com.suse.lists.linux.kernel>
[not found] ` <20021031162330.B12797@in.ibm.com.suse.lists.linux.kernel>
[not found] ` <3DC32C03.C3910128@digeo.com.suse.lists.linux.kernel>
[not found] ` <20021102144306.A6736@dikhow.suse.lists.linux.kernel>
2002-11-02 10:08 ` dcache_rcu [performance results] Andi Kleen
2002-11-02 10:54 ` Dipankar Sarma
2002-11-02 11:01 ` Andi Kleen
2002-11-02 19:41 ` Linus Torvalds
2002-11-02 21:16 ` Sam Ravnborg
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=20021105000010.GA21914@pegasys.ws \
--to=jw@pegasys.ws \
--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