All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun He <jhe@cs.wisc.edu>
To: xfs@oss.sgi.com
Subject: XFS discards more data than it writes
Date: Fri, 26 Aug 2016 20:45:37 -0500	[thread overview]
Message-ID: <20160827014537.GA4119@Juns-MacBook-Pro.local> (raw)

Hi all,

I find that, with '-o discard', XFS sometimes discards more data than it
writes. This may slow down XFS more on slow-discard SSDs. Also, could
problematic discard implementation lead to data loss?

Setup to reproduce: 
- Linux 4.5.4
- Workload: LevelDB

$ mkfs.xfs  -K -f -s size=4096 -b size=4096 /dev/sdc1
$ mount -o discard /dev/sdc1 /mnt/fsonloop
$ leveldb/db_bench --benchmarks=overwrite --num=3000000 --db=/mnt/fsonloop/leveldb_data0 --threads=1 --use_existing_db=0

I found that XFS discarded ~2.4GB while only wrote ~1.4GB,
by blktrace. (This is not due to the mkfs discarding the
whole disk.)

Some visual https://github.com/junhe/xfs-bug-report/blob/master/xfs-double-discard.png 
Some spaces are discarded twice in this case.

Is it a bug?

Thanks,
Jun


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2016-08-27  1:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27  1:45 Jun He [this message]
2016-08-27 22:55 ` XFS discards more data than it writes Dave Chinner

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=20160827014537.GA4119@Juns-MacBook-Pro.local \
    --to=jhe@cs.wisc.edu \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.