From owner-freebsd-hackers Wed Aug 22 11:53: 1 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from heechee.tobez.org (254.adsl0.ryv.worldonline.dk [213.237.10.254]) by hub.freebsd.org (Postfix) with ESMTP id DD22E37B408 for ; Wed, 22 Aug 2001 11:52:41 -0700 (PDT) (envelope-from tobez@tobez.org) Received: by heechee.tobez.org (Postfix, from userid 1001) id 3E693541D; Wed, 22 Aug 2001 20:52:38 +0200 (CEST) Date: Wed, 22 Aug 2001 20:52:38 +0200 From: Anton Berezin To: Alfred Perlstein Cc: hackers@freebsd.org Subject: Re: VM statistics per process? Message-ID: <20010822205238.A15301@heechee.tobez.org> References: <20010822173753.A11906@heechee.tobez.org> <20010822123926.P81307@elvis.mu.org> <20010822194744.A14143@heechee.tobez.org> <20010822132420.Q81307@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010822132420.Q81307@elvis.mu.org>; from bright@mu.org on Wed, Aug 22, 2001 at 01:24:20PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 22, 2001 at 01:24:20PM -0500, Alfred Perlstein wrote: > * Anton Berezin [010822 12:47] wrote: > > On Wed, Aug 22, 2001 at 12:39:26PM -0500, Alfred Perlstein wrote: > > > getrusage(2) > > That's not quite it - it does not provide the statistics of what > > number of pages is currently on PQ_ACTIVE/PQ_INACTIVE queues, and I > > think I need that number. > Why do you need this? I am trying to measure the quality of different malloc(3) implementations with regard to the active set size. I need the PQ_ACTIVE number on a theory that, given a light system load and a lots of RAM, a run of a process with a good malloc implementation will have less active pages than the identical run of the same process with a bad malloc implementation. Consequently, such `good' (by this criterion) malloc(3) will be also good, or even better, in case of a heavy system load. I know that phkmalloc is supposed to be good in this regard, but I am trying to see whether there are better ones, especially for specific programs that are known to be rather harsh memory users (perl). > > I was thinking of copying pmap_pid_dump() from sys/i386/i386/pmap.c > > and counting the pages belonging to different queues. Is this a > > feasible approach? > It may be, I'm not sure how the structures are orginized, it may be an > expensive operation to calculate this, but I'm not sure. I am sure it is not an expensive operation to *calculate*, since pmap_pid_dump() deals with vm_page_t structures which have a queue field - just what I need. What I worry about is that the actual *traversal* might be expensive. Worse, pmap_pid_dump() is undocumented, and I don't understand what for(i=0;i<1024;i++) for(j=0;j<1024;j++) {} loop there is supposed to do... :-( I'd appreciate if someone would explain this to me. =Anton. -- May the tuna salad be with you. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message