Commit bcfd8d36151e531e1c6c731f1fbf792509a1c494

Authored by Andrew Morton
Committed by Jens Axboe
1 parent 5e6d12b2c8

[PATCH] CONFIG_BLOCK: blk_congestion_wait() fix

Don't just do nothing: it'll cause busywaits all over writeback and page
reclaim.

For now, take a fixed-length nap.  Will improve when NFS starts waking up
throttled processes.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

Showing 1 changed file with 5 additions and 2 deletions Side-by-side Diff

include/linux/blkdev.h
1 1 #ifndef _LINUX_BLKDEV_H
2 2 #define _LINUX_BLKDEV_H
3 3  
  4 +#include <linux/sched.h>
4 5 #include <linux/major.h>
5 6 #include <linux/genhd.h>
6 7 #include <linux/list.h>
... ... @@ -848,7 +849,7 @@
848 849  
849 850 static inline long blk_congestion_wait(int rw, long timeout)
850 851 {
851   - return timeout;
  852 + return io_schedule_timeout(timeout);
852 853 }
853 854  
854 855 static inline long nr_blockdev_pages(void)
... ... @@ -856,7 +857,9 @@
856 857 return 0;
857 858 }
858 859  
859   -static inline void exit_io_context(void) {}
  860 +static inline void exit_io_context(void)
  861 +{
  862 +}
860 863  
861 864 #endif /* CONFIG_BLOCK */
862 865