public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* How to force EXT4_MB_GRP_CLEAR_TRIMMED on a live ext4?
@ 2021-10-23 10:24 Laurent GUERBY
  2021-10-25  9:42 ` Lukas Czerner
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent GUERBY @ 2021-10-23 10:24 UTC (permalink / raw)
  To: linux-ext4

Hi,

When using fstrim on an ext4 filesystem trim are not issued for
EXT4_MB_GRP_WAS_TRIMMED space which is a useful optimization.

Is there a way to force a complete trim on a mounted ext4 filesystem? 

My (limited) understanding of the code is that
EXT4_MB_GRP_CLEAR_TRIMMED should be called to do so.

My use case is having live migrated a virtual machine root disk from
one storage to another, the target supporting trim, but since fstrim in
the VM post migration does mostly nothing (assumes most space was
trimmed) I cannot release space to the new storage.

I tried mount -o remount but without effect. e2fsprogs don't seem to
have an option/tool to do this either.

I've seen suggestion that rebooting will do the job but the whole point
of live migration is to avoid reboot :).

I did end up creating dummy files to fill the filesystem and then
removing them, but this is far less efficient than what a filesystem
tool could do.

Thanks in advance for your help,

Sincerely,

Laurent


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-25 16:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-23 10:24 How to force EXT4_MB_GRP_CLEAR_TRIMMED on a live ext4? Laurent GUERBY
2021-10-25  9:42 ` Lukas Czerner
2021-10-25 15:29   ` Laurent GUERBY
2021-10-25 16:47     ` Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox