From: Sougata Santra <sougata@tuxera.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <hch@infradead.org>, <linux-fsdevel@vger.kernel.org>,
Vyacheslav Dubeyko <slava@dubeyko.com>,
Sougata Santra <sougata@tuxera.com>,
Fabian Frederick <fabf@skynet.be>
Subject: [PATCH 0/1] hfsplus: skip unnecessary volume header sync
Date: Thu, 17 Jul 2014 19:30:22 +0300 [thread overview]
Message-ID: <1405614622.25052.6.camel@ultrabook> (raw)
hfsplus_sync_fs always updates volume header information to disk with every
sync. Not only it causes extra writes to disk but also causes problem for
system tools trying to monitor disk activity to reduce power consumption,
by switching disk to low power mode. We also call hfsplus_sync_fs from
unmount, which is not required.
Test:
------
$ $ sudo mount -t hfsplus -o umask=0000 /dev/sdb1 /mnt/tmp
$ cat /proc/diskstats
8 17 sdb1 36289 138 291192 8857 1283 34862 288838 1114187 0 17196 1123002
$ sync
$ cat /proc/diskstats
8 17 sdb1 36289 138 291192 8857 1284 34862 288839 1114188 0 17197 1123003
$ sync
$ cat /proc/diskstats
8 17 sdb1 36289 138 291192 8857 1285 34862 288840 1114189 0 17198 1123004
$ sync
$ cat /proc/diskstats
8 17 sdb1 36289 138 291192 8857 1286 34862 288841 1114190 0 17198 1123004
We, can clearly see that field 5, 7 increasing without actually writing into the
volume.
Please Note:
-----------
hfsplus_sync_volume_header() is added to call from mount/unmount sequence,
since we just want to write the dirty/clean state to disk. For unmount,
hfsplus_sync_fs is already called from sync_filesystem(). For mount, it
gets called from delayed_sync_fs().
Also, there was a error in error propagation. It it also fixed in this patch.
-->snip<--
if (!error)
error2 = error;
-->snap<--
The disk is only flushed if there was no error. Previously it was always flushed
without checking the error.
Sougata Santra (1):
hfsplus: skip unnecessary volume header sync
fs/hfsplus/super.c | 101 +++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 79 insertions(+), 22 deletions(-)
reply other threads:[~2014-07-17 16:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1405614622.25052.6.camel@ultrabook \
--to=sougata@tuxera.com \
--cc=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=slava@dubeyko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox