changeset 10715:b905b416f22e

6831548 sndr is causing ufs to hang
author Thomas Atkins <Thomas.Atkins@Sun.COM>
date Mon, 05 Oct 2009 12:25:17 -0400
parents 4338c01ecef3
children b17df522be57
files usr/src/uts/common/avs/ns/rdc/rdc_clnt.c usr/src/uts/common/avs/ns/rdc/rdc_io.h usr/src/uts/common/avs/ns/rdc/rdc_svc.c
diffstat 3 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/avs/ns/rdc/rdc_clnt.c	Mon Oct 05 12:20:40 2009 -0400
+++ b/usr/src/uts/common/avs/ns/rdc/rdc_clnt.c	Mon Oct 05 12:25:17 2009 -0400
@@ -2180,6 +2180,7 @@
 		 * another set that has not resumed
 		 */
 		krdc->remote_index = rdc_net_state(krdc->index, CCIO_SLAVE);
+		DTRACE_PROBE1(remote_index_negative, int, krdc->remote_index);
 
 	}
 
@@ -2356,6 +2357,7 @@
 				rdc_ooreply++;
 			}
 #endif
+			DTRACE_PROBE1(pendvec_return, int, vecp->seq);
 
 			if (group->asyncstall) {
 				cv_broadcast(&group->asyncqcv);
--- a/usr/src/uts/common/avs/ns/rdc/rdc_io.h	Mon Oct 05 12:20:40 2009 -0400
+++ b/usr/src/uts/common/avs/ns/rdc/rdc_io.h	Mon Oct 05 12:25:17 2009 -0400
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -643,10 +643,19 @@
 /*
  * macro used to determine if the incomming sq, with sequence
  * value x, should be placed before the sq with sequence value y.
- * This has to account for integer wrap.
+ * This has to account for integer wrap. We account for integer
+ * wrap by checking if the difference between x and y is within
+ * half of the maximum integer value (RDC_MAXINT) or not.
  */
-#define	RDC_INFRONT(x, y) (((x < y) && ((y - x) < 1000)) ? 1 : \
-	((x > y) && ((x - y) > 1000)) ? 1 : 0)
+
+#define	RDC_BITSPERBYTE 8
+#define	RDC_BITS(type)	(RDC_BITSPERBYTE * (long)sizeof (type))
+#define	RDC_HIBITI	((unsigned)1 << (RDC_BITS(int) - 1))
+#define	RDC_MAXINT	((int)(~RDC_HIBITI))
+#define	RDC_RANGE	((RDC_MAXINT / 2) -1)
+
+#define	RDC_INFRONT(x, y) (((x < y) && ((y - x) < RDC_RANGE)) ? 1 : \
+	((x > y) && ((x - y) > RDC_RANGE)) ? 1 : 0)
 
 
 
--- a/usr/src/uts/common/avs/ns/rdc/rdc_svc.c	Mon Oct 05 12:20:40 2009 -0400
+++ b/usr/src/uts/common/avs/ns/rdc/rdc_svc.c	Mon Oct 05 12:25:17 2009 -0400
@@ -1040,6 +1040,8 @@
 					    RDC_MAXPENDQ, group->seqack,
 					    diskio.seq, maxseq, group->seq);
 #endif
+				DTRACE_PROBE2(qsize_exceeded, int, diskio.seq,
+				    int, maxseq);
 					if (!(rdc_get_vflags(urdc) &
 					    RDC_VOL_FAILED)) {
 						rdc_many_enter(krdc);
@@ -2564,6 +2566,7 @@
 	pvec[pc].alen = dset->fbalen;
 	pvec[pc].pindex = pindex;
 	*pendcnt = pc + 1;
+	DTRACE_PROBE1(pvec_reply, int, seq);
 }
 
 /*