From: "Darrick J. Wong" <djwong@kernel.org>
To: Sai Chaitanya Mitta <mittachaitu@gmail.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: Approach to quickly zeroing large XFS file (or) tool to mark XFS file extents as written
Date: Mon, 23 Dec 2024 13:53:17 -0800 [thread overview]
Message-ID: <20241223215317.GR6174@frogsfrogsfrogs> (raw)
In-Reply-To: <CAN=PFfLfRFE9g_9UveWmAuc5_Pp_ihmc7x_po0e6=sTt2dynBQ@mail.gmail.com>
On Mon, Dec 23, 2024 at 10:12:32PM +0530, Sai Chaitanya Mitta wrote:
> Hi Team,
> Is there any method/tool available to explicitly mark XFS
> file extents as written? One approach I
> am aware is explicitly zeroing the entire file (this file may be even
> in hundreds of GB in size) through
> synchronous/asynchronous(aio/io_uring) mechanism but it is time taking
> process for large files,
> is there any optimization/approach we can do to explicitly zeroing
> file/mark extents as written?
Why do you need to mark them written?
--D
>
> Synchronous Approach:
> while offset < size {
> let bytes_written = img_file
> .write_at(&buf, offset)
> .map_err(|e| {
> error!("Failed to zero out file: {}
> error: {:?}", vol_name, e);
> })?;
> if offset == size {
> break;
> }
> offset = offset + bytes_written as u64;
> }
> img_file.sync_all();
>
> Asynchronous approach:
> Currently used fio with libaio as ioengine but
> results are almost same.
>
> --
> Thanks& Regards,
> M.Sai Chaithanya.
>
next prev parent reply other threads:[~2024-12-23 21:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-23 16:42 Approach to quickly zeroing large XFS file (or) tool to mark XFS file extents as written Sai Chaitanya Mitta
2024-12-23 21:53 ` Darrick J. Wong [this message]
2024-12-24 5:47 ` Sai Chaitanya Mitta
2025-01-06 19:46 ` Darrick J. Wong
2025-01-07 6:14 ` Christoph Hellwig
2025-01-07 7:04 ` Darrick J. Wong
2025-01-07 8:37 ` Christoph Hellwig
2025-01-07 22:11 ` Darrick J. Wong
2024-12-24 3:42 ` Dave Chinner
2025-01-06 11:15 ` Christoph Hellwig
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=20241223215317.GR6174@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mittachaitu@gmail.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