diff -ruN linux-2.6.9/fs/xfs/linux-2.6/kmem.c linux-2.6.9-xfs/fs/xfs/linux-2.6/kmem.c --- linux-2.6.9/fs/xfs/linux-2.6/kmem.c 2004-10-18 23:54:31.000000000 +0200 +++ linux-2.6.9-xfs/fs/xfs/linux-2.6/kmem.c 2004-11-25 13:24:47.000000000 +0100 @@ -35,6 +35,7 @@ #include #include #include +#include #include "time.h" #include "kmem.h" @@ -46,7 +47,8 @@ void * kmem_alloc(size_t size, int flags) { - int retries = 0, lflags = kmem_flags_convert(flags); + int retries = 0; + int lflags = kmem_flags_convert(flags) | __GFP_NOWARN; void *ptr; do { @@ -57,8 +59,10 @@ if (ptr || (flags & (KM_MAYFAIL|KM_NOSLEEP))) return ptr; if (!(++retries % 100)) - printk(KERN_ERR "possible deadlock in %s (mode:0x%x)\n", + printk(KERN_ERR "xfs: possible memory allocation " + "deadlock in %s (mode:0x%x)\n", __FUNCTION__, lflags); + blk_congestion_wait(WRITE, HZ/50); } while (1); } @@ -102,7 +106,8 @@ void * kmem_zone_alloc(kmem_zone_t *zone, int flags) { - int retries = 0, lflags = kmem_flags_convert(flags); + int retries = 0; + int lflags = kmem_flags_convert(flags) | __GFP_NOWARN; void *ptr; do { @@ -110,8 +115,10 @@ if (ptr || (flags & (KM_MAYFAIL|KM_NOSLEEP))) return ptr; if (!(++retries % 100)) - printk(KERN_ERR "possible deadlock in %s (mode:0x%x)\n", + printk(KERN_ERR "xfs: possible memory allocation " + "deadlock in %s (mode:0x%x)\n", __FUNCTION__, lflags); + blk_congestion_wait(WRITE, HZ/50); } while (1); } diff -ruN linux-2.6.9/fs/xfs/linux-2.6/xfs_buf.c linux-2.6.9-xfs/fs/xfs/linux-2.6/xfs_buf.c --- linux-2.6.9/fs/xfs/linux-2.6/xfs_buf.c 2004-10-18 23:53:07.000000000 +0200 +++ linux-2.6.9-xfs/fs/xfs/linux-2.6/xfs_buf.c 2004-11-25 13:24:43.000000000 +0100 @@ -53,6 +53,7 @@ #include #include #include +#include #include "xfs_linux.h" @@ -348,11 +349,12 @@ size_t blocksize = bp->pb_target->pbr_bsize; size_t size = bp->pb_count_desired; size_t nbytes, offset; - int gfp_mask = pb_to_gfp(flags); + int gfp_mask = pb_to_gfp(flags) | __GFP_NOWARN; unsigned short page_count, i; pgoff_t first; loff_t end; int error; + long timeout; end = bp->pb_file_offset + bp->pb_buffer_length; page_count = page_buf_btoc(end) - page_buf_btoct(bp->pb_file_offset); @@ -387,13 +389,17 @@ */ if (!(++retries % 100)) printk(KERN_ERR - "possible deadlock in %s (mode:0x%x)\n", + "xfs: possible memory allocation " + "deadlock in %s (mode:0x%x)\n", __FUNCTION__, gfp_mask); XFS_STATS_INC(pb_page_retries); pagebuf_daemon_wakeup(0, gfp_mask); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(10); + timeout = blk_congestion_wait(WRITE, HZ/50); + if (timeout > HZ/100) { + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(timeout); + } goto retry; }