cvs commit: src/sys/vm vm_object.c vm_pageout.c
Pawel Jakub Dawidek
pjd at FreeBSD.org
Fri Aug 12 20:01:50 GMT 2005
On Wed, Aug 10, 2005 at 12:17:36AM +0000, Tor Egge wrote:
+> tegge 2005-08-10 00:17:36 UTC
+>
+> FreeBSD src repository
+>
+> Modified files:
+> sys/vm vm_object.c vm_pageout.c
+> Log:
+> Don't allow pagedaemon to skip pages while scanning PQ_ACTIVE or PQ_INACTIVE
+> due to the vm object being locked.
+>
+> When a process writes large amounts of data to a file, the vm object associated
+> with that file can contain most of the physical pages on the machine. If the
+> process is preempted while holding the lock on the vm object, pagedaemon would
+> be able to move very few pages from PQ_INACTIVE to PQ_CACHE or from PQ_ACTIVE
+> to PQ_INACTIVE, resulting in unlimited cleaning of dirty pages belonging to
+> other vm objects.
+>
+> Temporarily unlock the page queues lock while locking vm objects to avoid lock
+> order violation. Detect and handle relevant page queue changes.
+>
+> This change depends on both the lock portion of struct vm_object and normal
+> struct vm_page being type stable.
I'm not sure this fix the problem completely.
I can still reproduce it with GELI, which is allocating in-kernel memory
for every write request:
# geli onetime -s 4096 ad0a
# newfs /dev/ad0a.eli
# mount /dev/ad0a.eli /mnt
# dd if=/dev/zero of=/mnt/test bs=1m
In top(1) output I see how memory goes down to few hundred kilo bytes
and after some time I get:
GEOM_ELI: Cannot allocate 136192 bytes.
GEOM_ELI: g_eli_crypto_run() failed (error=12). ad0a.eli[WRITE(offset=4619829248, length=131072)]
GEOM_ELI: Cannot allocate 136192 bytes.
GEOM_ELI: g_eli_crypto_run() failed (error=12). ad0a.eli[WRITE(offset=4620746752, length=131072)]
[...]
There is no memory leak in GELI:
# vmstat -m | grep eli
eli data 2 1K - 5309 32,256,512,1024
It is much better than it was before your fix, but I think the problem
still exist, it's only harder to run into.
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd at FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20050812/7beae260/attachment.bin
More information about the cvs-src
mailing list