public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
To: cygwin@cygwin.com
Subject: Re: /usr/bin/fallocate -v -d -l 2 myfile takes forever
Date: Mon, 29 Jan 2024 01:32:13 -0700	[thread overview]
Message-ID: <d6134ced-53f6-46bb-9448-7b2f7efc636b@SystematicSW.ab.ca> (raw)
In-Reply-To: <CALXu0UeXUwCjY+WVwXA2X68XGEcm63SPPOPQtO-ZiDKFqXYW5w@mail.gmail.com>

On 2024-01-28 23:44, Cedric Blancher via Cygwin wrote:
> rm -f myfile
> touch myfile
> /usr/bin/fallocate -v -d -l myfile takes forever with latest Cygwin 3.5

It takes much longer without Cygwin 3.5!

Your fallocate(1) option -l has no length numeric argument and no -o offset 
numeric argument to specify the start of the range.

Takes no time on my system when used properly:

$ uname -srvmo
CYGWIN_NT-10.0-19045 3.5.0-0.613.g2c5433e5da82.x86_64 2024-01-24 15:14 UTC 
x86_64 Cygwin
$ smartctl -i /dev/sda
smartctl 7.4 2023-08-01 r5530 [x86_64-pc-cygwin-w10-22H2] (cygwin-7.4-1)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

Warning: Limited functionality due to missing admin rights
=== START OF INFORMATION SECTION ===
Model Family:     Seagate BarraCuda 3.5 (CMR)
Device Model:     ST1000DM010-2EP102
Serial Number:    W9AAWPXN
Firmware Version: CC43
Device is:        In smartctl database 7.3/5528
ATA Version is:   [No Information Found]
Local Time is:    Mon Jan 29 01:11:59 2024 MST
SMART support is: Available - device has SMART capability.
                   Enabled status cached by OS, trying SMART RETURN STATUS cmd.
SMART support is: Enabled

$ rm -f myfile; touch myfile; llgo myfile
removed 'myfile'
-rw-r--r-- 1 0 Jan 29 00:50 myfile
$ time fallocate -v -o 0 -l 64MiB myfile; llgo myfile

real    0m0.049s
user    0m0.000s
sys     0m0.015s
-rw-r--r-- 1 64M Jan 29 00:50 myfile
$ time fallocate -v -o 0 -l 64MiB -d myfile; llgo myfile
myfile: 64 MiB (67108864 bytes) converted to sparse holes.

real    0m0.146s
user    0m0.015s
sys     0m0.078s
-rw-r--r-- 1 64M Jan 29 00:50 myfile

Now perhaps the fallocate(1) design, option checking, diagnostics, defaults, and 
output, could use some work: using SI multipliers for data sizes (see ls --si!)

Perhaps show some useful commands and output that demonstrate your claim, 
including the actual test release used from `uname -srvmo` and provide some 
information about your drive (type, speed, size) and system, like output from 
`cygcheck -hrsv` attached as a text file?

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


  parent reply	other threads:[~2024-01-29  8:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29  6:44 Cedric Blancher
2024-01-29  7:56 ` Mark Geisert
2024-01-29  9:45   ` Mark Geisert
2024-03-05  8:46     ` Cedric Blancher
2024-03-05 10:43       ` Mark Geisert
2024-03-08  9:43         ` Mark Geisert
2024-03-05 11:04       ` Mark Geisert
2024-01-29  8:32 ` Brian Inglis [this message]
2024-01-29 10:39   ` Cedric Blancher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6134ced-53f6-46bb-9448-7b2f7efc636b@SystematicSW.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).