diff options
author | alc <alc@FreeBSD.org> | 2012-07-14 20:14:03 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2012-07-14 20:14:03 +0000 |
commit | 2044619bd43f4a327035bcdd208551210a000f2b (patch) | |
tree | 26712f1c721dde7c0b15c61e4b223b8a9fc77cbc /sys/vm/vm_contig.c | |
parent | 7f0c39adada7c3b6e6d6fee215bffe7ff7e886dd (diff) | |
download | FreeBSD-src-2044619bd43f4a327035bcdd208551210a000f2b.zip FreeBSD-src-2044619bd43f4a327035bcdd208551210a000f2b.tar.gz |
If vm_contig_grow_cache() is allowed to sleep, then invoke the vm_lowmem
handlers.
Diffstat (limited to 'sys/vm/vm_contig.c')
-rw-r--r-- | sys/vm/vm_contig.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index dfd46eb..79abd9c 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> +#include <sys/eventhandler.h> #include <sys/lock.h> #include <sys/mount.h> #include <sys/mutex.h> @@ -189,6 +190,20 @@ vm_contig_grow_cache(int tries, vm_paddr_t low, vm_paddr_t high) { int actl, actmax, inactl, inactmax; + if (tries > 0) { + /* + * Decrease registered cache sizes. The vm_lowmem handlers + * may acquire locks and/or sleep, so they can only be invoked + * when "tries" is greater than zero. + */ + EVENTHANDLER_INVOKE(vm_lowmem, 0); + + /* + * We do this explicitly after the caches have been drained + * above. + */ + uma_reclaim(); + } vm_page_lock_queues(); inactl = 0; inactmax = tries < 1 ? 0 : cnt.v_inactive_count; |