Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2003 20:52:58 +1100 (EST)
From:      Tim Robbins <tim@robbins.dropbear.id.au>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/49102: Resident set size calculation broken in 5.x
Message-ID:  <200303110952.h2B9qwNF083267@dilbert.robbins.dropbear.id.au>

next in thread | raw e-mail | index | archive | help

>Number:         49102
>Category:       kern
>Synopsis:       Resident set size calculation broken in 5.x
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 11 02:00:27 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Tim Robbins
>Release:        FreeBSD 5.0-RELEASE i386
>Organization:
The FreeBSD Project
>Environment:
System: FreeBSD 5.0-RELEASE i386

>Description:

Resident set size calculation is broken in 5.0 because the kernel stack
is counted towards the RSS even when a process has been swapped out.

In fill_kinfo_proc():
	kp->ki_rssize = vmspace_resident_count(vm); /*XXX*/
	if (p->p_sflag & PS_INMEM)
		kp->ki_rssize += UAREA_PAGES;
	FOREACH_THREAD_IN_PROC(p, td) /* XXXKSE: thread swapout check */
		kp->ki_rssize += KSTACK_PAGES;

Note the way KSTACK_PAGES is added on to the RSS even when threads are
are swapped out and the XXXKSE comment.

>How-To-Repeat:
Run some processes. Allocate enough memory so that some processes get
swapped out. Observe the RSS with 'top' and notice that it is not 0 for
swapped-out processes.
>Fix:
Not supplied.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303110952.h2B9qwNF083267>