From: Laurent GUERBY <laurent@guerby.net>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: How to force EXT4_MB_GRP_CLEAR_TRIMMED on a live ext4?
Date: Mon, 25 Oct 2021 17:29:03 +0200 [thread overview]
Message-ID: <1635175743.26818.15.camel@guerby.net> (raw)
In-Reply-To: <20211025094227.yio3cjpboxumt5ml@work>
On Mon, 2021-10-25 at 11:42 +0200, Lukas Czerner wrote:
> On Sat, Oct 23, 2021 at 12:24:40PM +0200, Laurent GUERBY wrote:
> >
> > 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.
>
> Yeah, that's bad. The information is stored in the buddy cache in
> memory
> and AFAIK is only dropped on unmount. I'll have to think about how to
> clear either the cache or selectively just the flag.
>
> What would be more convenient way of doing this for you, -o remount,
> or
> using let's say tune2fs ? I am not promising anything yet, but I'll
> think
> about how to implement it.
>
>
> Meanwhile other than umount/mount, or actually writing to the dummy
> files,
> you can try to use fallocate to allocate all the remaining space in
> the
> file system and subsequently removing it. That should be more
> efficient,
> but don't forget to sync after remove to make sure the space is
> released
> before you call fstrim.
Thanks for the advice on fallocate! It does work and is very fast.
I would prefer a specific tune2fs as remount forcing this TRIM cache
clearing behaviour might be unwanted.
> You could also force fsck on ro file system and use -E discard to
> trim the
> free space but I can't say I recommend it.
Thanks again for your help,
Sincerely,
Laurent
next prev parent reply other threads:[~2021-10-25 15:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2021-10-25 16:47 ` Andreas Dilger
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=1635175743.26818.15.camel@guerby.net \
--to=laurent@guerby.net \
--cc=lczerner@redhat.com \
--cc=linux-ext4@vger.kernel.org \
/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