Linux block layer
 help / color / mirror / Atom feed
From: Zhang Boyang <zhangboyang.id@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	linux-block@vger.kernel.org
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	Jan Kara <jack@suse.cz>, Ming Lei <ming.lei@redhat.com>,
	"Darrick J . Wong" <djwong@kernel.org>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH V2 0/1] loop: introduce LO_FLAGS_NO_DEALLOC
Date: Sat,  6 Aug 2022 23:30:21 +0800	[thread overview]
Message-ID: <20220806153022.83748-1-zhangboyang.id@gmail.com> (raw)

Hi,

This patch gives userspace ability to prevent underlying file of loop
device to be sparse. Currently, if loop device is 'trimmed'
(BLKDISCARD), then underlying file will always become sparse and disk
space freed. This behaviour is good for thin provisioning but not good
for preallocated disk images. This patch introduces LO_FLAGS_NO_DEALLOC
flag, which will write zeroes to underlying file instead of punching
holes when BLKDISCARD is requested. Thus reducing file fragmentation of
preallocated disk images and improve performance.

I will also submit patches to util-linux to provide userspace support if
this patch is merged.

Changes in V1->V2:
Renamed NODEALLOC to NO_DEALLOC, to avoid confusion between NO_DEALLOC
and NODE_ALLOC. Suggested by Jens Axboe.

Best Regards,
Zhang Boyang 



             reply	other threads:[~2022-08-06 15:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06 15:30 Zhang Boyang [this message]
2022-08-06 15:30 ` [PATCH V2 1/1] loop: introduce LO_FLAGS_NO_DEALLOC Zhang Boyang
2022-08-09 22:19   ` Darrick J. Wong
2022-08-10 11:00     ` Zhang Boyang
2022-08-11 11:40 ` Userspace support for LO_FLAGS_NO_DEALLOC (Re: [PATCH V2 0/1] loop: introduce LO_FLAGS_NO_DEALLOC) Zhang Boyang

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=20220806153022.83748-1-zhangboyang.id@gmail.com \
    --to=zhangboyang.id@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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