Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jul 1999 15:53:06 -0700
From:      David Greenman <dg@root.com>
To:        Doug <Doug@gorean.org>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: PMAP_SHPGPERPROC: related to pagedaemon? 
Message-ID:  <199907232253.PAA25976@implode.root.com>
In-Reply-To: Your message of "Fri, 23 Jul 1999 15:15:31 PDT." <Pine.BSF.4.05.9907231446490.28191-100000@dt011n65.san.rr.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
   PMAP_SHPGPERPROC controls the default number of struct pv_entry that the
system allocates kernel virtual memory for. A pv_entry is a data structure that
tracks physical to virtual page translations. For example, suppose the system
wants to page out a specific page of memory. It needs to know all the
processes that have that mapped so that it can efficiently remove it from all
of the processes page tables. For pages that are usually not shared between
processes (like stack pages, for example), then there is only one pv_entry.
For pages that are shared, then there is one pv_entry for each mapping of it,
and thus the number of pv_entries can become quite large - perhaps hundreds or
thousands of times the total number of pages in the system, depending on how
much sharing is going on. Due to various complications in the VM system, the
kernel wants the virtual memory for the pv_entry structs preallocated...so
setting this too high will waste kernel virtual memory to the point where no
more can be allocated (causing the system to crash, usually at bootup time),
and too few can lead to running out of them if there is a large amount of page
sharing.
   I don't know what's going on with your system, but it's definately unusual
to hit this limit under normal circumstances.

-DG

David Greenman
Co-founder/Principal Architect, The FreeBSD Project - http://www.freebsd.org
Creator of high-performance Internet servers - http://www.terasolutions.com


>On Fri, 23 Jul 1999, Doug wrote:
>
>> 	Using two -current machines, both dated 7/16 I got the following
>> message in my log file, which I think explains the weird spontaneous 
>> reboots I've been getting.
>> 
>> /kernel: pmap_collect: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC
>
>	In my efforts to track this down today I have been monitoring the
>logs like a hawk. When this message started appearing again (now with the
>PMAP_SHPGPERPROC set to 300 in the kernel config file) I took a look at
>the system and what it was doing. I was very disturbed to find that
>according to 'ps' pagedaemon was eating up 67% of the cpu. This is a
>dual-PIII 500 machine, and I'm not sure if 'ps' is reporting 67% of one
>CPU (my first guess) or 67% of both. 
>
>	I captured the output of 'ps -aulx' to a file, here is the bit
>about pagedaemon, line wrapped for readability.
>
>USER   PID %CPU %MEM   VSZ  RSS  TT  STAT STARTED   TIME    COMMAND
>root    2 66.7  0.0     0    0  ??  RL   10:12AM   5:15.52 (pagedaemon)
>
>UID  PPID CPU PRI NI   WCHAN
>0     0   265 -18  0    -  
>
>	There were no other unusual symptoms, except that the miva (CGI)
>processes that the box is supposed to be processing were backed way up.
>Normally they complete very quickly (roughly 3 per second) with little or
>no backlog. 
>
>	I've increased the PMAP_SHPGPERPROC setting in the kernel config
>file to 400 and recompiled just in case the system panics again, however
>with it set to 300 as it is now it recovers ok. Once again, any thoughts
>or suggestions welcome.
>
>Thanks,
>
>Doug
>
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-current" in the body of the message


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




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