From b033c117e459bfc22a0d40556c794ef17ecd7c84 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 22 Aug 2006 20:06:24 -0400 Subject: [PATCH] --- yaml --- r: 34797 b: refs/heads/master c: 275a082fe9308e710324e26ccb5363c53d8fd45f h: refs/heads/master i: 34795: 5d8562f44820cdca757f7c8a69f86760088c61ac v: v3 --- [refs] | 2 +- trunk/block/ll_rw_blk.c | 12 ++++++++++++ trunk/fs/nfs/write.c | 1 + trunk/include/linux/blkdev.h | 1 + trunk/include/linux/writeback.h | 1 + trunk/mm/page-writeback.c | 9 +++++++++ 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6debc0fcf92a..db6ce617857d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 94a6d75320b3681e6e728b70e18bd186cb55e682 +refs/heads/master: 275a082fe9308e710324e26ccb5363c53d8fd45f diff --git a/trunk/block/ll_rw_blk.c b/trunk/block/ll_rw_blk.c index ddd9253f9d55..dcbd6ff1fa33 100644 --- a/trunk/block/ll_rw_blk.c +++ b/trunk/block/ll_rw_blk.c @@ -2734,6 +2734,18 @@ long blk_congestion_wait(int rw, long timeout) EXPORT_SYMBOL(blk_congestion_wait); +/** + * blk_congestion_end - wake up sleepers on a congestion queue + * @rw: READ or WRITE + */ +void blk_congestion_end(int rw) +{ + wait_queue_head_t *wqh = &congestion_wqh[rw]; + + if (waitqueue_active(wqh)) + wake_up(wqh); +} + /* * Has to be called with the request spinlock acquired */ diff --git a/trunk/fs/nfs/write.c b/trunk/fs/nfs/write.c index 453d44666ea5..38ba5c09af08 100644 --- a/trunk/fs/nfs/write.c +++ b/trunk/fs/nfs/write.c @@ -396,6 +396,7 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) out: clear_bit(BDI_write_congested, &bdi->state); wake_up_all(&nfs_write_congestion); + writeback_congestion_end(); return err; } diff --git a/trunk/include/linux/blkdev.h b/trunk/include/linux/blkdev.h index aafe82788b4e..96c9040c00a8 100644 --- a/trunk/include/linux/blkdev.h +++ b/trunk/include/linux/blkdev.h @@ -746,6 +746,7 @@ extern void blk_queue_free_tags(request_queue_t *); extern int blk_queue_resize_tags(request_queue_t *, int); extern void blk_queue_invalidate_tags(request_queue_t *); extern long blk_congestion_wait(int rw, long timeout); +extern void blk_congestion_end(int rw); extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); extern int blkdev_issue_flush(struct block_device *, sector_t *); diff --git a/trunk/include/linux/writeback.h b/trunk/include/linux/writeback.h index 9e38b566d0e7..0422036af4eb 100644 --- a/trunk/include/linux/writeback.h +++ b/trunk/include/linux/writeback.h @@ -85,6 +85,7 @@ int wakeup_pdflush(long nr_pages); void laptop_io_completion(void); void laptop_sync_completion(void); void throttle_vm_writeout(void); +void writeback_congestion_end(void); /* These are exported to sysctl. */ extern int dirty_background_ratio; diff --git a/trunk/mm/page-writeback.c b/trunk/mm/page-writeback.c index e630188ccc40..77a0bc4e261a 100644 --- a/trunk/mm/page-writeback.c +++ b/trunk/mm/page-writeback.c @@ -802,6 +802,15 @@ int test_set_page_writeback(struct page *page) } EXPORT_SYMBOL(test_set_page_writeback); +/* + * Wakes up tasks that are being throttled due to writeback congestion + */ +void writeback_congestion_end(void) +{ + blk_congestion_end(WRITE); +} +EXPORT_SYMBOL(writeback_congestion_end); + /* * Return true if any of the pages in the mapping are marged with the * passed tag.