public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: kamezawa.hiroyu@jp.fujitsu.com, linux-kernel@vger.kernel.org,
	ebiederm@xmission.com
Subject: Re: [RFC] ps command race fix
Date: Mon, 24 Jul 2006 18:48:47 -0700	[thread overview]
Message-ID: <20060724184847.3ff6be7d.pj@sgi.com> (raw)
In-Reply-To: <20060724182000.2ab0364a.akpm@osdl.org>

Another possibility (perhaps a really stupid idea ;) would be to
snapshot the list of pids on the open, and let the readdir() just
access that fixed array.

The kernel/cpuset.c cpuset_tasks_open() routine that displays the
pids of tasks in a cpuset (the per-cpuset 'tasks' file) does this.

Then the seek and read and such semantics are nice and stable and
simple.

Throw out the snapshot on the last close.

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

  reply	other threads:[~2006-07-25  1:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-14 11:39 [RFC] ps command race fix KAMEZAWA Hiroyuki
2006-07-25  1:20 ` Andrew Morton
2006-07-25  1:48   ` Paul Jackson [this message]
2006-07-25  2:00     ` Andrew Morton
2006-07-25  2:08     ` KAMEZAWA Hiroyuki
2006-07-25  2:33       ` Andrew Morton
2006-07-25  2:50         ` KAMEZAWA Hiroyuki
2006-07-25  3:16           ` KAMEZAWA Hiroyuki
2006-08-13 16:29             ` Eric W. Biederman
2006-08-13 17:34               ` Andrew Morton
2006-08-13 19:00                 ` Eric W. Biederman
2006-08-13 19:12                   ` Paul Jackson
2006-08-16  1:23                     ` KAMEZAWA Hiroyuki
2006-08-17  4:59                       ` Eric W. Biederman
2006-08-17  6:32                         ` KAMEZAWA Hiroyuki
2006-08-17 13:39                           ` Eric W. Biederman
2006-08-17 18:16                             ` Jean Delvare
2006-08-18  0:21                             ` KAMEZAWA Hiroyuki
2006-08-18  3:53                           ` Eric W. Biederman
2006-08-13 20:08               ` Albert Cahalan
2006-08-16  2:20                 ` Kyle Moffett
2006-07-25  7:22         ` Paul Jackson
2006-07-25  1:53   ` KAMEZAWA Hiroyuki
2006-07-25  2:06     ` Andrew Morton
2006-07-25  2:34       ` KAMEZAWA Hiroyuki
2006-07-25  6:09   ` Eric W. Biederman
  -- strict thread matches above, loose matches on Subject: below --
2006-07-25  6:47 Albert Cahalan

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=20060724184847.3ff6be7d.pj@sgi.com \
    --to=pj@sgi.com \
    --cc=akpm@osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --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