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, "Albert Cahalan" <acahalan@gmail.com>
Subject: Re: [RFC] ps command race fix
Date: Tue, 25 Jul 2006 00:22:44 -0700 [thread overview]
Message-ID: <20060725002244.af4d6e8d.pj@sgi.com> (raw)
In-Reply-To: <20060724193318.d57983c1.akpm@osdl.org>
Andrew wrote:
> We cannot do a single kmalloc() like cpuset does.
Ok ...
Well, since you're so impressed with the studliness of that idea
<grin>, how about this:
Add a 'false link' to the .next task list.
Each diropen on /proc and each open on a cpuset 'tasks' file would
add one such 'false link' to the task list, representing that file
descriptors current seek offset in the task list.
A 'false link' would be a task_struct that was almost entirely unused,
except to mark the offset in the task list of a file descriptor open
on it (for /proc or cpuset 'tasks' files.)
The 'normal' do_each_thread/while_each_thread and related macros would
silently skip over these false links.
The /proc and cpuset 'tasks' code would use special macros that could
see the false link representing its current seek offset, and be able
to implement read and seek operations relative to that position.
Remove this 'false link' on the final close of the file descriptor
holding it.
This reduces the memory cost of an open on /proc or a 'tasks' file to
the size of a single 'false link' task_struct.
It -would- add another test and jump to the critical do_each_thread and
while_each_thread macros, to skip over 'false links'.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.925.600.0401
next prev parent reply other threads:[~2006-07-25 7:22 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
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 [this message]
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=20060725002244.af4d6e8d.pj@sgi.com \
--to=pj@sgi.com \
--cc=acahalan@gmail.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