lkml.org 
[lkml]   [2022]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V2 1/1] loop: introduce LO_FLAGS_NO_DEALLOC
From
Hi,

On 2022/8/10 06:19, Darrick J. Wong wrote:
>
> Considering that discard isn't required to do anything, why not
> echo 0 | sudo tee /sys/block/loopX/queue/discard_max_bytes ?
>

Thanks for reviewing! This will disable discard completely (>=5.19),
thus the filesystem of backing file has no knowledge about what can be
freed. In contrast, my patch convert REQ_OP_DISCARD to
FALLOC_FL_ZERO_RANGE, the discarded parts of backing file is flagged
zeroed. So there is possibility for the filesystem of backing file to
discard (trim) the zeroed range, improving the write performance on, for
example, SSDs.

However, it seems only XFS with realtime discard enabled can do trim on
FALLOC_FL_ZERO_RANGE. All other filesystems (and XFS without realtime
discard) can't do trim on extents flagged zeroed. Batch discard like
FITRIM (used by `fstirm' tool) also can't help here, because no
filesystem track `allocated but flagged zeroed' extents at filesystem
level. I will probably write another patch to add the ability to trim
zeroed extents in single file to FITRIM. (Currently, FITRIM work on
filesystem level, not file level)

Best Regards,
Zhang Boyang

\
 
 \ /
  Last update: 2022-08-10 13:01    [W:0.122 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site