mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Terje Eggestad <terje.eggestad@scali.no>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] processes with shared vm
Date: 17 Aug 2001 10:46:59 +0200	[thread overview]
Message-ID: <998038019.7627.21.camel@pc-16.office.scali.no> (raw)
In-Reply-To: <oupelqbw0z4.fsf@pigdrop.muc.suse.de>
In-Reply-To: <997973469.7632.10.camel@pc-16.suse.lists.linux.kernel>  <oupelqbw0z4.fsf@pigdrop.muc.suse.de>

Den 17 Aug 2001 10:21:35 +0200, skrev Andi Kleen:
> Terje Eggestad <terje.eggestad@scali.no> writes:
> 
> > I figured out that it's difficult to find out from /proc
> > which processes that share VM (created with clone(CLONE_VM)). 
> > 
> > made a patch that adds in /proc/<pid>/status a VmClones field that tells
> > how many proc that uses the same VM (mm_struct).  if there are clones I
> > add another field VmFirstClone with the pid of clone with the lowest
> > pid. 
> > 
> > Needed for things like gtop that adds mem usage of groups of proc, or
> > else they add up the usage of SIZE and RSS of threads.
> > 
> > The patch need to be applied to linux/fs/proc/array.c
> 
> The basic idea is a good one (I have written a similar thing in the past ;)
> Your implementation is O(n^2) however in ps, which is not acceptable.
> Much better is it to add a new field to mm_struct that gets initialised
> on first creation with the pid, and adding a place holder in pid hash
> if that process goes away and the mm_struct is still there to avoid pid
> reuse (or alternatively link task_structs to mms and always use the pid of
> the first entry)
> 
> -Andi

Thought of all that, yes ps will have O(n^2) BUT ONLY FOR CLONED PROCS.
How many cloned procs do you usually have????

Even if I agree that there should be a linked list of all the cloned
procs, it means major changes to the data structs in the kernel.

With the number of threaded programs out there, this is "good enough".

TJ


-- 
_________________________________________________________________________

Terje Eggestad                  terje.eggestad@scali.no
Scali Scalable Linux Systems    http://www.scali.com

Olaf Helsets Vei 6              tel:    +47 22 62 89 61 (OFFICE)
P.O.Box 70 Bogerud                      +47 975 31 574  (MOBILE)
N-0621 Oslo                     fax:    +47 22 62 89 51
NORWAY            
_________________________________________________________________________


  parent reply	other threads:[~2001-08-17  8:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <997973469.7632.10.camel@pc-16.suse.lists.linux.kernel>
2001-08-17  8:21 ` Andi Kleen
2001-08-17 14:26   ` Dave McCracken
2001-08-17 20:55     ` Andi Kleen
2001-08-17 21:15     ` Dave McCracken
2001-08-18 13:29       ` Terje Eggestad
2001-08-31 23:53       ` Mike Touloumtzis
2001-08-17  8:31 ` Robert Love
2001-08-17  8:46 ` Terje Eggestad [this message]
     [not found] <Pine.LNX.4.10.10108171428450.21522-100000@coffee.psychology.mcmaster.ca>
     [not found] ` <Pine.LNX.4.10.10108171428450.21522-100000@coffee.psychology.mcm aster.ca>
2001-08-17 14:39   ` Dave McCracken
2001-08-17  7:50 Terje Eggestad
2001-08-17  7:56 ` Robert Love
2001-08-17  8:08   ` Robert Love
2001-08-17  8:04 ` Terje Eggestad
2001-08-17  8:15   ` Terje Eggestad
2001-08-17 12:26     ` michael
2001-08-18 14:15       ` Terje Eggestad
2001-08-19  6:24         ` Albert D. Cahalan
2001-08-19 12:23           ` Terje Eggestad
2001-08-19 23:25             ` Albert D. 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=998038019.7627.21.camel@pc-16.office.scali.no \
    --to=terje.eggestad@scali.no \
    --cc=ak@suse.de \
    --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®