public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Werner Almesberger <wa@almesberger.net>
To: "Martin J. Bligh" <mbligh@aracnet.com>
Cc: jw schultz <jw@pegasys.ws>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: ps performance sucks (was Re: dcache_rcu [performance results])
Date: Tue, 5 Nov 2002 00:57:45 -0300	[thread overview]
Message-ID: <20021105005745.E1407@almesberger.net> (raw)
In-Reply-To: <1118170000.1036458859@flay>; from mbligh@aracnet.com on Mon, Nov 04, 2002 at 05:14:19PM -0800

Martin J. Bligh wrote:
> I had a very brief think about this at the weekend, seeing
> if I could make a big melting pot /proc/psinfo file

You could take a more radical approach. Since the goal of such
a psinfo file would be to accelerate access to information
that's already available elsewhere, you can do away with many
of the niceties of procfs, e.g.

 - no need to be human-readable (e.g. binary or hex dump may
   make sense in this case)
 - may use other operations than just open and read (e.g.
   do an initial write to select what should be read)
 - you may cache previous responses and only output deltas
   (not sure if this is useful - all you'd safe is the
   actual copy to user space)

Actually, I think attempting to just make it brutally efficient,
no matter how much nastiness you amass doing that, might be
good approach for a first version. Then, if people are
digusted, you can make things nicer, and keep track of how
much performance you're losing.

Example:

First write says "pid,comm". Internally, this gets translated
to 0x8c+0x04, 0x2ee+0x10 (offset+length). Next read returns
"pid 4,comm 16" (include the name, so you can indicate fields
the kernel doesn't recognize). Then, kmalloc 20*tasks bytes,
lock, copy the fields from struct task_struct, unlock, let the
stuff be read by user space, kfree. Adjacent fields can be
optimized to single byte strings at setup time.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/

  reply	other threads:[~2002-11-05  3:51 UTC|newest]

Thread overview: 32+ 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
2002-11-05  1:14           ` ps performance sucks (was Re: dcache_rcu [performance results]) Martin J. Bligh
2002-11-05  3:57             ` Werner Almesberger [this message]
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] <993103655@toto.iv>
2002-11-05 22:49 ` Peter Chubb
2002-11-06  0:06   ` Martin J. Bligh
2002-11-05 23:16     ` bert hubert
2002-11-06  0:57       ` Martin J. Bligh
2002-11-06  0:10         ` bert hubert
2002-11-06  1:23           ` Martin J. Bligh
2002-11-06  0:34             ` Alexander Viro
2002-11-07 12:06               ` Rusty Russell
2002-11-08  3:57                 ` William Lee Irwin III
2002-11-08  4:17                   ` Robert Love
2002-11-08  4:27                     ` Daniel Jacobowitz
2002-11-08  4:29                     ` William Lee Irwin III

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=20021105005745.E1407@almesberger.net \
    --to=wa@almesberger.net \
    --cc=jw@pegasys.ws \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.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