delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/12/22/10:36:42

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 5BMFagRh1003794
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 5BMFagRh1003794
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=Z+3jPNn1
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7082F4BA2E31
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1766417801;
bh=COjRyq7HuEQK1Eazb1InGYRsJrEGlO+r5ZtaYS7/IvU=;
h=Date:Subject:To:Cc:References:In-Reply-To:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=Z+3jPNn1hbAnb2seOQygnlNBhCScn3H6EPrQZj/8enKZxbisY0Oh8AUWhAc/NuwJS
Rp38Gk9On1SK5Wi8kh8oqiqY6QOLFq9cPLmCwSRkVQ7Np+nKTMFzKY6CixIh4WhNC0
3NWP1xDIGFpSRRcvJ16ATwFeF2MXnGrEi66ExQ6Q=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EEB734BA2E04
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EEB734BA2E04
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1766417749; cv=none;
b=C7TnBZ/dahqTFlCl4xI5/3n49UF3K0ICDOM+Z4vas7UaImCfpXgu+P2704PiA1YEcw5EAiPDZ+MHGJSpVTawGthRfeczWI/hyUQZIdpUKSWhPxv2q66Q2PwJpDzlYSI+wFPk5LeeoObj6YfU3vH16ga9kjf1RzfFIjexmyB1guM=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1766417749; c=relaxed/simple;
bh=10RUywz1DQM/yCOTWmjHeeIW/qrMU8ETUUPAtl2V2Oo=;
h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From;
b=oC/DvemPmMbOzxaCN/Rpmw9jRAfBPaGhDu2pAXj3p4pmNPgLYwW6OTyeDfb4R8KcVhoGZ9LD36qVfi9MaNdwnhfVJIM40kkvjNGp4Q76FMrqa4fWMyWPUBdihODMv4TiWjOqFcc1atqXk43l3xg+TdJhYzn0a37/7F5PlSNlQY0=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EEB734BA2E04
X-Barracuda-Envelope-From: moss AT cs DOT umass DOT edu
X-Barracuda-RBL-Trusted-Forwarder: 128.119.240.136
DKIM-Filter: OpenDKIM Filter v2.11.0 mailsrv.cs.umass.edu BCFE55BDA4
X-Barracuda-RBL-Trusted-Forwarder: 172.26.69.67
Message-ID: <510a193d-633c-ddf1-68a7-a61b9847cfa8@cs.umass.edu>
Date: Mon, 22 Dec 2025 10:35:47 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Subject: Re: Why is stat slow?
X-ASG-Orig-Subj: Re: Why is stat slow?
To: cygwin AT cygwin DOT com
Cc: Christian Franke <Christian DOT Franke AT t-online DOT de>
References: <74bdc787-9099-8e29-492a-588546b6eedb AT cs DOT umass DOT edu>
<f7fa49d4-abcd-31da-ca04-f716742d5d83 AT t-online DOT de>
In-Reply-To: <f7fa49d4-abcd-31da-ca04-f716742d5d83@t-online.de>
X-Barracuda-Connect: mailsrv.cs.umass.edu[128.119.240.136]
X-Barracuda-Start-Time: 1766417748
X-Barracuda-Encrypted: TLS_AES_256_GCM_SHA384
X-Barracuda-URL: https://barramail.cs.umass.edu:443/cgi-mod/mark.cgi
X-Virus-Scanned: by bsmtpd at cs.umass.edu
X-Barracuda-Scan-Msg-Size: 2277
X-Barracuda-BRTS-Status: 1
X-ASG-Debug-ID: 1766417747-24039d6c3d4fb490001-w5GHUG
X-Barracuda-Spam-Score: 0.00
X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=3.5
QUARANTINE_LEVEL=10.0 KILL_LEVEL=9.7 test=
X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.125474
Rule breakdown below
pts rule name description
---- ---------------------- --------------------------------------------------
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Eliot Moss via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Eliot Moss <moss AT cs DOT umass DOT edu>
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On 12/22/2025 10:07 AM, Christian Franke via Cygwin wrote:
> Eliot Moss via Cygwin wrote:
>> I'm sure this has been asked before, more than once, but I am again wondering
>> what, specifically, makes stat (the program, but presumably also the syscall)
>> substantially slower on Cygwin compared to stat on WSL2.  I am talking about
>> an external HDD (not solid state) on my D: drive.  It shows under WSL 2 as
>> /mnt/d like this (output of mount):
>>
>> D:\ on /mnt/d type 9p 
>> (rw,noatime,aname=drvfs;path=D:\;uid=0;gid=0;symlinkroot=/mnt/,cache=5,access=client,msize=65536,trans=fd,rfd=5,wfd=5)
>>
>> On Cygwin it shows up like this (yes, mount shows two lines):
>>
>> D: on /cygdrive/d type ntfs (binary,notexec,posix=0,user)
>> D: on /cygdrive/d type ntfs (binary,noacl,posix=0,user,noumount,auto)
>>
>> My /etc/fstab lines are:
>>
>> none /cygdrive cygdrive binary,noacl,posix=0,user 0 0
>> d: /cygdrive/d ntfs binary,posix=0,user,auto,notexec 0 0
> 
> In the past, Cygwin did not support individual options for some /cygdrive/X. If this is still the case, "noacl" without 
> "notexec" is effective for /cygdrive/d. Then Cygwin reads the header of each file to check for a possible "x" permission.
> 
> 
>>
>> (Presumably this has something to do with two mounts showing ...)
>>
>> On D; I have a folder with hundreds of 2Gb files (they are backups, split into
>> 2Gb portions).  On Cygwin
>>
>> time stat <the files> gives
>>
>> real    2m12.425s
>> user    0m0.249s
>> sys     0m1.312s
>>
> 
> This would explain this long duration.
> 
> Quick test:
> 
> $ echo '#!/bin/sh' > /cygdrive/d/script.tmp
> $ ls -l /cygdrive/d/script.tmp
> -rwxr-xr-x .... <== notexec unset
> -rw-r--r-- .... <== notexec set

Aha!  I changed my /etc/fstab to be like this:

none /cygdrive cygdrive binary,noacl,posix=0,user 0 0
d: /d ntfs binary,posix=0,user 0 0

D: is still available via explicit /cygdrive/d, but that would be without the
noacl option.  Using /d now the previously slow stat completes in a few
seconds, reasonable for going over what is now 2000 files.  My memory of
exactly why is dim, but the noacl seems important for my C: drive.  Using the
ACLs on D: to determine executability seems good.

Thanks!  Eliot

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019