diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-08-22 20:06:24 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-09-22 23:24:54 -0400 |
commit | 275a082fe9308e710324e26ccb5363c53d8fd45f (patch) | |
tree | e97df6e45f98ea2827f71dc749f8cd47f3f353cc | |
parent | 94a6d75320b3681e6e728b70e18bd186cb55e682 (diff) |
Add a real API for dealing with blk_congestion_wait()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | block/ll_rw_blk.c | 12 | ||||
-rw-r--r-- | fs/nfs/write.c | 1 | ||||
-rw-r--r-- | include/linux/blkdev.h | 1 | ||||
-rw-r--r-- | include/linux/writeback.h | 1 | ||||
-rw-r--r-- | mm/page-writeback.c | 9 |
5 files changed, 24 insertions, 0 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index ddd9253f9d55..dcbd6ff1fa33 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -2734,6 +2734,18 @@ long blk_congestion_wait(int rw, long timeout) | |||
2734 | 2734 | ||
2735 | EXPORT_SYMBOL(blk_congestion_wait); | 2735 | EXPORT_SYMBOL(blk_congestion_wait); |
2736 | 2736 | ||
2737 | /** | ||
2738 | * blk_congestion_end - wake up sleepers on a congestion queue | ||
2739 | * @rw: READ or WRITE | ||
2740 | */ | ||
2741 | void blk_congestion_end(int rw) | ||
2742 | { | ||
2743 | wait_queue_head_t *wqh = &congestion_wqh[rw]; | ||
2744 | |||
2745 | if (waitqueue_active(wqh)) | ||
2746 | wake_up(wqh); | ||
2747 | } | ||
2748 | |||
2737 | /* | 2749 | /* |
2738 | * Has to be called with the request spinlock acquired | 2750 | * Has to be called with the request spinlock acquired |
2739 | */ | 2751 | */ |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 453d44666ea5..38ba5c09af08 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -396,6 +396,7 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) | |||
396 | out: | 396 | out: |
397 | clear_bit(BDI_write_congested, &bdi->state); | 397 | clear_bit(BDI_write_congested, &bdi->state); |
398 | wake_up_all(&nfs_write_congestion); | 398 | wake_up_all(&nfs_write_congestion); |
399 | writeback_congestion_end(); | ||
399 | return err; | 400 | return err; |
400 | } | 401 | } |
401 | 402 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index aafe82788b4e..96c9040c00a8 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -746,6 +746,7 @@ extern void blk_queue_free_tags(request_queue_t *); | |||
746 | extern int blk_queue_resize_tags(request_queue_t *, int); | 746 | extern int blk_queue_resize_tags(request_queue_t *, int); |
747 | extern void blk_queue_invalidate_tags(request_queue_t *); | 747 | extern void blk_queue_invalidate_tags(request_queue_t *); |
748 | extern long blk_congestion_wait(int rw, long timeout); | 748 | extern long blk_congestion_wait(int rw, long timeout); |
749 | extern void blk_congestion_end(int rw); | ||
749 | 750 | ||
750 | extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); | 751 | extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); |
751 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 752 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 9e38b566d0e7..0422036af4eb 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -85,6 +85,7 @@ int wakeup_pdflush(long nr_pages); | |||
85 | void laptop_io_completion(void); | 85 | void laptop_io_completion(void); |
86 | void laptop_sync_completion(void); | 86 | void laptop_sync_completion(void); |
87 | void throttle_vm_writeout(void); | 87 | void throttle_vm_writeout(void); |
88 | void writeback_congestion_end(void); | ||
88 | 89 | ||
89 | /* These are exported to sysctl. */ | 90 | /* These are exported to sysctl. */ |
90 | extern int dirty_background_ratio; | 91 | extern int dirty_background_ratio; |
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index e630188ccc40..77a0bc4e261a 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -803,6 +803,15 @@ int test_set_page_writeback(struct page *page) | |||
803 | EXPORT_SYMBOL(test_set_page_writeback); | 803 | EXPORT_SYMBOL(test_set_page_writeback); |
804 | 804 | ||
805 | /* | 805 | /* |
806 | * Wakes up tasks that are being throttled due to writeback congestion | ||
807 | */ | ||
808 | void writeback_congestion_end(void) | ||
809 | { | ||
810 | blk_congestion_end(WRITE); | ||
811 | } | ||
812 | EXPORT_SYMBOL(writeback_congestion_end); | ||
813 | |||
814 | /* | ||
806 | * Return true if any of the pages in the mapping are marged with the | 815 | * Return true if any of the pages in the mapping are marged with the |
807 | * passed tag. | 816 | * passed tag. |
808 | */ | 817 | */ |