From 1a42d14a80482de31e79be33adbffba67fecac3b Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 30 Aug 2013 20:12:23 +0000 Subject: [PATCH] Give the page allocations initiated by the swap-backed md(4) a higher priority. If the write is requested by a system daemon, sleeping there would starve resources and cause deadlock. Reported and tested by: pho Sponsored by: The FreeBSD Foundation --- sys/dev/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index cad97659a752..f0d1aec0d917 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -826,7 +826,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp) vm_object_pip_add(sc->object, 1); for (i = bp->bio_offset / PAGE_SIZE; i <= lastp; i++) { len = ((i == lastp) ? lastend : PAGE_SIZE) - offs; - m = vm_page_grab(sc->object, i, VM_ALLOC_NORMAL); + m = vm_page_grab(sc->object, i, VM_ALLOC_SYSTEM); if (bp->bio_cmd == BIO_READ) { if (m->valid == VM_PAGE_BITS_ALL) rv = VM_PAGER_OK;