From 04349514e926392ffa928ba60b0d8ae92a03ad2a Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 21 May 2008 05:15:27 +0000 Subject: We can call ia64_flush_dirty() when the corresponding process is locked or not. As such, use PROC_LOCKED() to determine which case it is and lock the process when not. --- sys/ia64/ia64/machdep.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys/ia64') diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 42b1394..87dc53d 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -1106,7 +1106,7 @@ ia64_flush_dirty(struct thread *td, struct _special *r) struct iovec iov; struct uio uio; uint64_t bspst, kstk, rnat; - int error; + int error, locked; if (r->ndirty == 0) return (0); @@ -1127,7 +1127,9 @@ ia64_flush_dirty(struct thread *td, struct _special *r) r->rnat = (bspst > kstk && (bspst & 0x1ffL) < (kstk & 0x1ffL)) ? *(uint64_t*)(kstk | 0x1f8L) : rnat; } else { - PHOLD(td->td_proc); + locked = PROC_LOCKED(td->td_proc); + if (!locked) + PHOLD(td->td_proc); iov.iov_base = (void*)(uintptr_t)kstk; iov.iov_len = r->ndirty; uio.uio_iov = &iov; @@ -1145,7 +1147,8 @@ ia64_flush_dirty(struct thread *td, struct _special *r) */ if (uio.uio_resid != 0 && error == 0) error = ENOSPC; - PRELE(td->td_proc); + if (!locked) + PRELE(td->td_proc); } r->bspstore += r->ndirty; -- cgit v1.1