Module Name: src
Committed By: snj
Date: Fri Feb 12 10:55:35 UTC 2016
Modified Files:
src/sys/arch/x86/x86 [netbsd-7]: pmap.c
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1115):
sys/arch/x86/x86/pmap.c: patch
Use IPL_NONE for pserialized lock. Assert sleepable. (OOPS.)
To generate a diff of this commit:
cvs rdiff -u -r1.183.2.2 -r1.183.2.3 src/sys/arch/x86/x86/pmap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.183.2.2 src/sys/arch/x86/x86/pmap.c:1.183.2.3
--- src/sys/arch/x86/x86/pmap.c:1.183.2.2 Thu Apr 23 07:31:16 2015
+++ src/sys/arch/x86/x86/pmap.c Fri Feb 12 10:55:35 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.183.2.2 2015/04/23 07:31:16 snj Exp $ */
+/* $NetBSD: pmap.c,v 1.183.2.3 2016/02/12 10:55:35 snj Exp $ */
/*-
* Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.183.2.2 2015/04/23 07:31:16 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.183.2.3 2016/02/12 10:55:35 snj Exp $");
#include "opt_user_ldt.h"
#include "opt_lockdebug.h"
@@ -490,7 +490,7 @@ void
pmap_pv_init(void)
{
- mutex_init(&pv_unmanaged.lock, MUTEX_DEFAULT, IPL_VM);
+ mutex_init(&pv_unmanaged.lock, MUTEX_DEFAULT, IPL_NONE);
pv_unmanaged.psz = pserialize_create();
pv_unmanaged.list = NULL;
}
@@ -504,6 +504,9 @@ pmap_pv_track(paddr_t start, psize_t siz
KASSERT(start == trunc_page(start));
KASSERT(size == trunc_page(size));
+ /* We may sleep for allocation. */
+ ASSERT_SLEEPABLE();
+
npages = size >> PAGE_SHIFT;
pvt = kmem_zalloc(offsetof(struct pv_track, pvt_pages[npages]),
KM_SLEEP);
@@ -526,6 +529,9 @@ pmap_pv_untrack(paddr_t start, psize_t s
KASSERT(start == trunc_page(start));
KASSERT(size == trunc_page(size));
+ /* We may sleep for pserialize_perform. */
+ ASSERT_SLEEPABLE();
+
mutex_enter(&pv_unmanaged.lock);
for (pvtp = &pv_unmanaged.list;
(pvt = *pvtp) != NULL;