Date: Wed, 19 Mar 2014 01:13:42 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263328 - in head/sys: dev/md vm Message-ID: <201403190113.s2J1Dgla051458@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: attilio Date: Wed Mar 19 01:13:42 2014 New Revision: 263328 URL: http://svnweb.freebsd.org/changeset/base/263328 Log: vm_page_grab() and vm_pager_get_pages() can drop the vm_object lock, then threads can sleep on the pip condition. Avoid to deadlock such threads by correctly awakening the sleeping ones after the pip is finished. swapoff side of the bug can likely result in shutdown deadlocks. Sponsored by: EMC / Isilon Storage Division Reported by: pho, pluknet Tested by: pho Modified: head/sys/dev/md/md.c head/sys/vm/swap_pager.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Mar 19 00:55:12 2014 (r263327) +++ head/sys/dev/md/md.c Wed Mar 19 01:13:42 2014 (r263328) @@ -903,7 +903,7 @@ mdstart_swap(struct md_s *sc, struct bio offs = 0; ma_offs += len; } - vm_object_pip_subtract(sc->object, 1); + vm_object_pip_wakeup(sc->object); VM_OBJECT_WUNLOCK(sc->object); return (rv != VM_PAGER_ERROR ? 0 : ENOSPC); } Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Mar 19 00:55:12 2014 (r263327) +++ head/sys/vm/swap_pager.c Wed Mar 19 01:13:42 2014 (r263328) @@ -1713,7 +1713,7 @@ swp_pager_force_pagein(vm_object_t objec vm_object_pip_add(object, 1); m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); if (m->valid == VM_PAGE_BITS_ALL) { - vm_object_pip_subtract(object, 1); + vm_object_pip_wakeup(object); vm_page_dirty(m); vm_page_lock(m); vm_page_activate(m); @@ -1725,7 +1725,7 @@ swp_pager_force_pagein(vm_object_t objec if (swap_pager_getpages(object, &m, 1, 0) != VM_PAGER_OK) panic("swap_pager_force_pagein: read from swap failed");/*XXX*/ - vm_object_pip_subtract(object, 1); + vm_object_pip_wakeup(object); vm_page_dirty(m); vm_page_lock(m); vm_page_deactivate(m);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403190113.s2J1Dgla051458>