mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Avi Kivity <avi@argo.co.il>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-kernel@vger.kernel.org, akpm@osdl.org, pj@sgi.com,
	saito.tadashi@soft.fujitsu.com, ak@suse.de
Subject: Re: [RFC][PATCH] ps command race fix take2 [1/4] list token
Date: Wed, 23 Aug 2006 06:12:05 -0600	[thread overview]
Message-ID: <m1irkjodm2.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <44EC2600.3070006@argo.co.il> (Avi Kivity's message of "Wed, 23 Aug 2006 12:55:12 +0300")

Avi Kivity <avi@argo.co.il> writes:

> ebiederm@xmission.com wrote:
>>
>> I almost removed the tasklist_lock from all read paths.  But as it
>> happens sending a signal to a process group is an atomic operation
>> with respect to fork so that path has to take the lock, or else
>> we get places where "kill -9 -pgrp" fails to kill every process in
>> the process group.  Which is even worse.
>>
>
> Can't that be fixed by adding a per-pgrp lock, and having both fork()/clone()
> and kill(-pgrp) take that lock?

Possibly.  The core issue though is that you still need to take a lock and
a big group can be as bad as just about anything else.  So all you do with
a per group lock is you change the odds of hitting the problem and make the
code a little more complicated.  For the small systems that most people have
I don't believe the tasklist_lock shows up at all.

If someone can find a data structure that I could use on two independent 
machines to create processes in the same process group and still allow atomic
kill behavior between those two machines I think we would have something that
could be made to scale very well.

Until the point where I see the truly better data structure or that people
who can actually see problems with the lock start to fix it.  I think
it is not to modify the data structure more than necessary, at runtime.

Modifying the global task list in the middle of readdir looks like it will
allow user space simply by running top with a fast update frequency to
cause problems for people on bigger machines.  Which is really the
wrong direction to go.

Eric

      reply	other threads:[~2006-08-23 12:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-22  8:39 KAMEZAWA Hiroyuki
2006-08-22 11:06 ` Andi Kleen
2006-08-22 11:23   ` KAMEZAWA Hiroyuki
2006-08-22 16:56 ` Eric W. Biederman
2006-08-22 22:22   ` KAMEZAWA Hiroyuki
2006-08-23  6:11     ` Eric W. Biederman
2006-08-23  8:33       ` KAMEZAWA Hiroyuki
2006-08-23 11:35         ` Eric W. Biederman
2006-08-23 12:46           ` KAMEZAWA Hiroyuki
2006-08-23  9:55       ` Avi Kivity
2006-08-23 12:12         ` Eric W. Biederman [this message]

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=m1irkjodm2.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=avi@argo.co.il \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    --cc=saito.tadashi@soft.fujitsu.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

Powered by JetHome