Cygwin Filesystem Performance degradation 1.7.5 vs 1.7.7, and methods for improving performance

Yoni Londner yonihola2@gmail.com
Wed Oct 13 15:54:00 GMT 2010


Hi,

Patch for reusing FILE_NETWORK_OPEN_INFORMATION in 
fhandler_base::fstat_by_handle on stat.

Yoni

Index: fhandler_disk_file.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_disk_file.cc,v
retrieving revision 1.345
diff -u -p -r1.345 fhandler_disk_file.cc
--- fhandler_disk_file.cc	7 Oct 2010 14:03:26 -0000	1.345
+++ fhandler_disk_file.cc	13 Oct 2010 15:12:15 -0000
@@ -346,7 +346,7 @@ fhandler_base::fstat_by_handle (struct _

    /* If the file has been opened for other purposes than stat, we 
can't rely
       on the information stored in pc.fnoi.  So we overwrite them here. */
-  if (get_io_handle ())
+  if (get_io_handle () && !(pc.opts & PC_STAT))
      {
        PFILE_NETWORK_OPEN_INFORMATION pfnoi = pc.fnoi ();
        status = NtQueryInformationFile (h, &io, pfnoi, sizeof *pfnoi,
Index: path.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.h,v
retrieving revision 1.152
diff -u -p -r1.152 path.h
--- path.h	7 Oct 2010 14:03:26 -0000	1.152
+++ path.h	13 Oct 2010 15:12:18 -0000
@@ -60,7 +60,8 @@ enum pathconv_arg
    PC_POSIX		= 0x0080,
    PC_NOWARN		= 0x0100,
    PC_KEEP_HANDLE	= 0x00400000,
-  PC_NO_ACCESS_CHECK	= 0x00800000
+  PC_NO_ACCESS_CHECK	= 0x00800000,
+  PC_STAT       	= 0x01000000,
  };

  #define PC_NONULLEMPTY -1
Index: syscalls.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/syscalls.cc,v
retrieving revision 1.570
diff -u -p -r1.570 syscalls.cc
--- syscalls.cc	28 Sep 2010 07:54:52 -0000	1.570
+++ syscalls.cc	13 Oct 2010 15:12:20 -0000
@@ -1619,7 +1619,8 @@ extern "C" int
  stat64 (const char *name, struct __stat64 *buf)
  {
    syscall_printf ("entering");
-  path_conv pc (name, PC_SYM_FOLLOW | PC_POSIX | PC_KEEP_HANDLE, 
stat_suffixes);
+  path_conv pc (name, PC_SYM_FOLLOW | PC_POSIX | PC_KEEP_HANDLE | PC_STAT,
+      stat_suffixes);
    return stat_worker (pc, buf);
  }

@@ -1658,7 +1659,7 @@ extern "C" int
  lstat64 (const char *name, struct __stat64 *buf)
  {
    syscall_printf ("entering");
-  path_conv pc (name, PC_SYM_NOFOLLOW | PC_POSIX | PC_KEEP_HANDLE,
+  path_conv pc (name, PC_SYM_NOFOLLOW | PC_POSIX | PC_KEEP_HANDLE | 
PC_STAT,
  		stat_suffixes);
    return stat_worker (pc, buf);
  }



More information about the Cygwin-developers mailing list