changeset 4076:b8174b986feb

6547651 fix for 6524333 badly impact performance when writing to a vdisk
author achartre
date Thu, 19 Apr 2007 21:15:35 -0700
parents c5a5424beca2
children 0b7e19932b34
files usr/src/uts/sun4v/io/vds.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/sun4v/io/vds.c	Thu Apr 19 18:27:07 2007 -0700
+++ b/usr/src/uts/sun4v/io/vds.c	Thu Apr 19 21:15:35 2007 -0700
@@ -85,6 +85,9 @@
 /* Flags for opening/closing backing devices via LDI */
 #define	VD_OPEN_FLAGS		(FEXCL | FREAD | FWRITE)
 
+/* Flags for writing to a vdisk which is a file */
+#define	VD_FILE_WRITE_FLAGS	SM_ASYNC
+
 /*
  * By Solaris convention, slice/partition 2 represents the entire disk;
  * unfortunately, this convention does not appear to be codified.
@@ -369,6 +372,8 @@
 
 static int	vd_open_flags = VD_OPEN_FLAGS;
 
+static uint_t	vd_file_write_flags = VD_FILE_WRITE_FLAGS;
+
 /*
  * Supported protocol version pairs, from highest (newest) to lowest (oldest)
  *
@@ -459,7 +464,8 @@
 	}
 
 	srw = (operation == VD_OP_BREAD)? S_READ : S_WRITE;
-	smflags = (operation == VD_OP_BREAD)? 0 : SM_WRITE;
+	smflags = (operation == VD_OP_BREAD)? 0 :
+	    (SM_WRITE | vd_file_write_flags);
 	n = len;
 
 	do {