Re: possible bug with RAID

From: Steve Lord (lord@sgi.com)
Date: Tue Dec 11 2001 - 14:34:03 EST


On Tue, 2001-12-11 at 12:54, Roy Sigurd Karlsbakk wrote:
> > it would be interesting to write a simple benchmark
> > that simply reads a file at a fixed rate. *that* would
> > actually simulate your app.
>
> sure. I'm using tux+wget for that. I were just playing around with dd
>
> > sounds like a VM/balance problem. you didn't mention which kernel
> > you're using.
>
> 2.4.16 w/tux + xfs. The fs used on the raid vol is xfs

We just got to the bottom of a problem in xfs which was causing memory
not to get cleaned as efficiently as it should be - it lead to dbench
lockups on low memory systems. It is possible you are seeing a similar
effect - we dirty all the memory and then struggle to clean it up.

Try the attached patch.

Steve


===========================================================================
Index: linux/fs/buffer.c
===========================================================================

--- /usr/tmp/TmpDir.12499-0/linux/fs/buffer.c_1.96 Tue Dec 11 13:33:26 2001
+++ linux/fs/buffer.c Tue Dec 11 13:31:17 2001
@@ -224,6 +224,7 @@
         unlock_buffer(bh);
         put_bh(bh);
 }
+EXPORT_SYMBOL(end_buffer_io_sync);
 
 /*
  * The buffers have been marked clean and locked. Just submit the dang
@@ -2538,7 +2539,7 @@
 /*
  * Can the buffer be thrown out?
  */
-#define BUFFER_BUSY_BITS ((1<<BH_Dirty) | (1<<BH_Lock))
+#define BUFFER_BUSY_BITS ((1<<BH_Dirty) | (1<<BH_Lock) | (1<<BH_Delay))
 #define buffer_busy(bh) (atomic_read(&(bh)->b_count) | ((bh)->b_state & BUFFER_BUSY_BITS))
 
 /*

===========================================================================
Index: linux/fs/pagebuf/page_buf_io.c
===========================================================================

--- /usr/tmp/TmpDir.12499-0/linux/fs/pagebuf/page_buf_io.c_1.102 Tue Dec 11 13:33:26 2001
+++ linux/fs/pagebuf/page_buf_io.c Tue Dec 11 10:22:58 2001
@@ -1337,10 +1337,12 @@
         head = bh;
         do {
                 lock_buffer(bh);
- set_buffer_async_io(bh);
- set_bit(BH_Uptodate, &bh->b_state);
- clear_bit(BH_Dirty, &bh->b_state);
                 clear_bit(BH_Delay, &bh->b_state);
+ if (atomic_set_buffer_clean(bh)) {
+ get_bh(bh);
+ bh->b_end_io = end_buffer_io_sync;
+ refile_buffer(bh);
+ }
                 bh = bh->b_this_page;
         } while (bh != head);
 
@@ -1350,6 +1352,7 @@
         } while (bh != head);
 
         SetPageUptodate(page);
+ UnlockPage(page);
         page_cache_release(page);
 }
 

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



This archive was generated by hypermail 2b29 : Sat Dec 15 2001 - 21:00:21 EST