linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* discard and data=writeback
@ 2020-12-18 18:40 Matteo Croce
  2020-12-21  3:04 ` Theodore Y. Ts'o
  0 siblings, 1 reply; 13+ messages in thread
From: Matteo Croce @ 2020-12-18 18:40 UTC (permalink / raw)
  To: linux-ext4

Hi,

I noticed a big slowdown on file removal, so I tried to remove the
discard option, and it helped
a lot.
Obviously discarding blocks will have an overhead, but the strange
thing is that it only
does when using data=writeback:

Ordered:

$ dmesg |grep EXT4
[    0.243372] EXT4-fs (vda1): mounted filesystem with ordered data
mode. Opts: (null)

$ grep -w / /proc/mounts
/dev/root / ext4 rw,noatime 0 0
$ time rm -rf linux-5.10

real    0m0.454s
user    0m0.029s
sys     0m0.409s

$ grep -w / /proc/mounts
/dev/root / ext4 rw,noatime,discard 0 0
$ time rm -rf linux-5.10

real    0m0.554s
user    0m0.051s
sys     0m0.403s

Writeback:

$ dmesg |grep EXT4
[    0.243909] EXT4-fs (vda1): mounted filesystem with writeback data
mode. Opts: (null)

$ grep -w / /proc/mounts
/dev/root / ext4 rw,noatime 0 0
$ time rm -rf linux-5.10

real    0m0.440s
user    0m0.030s
sys     0m0.407s

$ grep -w / /proc/mounts
/dev/root / ext4 rw,noatime,discard 0 0
$ time rm -rf linux-5.10

real    0m3.763s
user    0m0.030s
sys     0m0.876s

It seems that ext4_issue_discard() is called ~300 times with data=ordered
and ~50k times with data=writeback.
I'm using vanilla 5.10.1 kernel.

Any thoughts?

Regards,
-- 
per aspera ad upstream

^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <CGME20201229054143epcms2p15ae3cce43bb3c503adf94528f354ba78@epcms2p1>]

end of thread, other threads:[~2020-12-29 13:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-18 18:40 discard and data=writeback Matteo Croce
2020-12-21  3:04 ` Theodore Y. Ts'o
2020-12-22 14:59   ` Matteo Croce
2020-12-22 16:34     ` Theodore Y. Ts'o
2020-12-22 22:53       ` Andreas Dilger
2020-12-23  1:25         ` Matteo Croce
2020-12-23  0:47       ` Matteo Croce
2020-12-23 18:12         ` Theodore Y. Ts'o
2020-12-23 18:59           ` Matteo Croce
2020-12-24  3:16             ` Theodore Y. Ts'o
2020-12-24 10:53               ` Matteo Croce
     [not found] <CGME20201229054143epcms2p15ae3cce43bb3c503adf94528f354ba78@epcms2p1>
2020-12-29  5:41 ` Daejun Park
2020-12-29 13:42   ` Matteo Croce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).