aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_buf.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-09-27 20:52:15 -0400
committerTim Shimmin <tes@sgi.com>2006-09-27 20:52:15 -0400
commitf07c225036358038bf8a64f75351f10cdca2fb22 (patch)
treeb64bb87fa152240d77ae749c3b4a95af9190d583 /fs/xfs/linux-2.6/xfs_buf.c
parentf37ea14969bf85633d3bd29ddf008171a5618855 (diff)
[XFS] Improve xfsbufd delayed write submission patterns, after blktrace
analysis. Under a sequential create+allocate workload, blktrace reported backward writes being issued by xfsbufd, and frequent inappropriate queue unplugs. We now insert at the tail when moving from the delwri lists to the temp lists, which maintains correct ordering, and we avoid unplugging queues deep in the submit paths when we'd shortly do it at a higher level anyway. blktrace now reports much healthier write patterns from xfsbufd for this workload (and likely many others). SGI-PV: 954310 SGI-Modid: xfs-linux-melb:xfs-kern:26396a Signed-off-by: Nathan Scott <nathans@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 2af528dcfb04..f13503508c46 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. 2 * Copyright (c) 2000-2006 Silicon Graphics, Inc.
3 * All Rights Reserved. 3 * All Rights Reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -1681,6 +1681,7 @@ xfsbufd(
1681 xfs_buf_t *bp, *n; 1681 xfs_buf_t *bp, *n;
1682 struct list_head *dwq = &target->bt_delwrite_queue; 1682 struct list_head *dwq = &target->bt_delwrite_queue;
1683 spinlock_t *dwlk = &target->bt_delwrite_lock; 1683 spinlock_t *dwlk = &target->bt_delwrite_lock;
1684 int count;
1684 1685
1685 current->flags |= PF_MEMALLOC; 1686 current->flags |= PF_MEMALLOC;
1686 1687
@@ -1696,6 +1697,7 @@ xfsbufd(
1696 schedule_timeout_interruptible( 1697 schedule_timeout_interruptible(
1697 xfs_buf_timer_centisecs * msecs_to_jiffies(10)); 1698 xfs_buf_timer_centisecs * msecs_to_jiffies(10));
1698 1699
1700 count = 0;
1699 age = xfs_buf_age_centisecs * msecs_to_jiffies(10); 1701 age = xfs_buf_age_centisecs * msecs_to_jiffies(10);
1700 spin_lock(dwlk); 1702 spin_lock(dwlk);
1701 list_for_each_entry_safe(bp, n, dwq, b_list) { 1703 list_for_each_entry_safe(bp, n, dwq, b_list) {
@@ -1711,9 +1713,11 @@ xfsbufd(
1711 break; 1713 break;
1712 } 1714 }
1713 1715
1714 bp->b_flags &= ~(XBF_DELWRI|_XBF_DELWRI_Q); 1716 bp->b_flags &= ~(XBF_DELWRI|_XBF_DELWRI_Q|
1717 _XBF_RUN_QUEUES);
1715 bp->b_flags |= XBF_WRITE; 1718 bp->b_flags |= XBF_WRITE;
1716 list_move(&bp->b_list, &tmp); 1719 list_move_tail(&bp->b_list, &tmp);
1720 count++;
1717 } 1721 }
1718 } 1722 }
1719 spin_unlock(dwlk); 1723 spin_unlock(dwlk);
@@ -1724,12 +1728,12 @@ xfsbufd(
1724 1728
1725 list_del_init(&bp->b_list); 1729 list_del_init(&bp->b_list);
1726 xfs_buf_iostrategy(bp); 1730 xfs_buf_iostrategy(bp);
1727
1728 blk_run_address_space(target->bt_mapping);
1729 } 1731 }
1730 1732
1731 if (as_list_len > 0) 1733 if (as_list_len > 0)
1732 purge_addresses(); 1734 purge_addresses();
1735 if (count)
1736 blk_run_address_space(target->bt_mapping);
1733 1737
1734 clear_bit(XBT_FORCE_FLUSH, &target->bt_flags); 1738 clear_bit(XBT_FORCE_FLUSH, &target->bt_flags);
1735 } while (!kthread_should_stop()); 1739 } while (!kthread_should_stop());
@@ -1767,7 +1771,7 @@ xfs_flush_buftarg(
1767 continue; 1771 continue;
1768 } 1772 }
1769 1773
1770 list_move(&bp->b_list, &tmp); 1774 list_move_tail(&bp->b_list, &tmp);
1771 } 1775 }
1772 spin_unlock(dwlk); 1776 spin_unlock(dwlk);
1773 1777
@@ -1776,7 +1780,7 @@ xfs_flush_buftarg(
1776 */ 1780 */
1777 list_for_each_entry_safe(bp, n, &tmp, b_list) { 1781 list_for_each_entry_safe(bp, n, &tmp, b_list) {
1778 xfs_buf_lock(bp); 1782 xfs_buf_lock(bp);
1779 bp->b_flags &= ~(XBF_DELWRI|_XBF_DELWRI_Q); 1783 bp->b_flags &= ~(XBF_DELWRI|_XBF_DELWRI_Q|_XBF_RUN_QUEUES);
1780 bp->b_flags |= XBF_WRITE; 1784 bp->b_flags |= XBF_WRITE;
1781 if (wait) 1785 if (wait)
1782 bp->b_flags &= ~XBF_ASYNC; 1786 bp->b_flags &= ~XBF_ASYNC;
@@ -1786,6 +1790,9 @@ xfs_flush_buftarg(
1786 xfs_buf_iostrategy(bp); 1790 xfs_buf_iostrategy(bp);
1787 } 1791 }
1788 1792
1793 if (wait)
1794 blk_run_address_space(target->bt_mapping);
1795
1789 /* 1796 /*
1790 * Remaining list items must be flushed before returning 1797 * Remaining list items must be flushed before returning
1791 */ 1798 */
@@ -1797,9 +1804,6 @@ xfs_flush_buftarg(
1797 xfs_buf_relse(bp); 1804 xfs_buf_relse(bp);
1798 } 1805 }
1799 1806
1800 if (wait)
1801 blk_run_address_space(target->bt_mapping);
1802
1803 return pincount; 1807 return pincount;
1804} 1808}
1805 1809