aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-03-30 07:05:09 -0400
committerAlex Elder <aelder@sgi.com>2011-04-08 09:09:28 -0400
commita1b7ea5d58c53c13f082110e535d98bc4e8e5cfe (patch)
tree8238090fc86fa6198680012b9d65d272529ba44b /fs
parent957935dcd8e11d6f789b4ed769b376040e15565b (diff)
xfs: use proper interfaces for on-stack plugging
Add proper blk_start_plug/blk_finish_plug pairs for the two places where we issue buffer I/O, and remove the blk_flush_plug in xfs_buf_lock and xfs_buf_iowait, given that context switches already flush the per-process plugging lists. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 2eef165f4f39..478ca1547ee5 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -915,8 +915,6 @@ xfs_buf_lock(
915 915
916 if (atomic_read(&bp->b_pin_count) && (bp->b_flags & XBF_STALE)) 916 if (atomic_read(&bp->b_pin_count) && (bp->b_flags & XBF_STALE))
917 xfs_log_force(bp->b_target->bt_mount, 0); 917 xfs_log_force(bp->b_target->bt_mount, 0);
918 if (atomic_read(&bp->b_io_remaining))
919 blk_flush_plug(current);
920 down(&bp->b_sema); 918 down(&bp->b_sema);
921 XB_SET_OWNER(bp); 919 XB_SET_OWNER(bp);
922 920
@@ -1305,8 +1303,6 @@ xfs_buf_iowait(
1305{ 1303{
1306 trace_xfs_buf_iowait(bp, _RET_IP_); 1304 trace_xfs_buf_iowait(bp, _RET_IP_);
1307 1305
1308 if (atomic_read(&bp->b_io_remaining))
1309 blk_flush_plug(current);
1310 wait_for_completion(&bp->b_iowait); 1306 wait_for_completion(&bp->b_iowait);
1311 1307
1312 trace_xfs_buf_iowait_done(bp, _RET_IP_); 1308 trace_xfs_buf_iowait_done(bp, _RET_IP_);
@@ -1743,8 +1739,8 @@ xfsbufd(
1743 do { 1739 do {
1744 long age = xfs_buf_age_centisecs * msecs_to_jiffies(10); 1740 long age = xfs_buf_age_centisecs * msecs_to_jiffies(10);
1745 long tout = xfs_buf_timer_centisecs * msecs_to_jiffies(10); 1741 long tout = xfs_buf_timer_centisecs * msecs_to_jiffies(10);
1746 int count = 0;
1747 struct list_head tmp; 1742 struct list_head tmp;
1743 struct blk_plug plug;
1748 1744
1749 if (unlikely(freezing(current))) { 1745 if (unlikely(freezing(current))) {
1750 set_bit(XBT_FORCE_SLEEP, &target->bt_flags); 1746 set_bit(XBT_FORCE_SLEEP, &target->bt_flags);
@@ -1760,16 +1756,15 @@ xfsbufd(
1760 1756
1761 xfs_buf_delwri_split(target, &tmp, age); 1757 xfs_buf_delwri_split(target, &tmp, age);
1762 list_sort(NULL, &tmp, xfs_buf_cmp); 1758 list_sort(NULL, &tmp, xfs_buf_cmp);
1759
1760 blk_start_plug(&plug);
1763 while (!list_empty(&tmp)) { 1761 while (!list_empty(&tmp)) {
1764 struct xfs_buf *bp; 1762 struct xfs_buf *bp;
1765 bp = list_first_entry(&tmp, struct xfs_buf, b_list); 1763 bp = list_first_entry(&tmp, struct xfs_buf, b_list);
1766 list_del_init(&bp->b_list); 1764 list_del_init(&bp->b_list);
1767 xfs_bdstrat_cb(bp); 1765 xfs_bdstrat_cb(bp);
1768 count++;
1769 } 1766 }
1770 if (count) 1767 blk_finish_plug(&plug);
1771 blk_flush_plug(current);
1772
1773 } while (!kthread_should_stop()); 1768 } while (!kthread_should_stop());
1774 1769
1775 return 0; 1770 return 0;
@@ -1789,6 +1784,7 @@ xfs_flush_buftarg(
1789 int pincount = 0; 1784 int pincount = 0;
1790 LIST_HEAD(tmp_list); 1785 LIST_HEAD(tmp_list);
1791 LIST_HEAD(wait_list); 1786 LIST_HEAD(wait_list);
1787 struct blk_plug plug;
1792 1788
1793 xfs_buf_runall_queues(xfsconvertd_workqueue); 1789 xfs_buf_runall_queues(xfsconvertd_workqueue);
1794 xfs_buf_runall_queues(xfsdatad_workqueue); 1790 xfs_buf_runall_queues(xfsdatad_workqueue);
@@ -1803,6 +1799,8 @@ xfs_flush_buftarg(
1803 * we do that after issuing all the IO. 1799 * we do that after issuing all the IO.
1804 */ 1800 */
1805 list_sort(NULL, &tmp_list, xfs_buf_cmp); 1801 list_sort(NULL, &tmp_list, xfs_buf_cmp);
1802
1803 blk_start_plug(&plug);
1806 while (!list_empty(&tmp_list)) { 1804 while (!list_empty(&tmp_list)) {
1807 bp = list_first_entry(&tmp_list, struct xfs_buf, b_list); 1805 bp = list_first_entry(&tmp_list, struct xfs_buf, b_list);
1808 ASSERT(target == bp->b_target); 1806 ASSERT(target == bp->b_target);
@@ -1813,10 +1811,10 @@ xfs_flush_buftarg(
1813 } 1811 }
1814 xfs_bdstrat_cb(bp); 1812 xfs_bdstrat_cb(bp);
1815 } 1813 }
1814 blk_finish_plug(&plug);
1816 1815
1817 if (wait) { 1816 if (wait) {
1818 /* Expedite and wait for IO to complete. */ 1817 /* Wait for IO to complete. */
1819 blk_flush_plug(current);
1820 while (!list_empty(&wait_list)) { 1818 while (!list_empty(&wait_list)) {
1821 bp = list_first_entry(&wait_list, struct xfs_buf, b_list); 1819 bp = list_first_entry(&wait_list, struct xfs_buf, b_list);
1822 1820