Matthew Garrett ([info]mjg59) wrote,
@ 2009-03-18 18:47:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Entry tags:advogato, fedora

ext4 and spinups
As a followup to my discussion of ext4, I did some trivial testing today. This consisted of generating a file, writing to it, closing it, opening another file, writing to it, closing it and then renaming the second file over the first. Then repeating about 10,000 times. fsync() wasn't called at any point. I used the /proc/sys/vm/block_dump knob to get an idea of when stuff was actually hitting disk. This was using the current rawhide kernel, which has the various workarounds for avoiding data corruption merged. The good news is that I was unable to get into an inconsistent state - the files always contained either the original or the new data, and the absolute worst case was having a zero length temporary file. The bad news is that while ext3 only touched disk when it reached the commit interval, ext4 touched disk for every single rename() call.

There appears to be a plan for dealing with this, but the current state of affairs is that ext4 will (under an obviously incredibly synthetic and unrealistic set of conditions) reduce the amount of time a drive can spend spun down. The next step is to attempt to measure this in a real world setup and see whether it's compensated for by the other new features.




(4 comments) - (Post a new comment)

(Power and wifi)
(Anonymous)
2009-03-18 09:02 pm UTC (link)
Enquiring minds want to know if (the rate slection algorithm) minstrel's side effect habit of selecting lower bit rates when less/no traffic is being sent actually saves power?

(Reply to this) (Thread)

Re: (Power and wifi)
[info]mjg59
2009-03-18 09:05 pm UTC (link)
I honestly don't know enough about the implementation of 802.11 hardware. I guess it depends on how it interacts with power saving modes that would cut off power to the radio when not transmitting.

(Reply to this) (Parent)


[info]elsmi
2009-03-19 08:39 am UTC (link)
Wait, the allocate-on-rename patch actually forces an fsync, and the alternative is the make-fsync-suck-like-it-does-on-ext3 patch? I really hope that there's a mistake in here somewhere :-(

(Reply to this)

Low hanging fruit
(Anonymous)
2009-03-19 01:32 pm UTC (link)
The idea behind the ext4 patch is to just do the delayed allocation and let the rest of the data=ordered code make sure things are on disk.

In practice, it actually starts the IO instead (I didn't realize this until just now). Separate from the ext4 allocate-on-commit patch, they could fix it to do the delayed allocation without starting the IO.

I hope they don't end up doing the allocate-on-commit by default, since that should bring back the firefox fsync bug.

+ * We could call write_cache_pages(), and then redirty all of
+ * the pages by calling redirty_page_for_writeback() but that
+ * would be ugly in the extreme. So instead we would need to
+ * replicate parts of the code in the above functions,
+ * simplifying them becuase we wouldn't actually intend to
+ * write out the pages, but rather only collect contiguous
+ * logical block extents, call the multi-block allocator, and
+ * then update the buffer heads with the block allocations.
+ *
+ * For now, though, we'll cheat by calling filemap_flush(),
+ * which will map the blocks, and start the I/O, but not
+ * actually wait for the I/O to complete.
+ */
+ return filemap_flush(inode->i_mapping);

(Reply to this)


(4 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…