Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jul 2001 00:39:29 +0200
From:      Thomas Moestl <tmm@FreeBSD.org>
To:        freebsd-stable@FreeBSD.org, freebsd-smp@FreeBSD.org
Cc:        Ian Dowse <iedowse@FreeBSD.org>
Subject:   Please test: -stable SMP locking fix
Message-ID:  <20010727003929.B73365@crow.dom2ip.de>

next in thread | raw e-mail | index | archive | help

--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

I have attached a patch that should fix some panics (caused by
sleeping with a lock held) and lock-order reversals on -stable SMP
systems. These usually only seem to occur when using NFS.
I'd like to commit this fix before 4.4 is released (if I can make
it). Due to locking changes, this will need to be solved differently
on -current, so it will need to be directly committed to -stable.

Therefore, to anybody who uses stable on an SMP box (and dares ;):
please, please test this, and report back any problems! If you do,
please drop me a private mail so that I get an idea about the test
coverage that it got.

The risk should be relatively low (this removes a lock/unlock pair,
but all relevant code should also be protected by the mp_lock).
On UP machines, this patch does not change anything at all.

	- thomas

--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="vinval.diff"

Index: vfs_subr.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.249.2.9
diff -u -r1.249.2.9 vfs_subr.c
--- vfs_subr.c	2001/06/26 04:20:08	1.249.2.9
+++ vfs_subr.c	2001/07/25 21:35:01
@@ -730,12 +730,10 @@
 	/*
 	 * Destroy the copy in the VM cache, too.
 	 */
-	simple_lock(&vp->v_interlock);
 	if (VOP_GETVOBJECT(vp, &object) == 0) {
 		vm_object_page_remove(object, 0, 0,
 			(flags & V_SAVE) ? TRUE : FALSE);
 	}
-	simple_unlock(&vp->v_interlock);
 
 	if (!TAILQ_EMPTY(&vp->v_dirtyblkhd) || !TAILQ_EMPTY(&vp->v_cleanblkhd))
 		panic("vinvalbuf: flush failed");

--lrZ03NoBR/3+SXJZ--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010727003929.B73365>