Re: Btrfs v0.16 released

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Theodore Tso
Date: Friday, August 15, 2008 - 12:59 pm

On Fri, Aug 15, 2008 at 01:52:52PM -0400, Chris Mason wrote:

I've been able to use compilebench to see the fragmentation problem
very easily.

Annesh has been workign on it, and has some fixes that he queued up.
I'll have to point him at your proposed fix, thanks.  This is what he
came up with in the common code.  What do you think?

						- Ted

(From Annesh, on the linux-ext4 list.)

As I explained in my previous patch the problem is due to pdflush
background_writeout. Now when pdflush does the writeout we may
have only few pages for the file and we would attempt
to write them to disk. So my attempt in the last patch was to
do the below

a) When allocation blocks try to be close to the goal block specified
b) When we call ext4_da_writepages make sure we have minimal nr_to_write
  that ensures we allocate all dirty buffer_heads in a single go.
  nr_to_write is set to 1024 in pdflush background_writeout and that
  would mean we may end up calling some inodes writepages() with really
  small values even though we have more dirty buffer_heads.

What it doesn't handle is
1) File A have 4 dirty buffer_heads.
2) pdflush try to write them. We get 4 contig blocks
3) File A now have new 5 dirty_buffer_heads
4) File B now have 6 dirty_buffer_heads
5) pdflush try to write the 6 dirty buffer_heads of file B and allocate
them next to earlier file A blocks
6) pdflush try to write the 5 dirty buffer_heads of file A and allocate
them after file B blocks resulting in discontinuity.

I am right now testing the below patch which make sure new dirty inodes
are added to the tail of the dirty inode list

commit 6ad9d25595aea8efa0d45c0a2dd28b4a415e34e6
Author: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Date:   Fri Aug 15 23:19:15 2008 +0530

    move the dirty inodes to the end of the list

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 25adfc3..91f3c54 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -163,7 +163,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
 		 */
 		if (!was_dirty) {
 			inode->dirtied_when = jiffies;
-			list_move(&inode->i_list, &sb->s_dirty);
+			list_move_tail(&inode->i_list, &sb->s_dirty);
 		}
 	}
 out:
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Btrfs v0.16 released, Chris Mason, (Tue Aug 5, 12:01 pm)
Re: Btrfs v0.16 released, Peter Zijlstra, (Thu Aug 7, 2:08 am)
Re: Btrfs v0.16 released, Peter Zijlstra, (Thu Aug 7, 2:14 am)
Re: Btrfs v0.16 released, Chris Mason, (Thu Aug 7, 3:34 am)
Re: Btrfs v0.16 released, Chris Mason, (Thu Aug 7, 3:39 am)
Re: Btrfs v0.16 released, Chris Friesen, (Thu Aug 7, 7:58 am)
Re: Btrfs v0.16 released, tvrtko.ursulin, (Thu Aug 7, 8:07 am)
Re: Btrfs v0.16 released, Andi Kleen, (Thu Aug 7, 11:02 am)
Re: Btrfs v0.16 released, Chris Mason, (Fri Aug 8, 11:48 am)
Re: Btrfs v0.16 released, Andi Kleen, (Fri Aug 8, 2:56 pm)
Re: Btrfs v0.16 released, Theodore Tso, (Fri Aug 8, 6:19 pm)
Re: Btrfs v0.16 released, Andi Kleen, (Fri Aug 8, 6:23 pm)
Re: Btrfs v0.16 released, Theodore Tso, (Fri Aug 8, 6:43 pm)
Re: Btrfs v0.16 released, Chris Mason, (Thu Aug 14, 2:00 pm)
Re: Btrfs v0.16 released, Andi Kleen, (Thu Aug 14, 2:17 pm)
Re: Btrfs v0.16 released, Theodore Tso, (Thu Aug 14, 4:44 pm)
Re: Btrfs v0.16 released, Chris Mason, (Thu Aug 14, 6:10 pm)
Re: Btrfs v0.16 released, Chris Mason, (Thu Aug 14, 6:25 pm)
Re: Btrfs v0.16 released, Andi Kleen, (Thu Aug 14, 6:39 pm)
Re: Btrfs v0.16 released, Chris Mason, (Fri Aug 15, 5:46 am)
Re: Btrfs v0.16 released, Chris Mason, (Fri Aug 15, 6:00 am)
Re: Btrfs v0.16 released, Theodore Tso, (Fri Aug 15, 6:45 am)
Re: Btrfs v0.16 released, Chris Mason, (Fri Aug 15, 10:52 am)
Re: Btrfs v0.16 released, Theodore Tso, (Fri Aug 15, 12:59 pm)
Re: Btrfs v0.16 released, Chris Mason, (Fri Aug 15, 1:37 pm)
Re: Btrfs v0.16 released, Chris Mason, (Sat Aug 16, 11:10 am)
Re: Btrfs v0.16 released, Szabolcs Szakacsits, (Sat Aug 16, 12:26 pm)
Re: Btrfs v0.16 released, Theodore Tso, (Sat Aug 16, 12:27 pm)
Re: Btrfs v0.16 released, Chris Mason, (Mon Aug 18, 6:52 am)
Re: Btrfs v0.16 released, Szabolcs Szakacsits, (Mon Aug 18, 10:37 am)