diff options
author | jake <jake@FreeBSD.org> | 2001-01-21 19:25:07 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-01-21 19:25:07 +0000 |
commit | 937122ae6dc02a639d13dd06132201548bd7364f (patch) | |
tree | 75b59a2832d9f622680ddf91bb405ee9b1f761d4 /sys/dev/vinum | |
parent | d326c51b74ea24afabc190774a1b7721c3e6d1e8 (diff) | |
download | FreeBSD-src-937122ae6dc02a639d13dd06132201548bd7364f.zip FreeBSD-src-937122ae6dc02a639d13dd06132201548bd7364f.tar.gz |
Make intr_nesting_level per-process, rather than per-cpu. Setup
interrupt threads to run with it always >= 1, so that malloc can
detect M_WAITOK from "interrupt" context. This is also necessary
in order to context switch from sched_ithd() directly.
Reviewed By: peter
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r-- | sys/dev/vinum/vinumhdr.h | 2 | ||||
-rw-r--r-- | sys/dev/vinum/vinummemory.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/vinum/vinumhdr.h b/sys/dev/vinum/vinumhdr.h index 8a5f70e..2b7d290 100644 --- a/sys/dev/vinum/vinumhdr.h +++ b/sys/dev/vinum/vinumhdr.h @@ -87,7 +87,7 @@ void FFree (void *mem, char *, int); #define LOCKDRIVE(d) lockdrive (d, __FILE__, __LINE__) #else #define Malloc(x) malloc((x), M_DEVBUF, \ - PCPU_GET(intr_nesting_level) == 0? M_WAITOK: M_NOWAIT) + curproc->p_intr_nesting_level == 0? M_WAITOK: M_NOWAIT) #define Free(x) free((x), M_DEVBUF) #define LOCKDRIVE(d) lockdrive (d) #endif diff --git a/sys/dev/vinum/vinummemory.c b/sys/dev/vinum/vinummemory.c index e28f7ae..58eea67 100644 --- a/sys/dev/vinum/vinummemory.c +++ b/sys/dev/vinum/vinummemory.c @@ -151,7 +151,7 @@ MMalloc(int size, char *file, int line) return 0; /* can't continue */ } /* Wait for malloc if we can */ - result = malloc(size, M_DEVBUF, PCPU_GET(intr_nesting_level) == 0 ? M_WAITOK : M_NOWAIT); + result = malloc(size, M_DEVBUF, curproc->p_intr_nesting_level == 0 ? M_WAITOK : M_NOWAIT); if (result == NULL) log(LOG_ERR, "vinum: can't allocate %d bytes from %s:%d\n", size, file, line); else { |