]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Add a real API for dealing with blk_congestion_wait()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 23 Aug 2006 00:06:24 +0000 (20:06 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 23 Sep 2006 03:24:54 +0000 (23:24 -0400)
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
block/ll_rw_blk.c
fs/nfs/write.c
include/linux/blkdev.h
include/linux/writeback.h
mm/page-writeback.c

index ddd9253f9d55f267120ddf04a014eaecd12d283c..dcbd6ff1fa333224bcf34ae664a3ea256beb9c3f 100644 (file)
@@ -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
  */
index 453d44666ea58250c2f3e55243c1781e75c9cb1a..38ba5c09af08f5309f57e7dcc6a5638075ccb1a8 100644 (file)
@@ -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;
 }
 
index aafe82788b4efcaebf6d7513d98a3fc038124c4c..96c9040c00a87f391148547213d161d3231d341a 100644 (file)
@@ -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 *);
index 9e38b566d0e77325d50fb9bfd52b28898c753349..0422036af4ebb2ba99c3ca7f05775aa53a03226a 100644 (file)
@@ -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;
index e630188ccc40cb84dbc6bbf0266d22621bc23df5..77a0bc4e261aba1a9290a389f99f299251cc38c8 100644 (file)
@@ -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.