[BUG] Non-chronological ordering of dirty buffers

From: Mark Hemment (markhe@veritas.com)
Date: Fri Aug 04 2000 - 06:25:42 EST


Hi,

  Perhaps I'm missing something...

  flush_dirty_buffers() expects the buffers on the DIRTY lru to be in
chronological order (as it can break out of the loop based on
b_flushtime). Fine.

  But, __mark_buffer_dirty() sets the flushtime based upon the flag
argument passed to the function;

        static __inline__ void __mark_dirty(struct buffer_head *bh,
                                int flag)
        {
                bh->b_flushtime = jiffies + (flag ? bdf_prm.b_un.age_super
                                        : bdf_prm.b_un.age_buffer);
                refile_buffer(bh);
        }

        void __mark_buffer_dirty(struct buffer_head *bh, int flag)
        {
                if (!atomic_set_buffer_dirty(bh))
                        __mark_dirty(bh, flag);
        }

  In "bdf_prm", age_super is set to 5secs, and age_buffer is 30secs.

  So, when marking a buffer which contains a superblock (or at least,
"flag" is non-zero), it is placed on the dirty lru in the wrong position -
there is no checking in refile_buffer() that the buffer is placed in the
correct position. This breaks the dirty flushing code such that a
superblock buffer may not be flushed according to its b_flushtime when a
"normal" dirty buffer is sitting in front of it on the dirty lru.

  Is it good that dirty superblocks can take so long before they get
written out?

  What is the correct fix?
        1) Just leave things as they are.
        2) Add a dirty lru ordering function, called from refile_buffer().
        3) Add a new dirty lru for superblocks.

  3) would be my preference.
  flush_dirty_buffers() could ignore "ndirty" for this new list of dirty
superblocks.

  Any comments?

Mark

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Aug 07 2000 - 21:00:12 EST