Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Fix for KMEM_GUARD; do not use it from interrupt co...
details: https://anonhg.NetBSD.org/src/rev/cc669f3e3412
branches: trunk
changeset: 773319:cc669f3e3412
user: rmind <rmind%NetBSD.org@localhost>
date: Mon Jan 30 21:05:40 2012 +0000
description:
Fix for KMEM_GUARD; do not use it from interrupt context.
diffstat:
sys/kern/subr_kmem.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (38 lines):
diff -r 7b86b1c1da9c -r cc669f3e3412 sys/kern/subr_kmem.c
--- a/sys/kern/subr_kmem.c Mon Jan 30 20:51:50 2012 +0000
+++ b/sys/kern/subr_kmem.c Mon Jan 30 21:05:40 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_kmem.c,v 1.40 2012/01/28 23:09:06 rmind Exp $ */
+/* $NetBSD: subr_kmem.c,v 1.41 2012/01/30 21:05:40 rmind Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.40 2012/01/28 23:09:06 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.41 2012/01/30 21:05:40 rmind Exp $");
#include <sys/param.h>
#include <sys/callback.h>
@@ -170,7 +170,8 @@
KASSERT(size > 0);
#ifdef KMEM_GUARD
- if (size <= kmem_guard_size) {
+ if (size <= kmem_guard_size &&
+ __builtin_return_address(0) == &kmem_alloc) {
return uvm_kmguard_alloc(&kmem_guard, size,
(kmflags & KM_SLEEP) != 0);
}
@@ -219,7 +220,8 @@
KASSERT(size > 0);
#ifdef KMEM_GUARD
- if (size <= kmem_guard_size) {
+ if (size <= kmem_guard_size &&
+ __builtin_return_address(0) == &kmem_free) {
uvm_kmguard_free(&kmem_guard, size, p);
return;
}
Home |
Main Index |
Thread Index |
Old Index