Mail Archives: cygwin/2003/05/18/19:32:50
------=_NextPart_000_0009_01C31D9E.2369F250
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Martin Buchholz wrote:
> Max> Actual test data relating to this would be very interesting to see.
>
> Some was included in my other post. I would have done a more
> conclusive test, but I now have a working machine that is doing
> productive work, and I hesitate to go through another two cycles of
> painful cygwin1.dll installs. But I would be willing to do this if
> that's what it would take to convince you folks to undo the sparse
> file patch.
>
> If you have a Windows 2000 machine (no service packs) and a recent
> cygwin, try this experiment:
>
> $ ls -l /etc/passwd
> -rw-rw-rw- 1 Martin B Users 628 May 13 04:10 /etc/passwd
> $ perl -e 'system("df ."); for (1 ... 1024) { system("cp /etc/passwd
> foobar$_"); } system("df .")' Filesystem 1k-blocks Used
> Available Use% Mounted on
> d: 11767580 4290332 7477248 37% /d
> Filesystem 1k-blocks Used Available Use% Mounted on
> d: 11767580 4290332 7477248 37% /d
>
> That's 4kb per small (but not tiny) file with my patch applied.
> How much space does yours take? It would be interesting to see
> results on Windows XP as well.
>
> (again:) For best reproducibility, I suggest
> - windows 2000, no service packs
> - do the experiment on an ntfs partition formatted by windows 2000.
>
> I have not done this exact experiment on an unpatched Cygwin, but I
> predict it would take either 32kb or 64kb per file (also dependent on
> the filesystem cluster size, but that should default to 4kb).
max AT pomello [~] $ CYGWIN=sparse perl -e 'system("df ."); for (1 ... 1024)
{ sys
tem("cp /etc/passwd foobar$_"); } system("df .")'; rm foobar*
Filesystem 1k-blocks Used Available Use% Mounted on
M:\cygwin 18892436 13175484 5716952 70% /
Filesystem 1k-blocks Used Available Use% Mounted on
M:\cygwin 18892436 13177408 5715028 70% /
max AT pomello [~] $ CYGWIN=nosparse perl -e 'system("df ."); for (1 ... 1024)
{ s
ystem("cp /etc/passwd foobar$_"); } system("df .")'; rm foobar*
Filesystem 1k-blocks Used Available Use% Mounted on
M:\cygwin 18892436 13175552 5716884 70% /
Filesystem 1k-blocks Used Available Use% Mounted on
M:\cygwin 18892436 13175552 5716884 70% /
Well, here is my run of that, on WinXPSP1. All I can say is... wow!
As you can see, I don't change DLL between these tests. I attach my patch
which allows environment-variable control over sparse file creation.
Max.
------=_NextPart_000_0009_01C31D9E.2369F250
Content-Type: text/plain;
name="sparse-cond.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="sparse-cond.patch"
Index: src/winsup/cygwin/environ.cc=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /home/max/cvsmirror/src-cvs/src/winsup/cygwin/environ.cc,v=0A=
retrieving revision 1.91=0A=
diff -u -p -r1.91 environ.cc=0A=
--- src/winsup/cygwin/environ.cc 13 Feb 2003 15:15:32 -0000 1.91=0A=
+++ src/winsup/cygwin/environ.cc 18 May 2003 22:34:03 -0000=0A=
@@ -37,6 +37,7 @@ extern BOOL strip_title_path;=0A=
extern int pcheck_case;=0A=
extern int subauth_id;=0A=
BOOL reset_com =3D FALSE;=0A=
+BOOL sparse_files =3D FALSE;=0A=
static BOOL envcache =3D TRUE;=0A=
=0A=
static char **lastenviron;=0A=
@@ -516,6 +517,7 @@ static struct parse_thing=0A=
{"ntea", {&allow_ntea}, justset, NULL, {{FALSE}, {TRUE}}},=0A=
{"ntsec", {&allow_ntsec}, justset, NULL, {{FALSE}, {TRUE}}},=0A=
{"smbntsec", {&allow_smbntsec}, justset, NULL, {{FALSE}, {TRUE}}},=0A=
+ {"sparse", {&sparse_files}, justset, NULL, {{FALSE}, {TRUE}}},=0A=
{"reset_com", {&reset_com}, justset, NULL, {{FALSE}, {TRUE}}},=0A=
{"strip_title", {&strip_title_path}, justset, NULL, {{FALSE}, =
{TRUE}}},=0A=
{"subauth_id", {func: &subauth_id_init}, isfunc, NULL, {{0}, {0}}},=0A=
Index: src/winsup/cygwin/fhandler_disk_file.cc=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: =
/home/max/cvsmirror/src-cvs/src/winsup/cygwin/fhandler_disk_file.cc,v=0A=
retrieving revision 1.50=0A=
diff -u -p -r1.50 fhandler_disk_file.cc=0A=
--- src/winsup/cygwin/fhandler_disk_file.cc 11 May 2003 21:52:09 -0000 =
1.50=0A=
+++ src/winsup/cygwin/fhandler_disk_file.cc 18 May 2003 22:34:57 -0000=0A=
@@ -31,6 +31,8 @@ details. */=0A=
#define _COMPILING_NEWLIB=0A=
#include <dirent.h>=0A=
=0A=
+extern BOOL sparse_files;=0A=
+=0A=
static int __stdcall=0A=
num_entries (const char *win32_name)=0A=
{=0A=
@@ -409,7 +411,7 @@ fhandler_disk_file::open (path_conv *rea=0A=
set_file_attribute (has_acls (), get_win32_name (), mode);=0A=
=0A=
/* Set newly created and truncated files as sparse files. */=0A=
- if ((real_path->fs_flags () & FILE_SUPPORTS_SPARSE_FILES)=0A=
+ if (sparse_files && (real_path->fs_flags () & =
FILE_SUPPORTS_SPARSE_FILES)=0A=
&& (get_access () & GENERIC_WRITE) =3D=3D GENERIC_WRITE=0A=
&& (get_flags () & (O_CREAT | O_TRUNC)))=0A=
{=0A=
------=_NextPart_000_0009_01C31D9E.2369F250
Content-Type: text/plain; charset=us-ascii
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
------=_NextPart_000_0009_01C31D9E.2369F250--
- Raw text -