Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm/pmap Use IPL_NONE for pserialized lock. Assert slee...
details: https://anonhg.NetBSD.org/src/rev/91c67359be81
branches: trunk
changeset: 343496:91c67359be81
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Feb 07 18:41:25 2016 +0000
description:
Use IPL_NONE for pserialized lock. Assert sleepable. (OOPS.)
diffstat:
sys/uvm/pmap/pmap_pvt.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diffs (47 lines):
diff -r b5ef24839bb4 -r 91c67359be81 sys/uvm/pmap/pmap_pvt.c
--- a/sys/uvm/pmap/pmap_pvt.c Sun Feb 07 14:31:21 2016 +0000
+++ b/sys/uvm/pmap/pmap_pvt.c Sun Feb 07 18:41:25 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_pvt.c,v 1.2 2015/11/11 08:22:36 skrll Exp $ */
+/* $NetBSD: pmap_pvt.c,v 1.3 2016/02/07 18:41:25 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pmap_pvt.c,v 1.2 2015/11/11 08:22:36 skrll Exp $");
+__RCSID("$NetBSD: pmap_pvt.c,v 1.3 2016/02/07 18:41:25 riastradh Exp $");
#include <sys/kmem.h>
#include <sys/pserialize.h>
@@ -66,7 +66,7 @@
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;
}
@@ -80,6 +80,9 @@
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);
@@ -102,6 +105,9 @@
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;
Home |
Main Index |
Thread Index |
Old Index