Thread (11 messages) 11 messages, 3 authors, 2020-12-24

Re: discard and data=writeback

From: Matteo Croce <hidden>
Date: 2020-12-23 19:00:31

On Wed, Dec 23, 2020 at 7:12 PM Theodore Y. Ts'o [off-list ref] wrote:
On Wed, Dec 23, 2020 at 01:47:33AM +0100, Matteo Croce wrote:
quoted
As an extra test I extracted the archive with data=ordered, remounted
with data=writeback and timed the rm -rf and viceversa.
The mount option is the one that counts, the one using during
extraction doesn't matter.
Hmm... that's really surprising.  At this point, the only thing I can
suggest is to try using blktrace to see what's going on at the block
layer when the I/O's and discard requests are being submitted.  If
there are no dirty blocks in the page cache, I don't see how
data=ordered vs data=writeback would make a difference to how mount -o
discard processing would take place.
Hi,

these are the blktrace outputs for both journaling modes:

# dmesg |grep EXT4-fs |tail -1
[ 1594.829833] EXT4-fs (nvme0n1p1): mounted filesystem with ordered
data mode. Opts: data=ordered,discard
# blktrace /dev/nvme0n1 & sleep 1 ; time rm -rf /media/linux-5.10/ ; kill $!
[1] 3032

real    0m1.328s
user    0m0.063s
sys     0m1.231s
# === nvme0n1 ===
  CPU  0:                    0 events,        0 KiB data
  CPU  1:                    0 events,        0 KiB data
  CPU  2:                    0 events,        0 KiB data
  CPU  3:                 1461 events,       69 KiB data
  CPU  4:                    1 events,        1 KiB data
  CPU  5:                    0 events,        0 KiB data
  CPU  6:                    0 events,        0 KiB data
  CPU  7:                    0 events,        0 KiB data
  Total:                  1462 events (dropped 0),       69 KiB data


# dmesg |grep EXT4-fs |tail -1
[ 1734.837651] EXT4-fs (nvme0n1p1): mounted filesystem with writeback
data mode. Opts: data=writeback,discard
# blktrace /dev/nvme0n1 & sleep 1 ; time rm -rf /media/linux-5.10/ ; kill $!
[1] 3069

real    1m30.273s
user    0m0.139s
sys     0m3.084s
# === nvme0n1 ===
  CPU  0:               133830 events,     6274 KiB data
  CPU  1:                21878 events,     1026 KiB data
  CPU  2:                46365 events,     2174 KiB data
  CPU  3:                98116 events,     4600 KiB data
  CPU  4:               290902 events,    13637 KiB data
  CPU  5:                10926 events,      513 KiB data
  CPU  6:                76861 events,     3603 KiB data
  CPU  7:                17855 events,      837 KiB data
  Total:                696733 events (dropped 0),    32660 KiB data

Cheers,
-- 
per aspera ad upstream
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help