From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.atof.net (smtp1.atof.net [52.86.233.228]) by sourceware.org (Postfix) with ESMTPS id 0B3D73858D1E for ; Sun, 15 Jan 2023 03:25:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B3D73858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gluelogic.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gluelogic.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Spam-Language: en X-Spam-Relay-Country: X-Spam-DCC: B=MGTINTERNET; R=smtp1.atof.net 1170; Body=1 Fuz1=1 Fuz2=1 X-Spam-RBL: X-Spam-PYZOR: Reported 0 times. Date: Sat, 14 Jan 2023 22:24:55 -0500 From: gs-cygwin.com@gluelogic.com To: moss@cs.umass.edu Cc: cygwin Subject: Re: Question about slow access to file information Message-ID: References: <797a8935-e38b-0c0f-87d8-b8df1e9fd76f@cs.umass.edu> <0c9c111e-9e63-bf8c-8049-06fd23f66351@t-online.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 List-Id: On Sun, Jan 15, 2023 at 12:05:10PM +1100, Eliot Moss via Cygwin wrote: > On 1/15/2023 3:38 AM, Christian Franke via Cygwin wrote: > > Eliot Moss via Cygwin wrote: > > > I have a separate drive mounted this way: > > > > > > d:/ /cygdrive/d ntfs binary,posix=0,user,noacl,auto 0 0 > > > > > > One thing I use it for is to store backup files.  These tend to be 2 Gb > > > chunks, and there can be hundreds of them in the backup directory. (The drive > > > is 5Tb.)  The Windows Disk Management tool describes it as NTFS, Basic Data > > > Partition. > > > > > > Doing ls (for example) takes a very perceptible numbers of seconds (though > > > whatever takes a long time seems to be cached, at least for a while, since a > > > second ls soon after is fast). > > > > The problem is the 'noacl' mount option and the fact that POSIX only > > offers the *stat*() functions to retrieve file information. These > > functions always need to provide the full file information, even if only > > a small subset is needed. > > > > To determine the 'x'-permission bits in the 'stat.st_mode' field on a > > 'noacl'-mount, Cygwin reads the first bytes of most files (all except > > *.exe, *.lnk, *.com). The 'x' bits are set if the file starts with "#!" > > (script), ":\n" (?) or "MZ" (Windows executable). > > > > On 'noacl' mounts, this behavior could be suppressed by 'exec' or 'noexec' mount options. > > Interesting. I removed the noacl from /etc/fstab and restarted all Cygwin processes. > The mount program now shows that drive without noacl. It still takes surprisingly > long to ls if I have not done so recently. The directory contains ~1200 files. > > Further thoughts? Does this make any difference? $ env - LANG=C ls -f /cygdrive/d/ Also, ISTR prior mailing list postings on how cygwin may open() each file to determine some info, and that can be expensive. Is that what is happening if you trace the 'ls'? Cheers, Glenn