mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Albert D. Cahalan" <acahalan@cs.uml.edu>
To: hlein@progressive-comp.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Process vs. Threads
Date: Fri, 9 Mar 2001 04:48:25 -0500 (EST)	[thread overview]
Message-ID: <200103090948.f299mPS401032@saturn.cs.uml.edu> (raw)
In-Reply-To: <200103080017.TAA24960@mailer.progressive-comp.com> from "Hank Leininger" at Mar 07, 2001 07:17:17 PM

Hank Leininger writes:
> On 2001-03-07, "Albert D. Cahalan" <acahalan@cs.uml.edu> wrote:

>> Then for proper ps and top output, you need a reasonably efficient
>> way to grab all threads as a group. This could be as simple as
>> ensuring that /proc directory reads return related tasks together.
>> This works too:   /proc/42/threads/98 -> ../../98
>
> For this (but not for other "proper thread support" things
> you mention) would it be enough to have /proc publish some token
> that represent unique ->fs, ->mm, etc pointers?  (The kernel-space
> address of each would work, though that might be leaking too much
> info; the least userspace must treat such values as opaque canary
> tokens.)  This does not give you the most efficient "ps --threads 231"
> but it does let ps, top, (fuser?), etc group processes with the
> same vm, files, etc, no?

You've identified the problem yourself.

When I wrote the new ps, I made a rule for myself: the default
output would not require sorting of any kind. Output would be
produced as soon as possible. This is for performance, and to
help tolerate kernel bugs that cause a hang.

So far I've resisted using threads myself to work around the
hang problem.

It won't be "ps --threads 231". It will be one of the following
options if you do want to see individual threads: m -m -T -L
(the options are in use on Tru64, AIX, IRIX, Solaris, UnixWare...)

So think of a way to wrap tasks together, preferably in a
way that is impossible for a non-POSIX thread to escape from.
Taking a guess at it:

Have an inherited task-group-ID that gets set equal to the task ID
whenever a task breaks away from other tasks. This includes fork(),
execve(), and any unshare() call that might be implemented. Note that
this does not, and indeed _must_ not, enforce POSIX signal behavior.
(the leader of a new and empty group might be able to request the
POSIX behavior for his group, but it can not be the default)

  reply	other threads:[~2001-03-09  9:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-08  0:17 Hank Leininger
2001-03-09  9:48 ` Albert D. Cahalan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-03-06 17:01 Dan Kegel
2001-03-06 17:32 ` Ulf Carlsson
2001-03-06 16:28 Jorge David Ortiz Fuentes
2001-03-06 16:58 ` Gregory Maxwell
2001-03-07  9:01   ` Helge Hafting
2001-03-07 23:30     ` Albert D. Cahalan
2001-03-08  3:09     ` David Schwartz

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=200103090948.f299mPS401032@saturn.cs.uml.edu \
    --to=acahalan@cs.uml.edu \
    --cc=hlein@progressive-comp.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

all inboxes | Powered by JetHome®