aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2010-01-11 06:49:58 -0500
committerAlex Elder <aelder@sgi.com>2010-01-15 16:32:46 -0500
commit453eac8a9aa417878a38bdfbccafd5f7ce4e8e4e (patch)
tree252e37d5b29693cc73fc1ce890c9b303d45e6efa /fs/xfs
parentf0a7695380efa31cd281730917f7e907a724d5cb (diff)
xfs: Don't wake the aild once per second
Now that the AIL push algorithm is traversal safe, we don't need a watchdog function in the xfsaild to catch pushes that fail to make progress. Remove the watchdog timeout and make pushes purely driven by demand. This will remove the once-per-second wakeup that is seen when the filesystem is idle and make laptop power misers happy. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c7
-rw-r--r--fs/xfs/xfs_trans_ail.c19
2 files changed, 14 insertions, 12 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 77414db10dc2..9f2e398a5616 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -877,12 +877,11 @@ xfsaild(
877{ 877{
878 struct xfs_ail *ailp = data; 878 struct xfs_ail *ailp = data;
879 xfs_lsn_t last_pushed_lsn = 0; 879 xfs_lsn_t last_pushed_lsn = 0;
880 long tout = 0; 880 long tout = 0; /* milliseconds */
881 881
882 while (!kthread_should_stop()) { 882 while (!kthread_should_stop()) {
883 if (tout) 883 schedule_timeout_interruptible(tout ?
884 schedule_timeout_interruptible(msecs_to_jiffies(tout)); 884 msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT);
885 tout = 1000;
886 885
887 /* swsusp */ 886 /* swsusp */
888 try_to_freeze(); 887 try_to_freeze();
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 2ffc570679be..063dfbdca94b 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -237,14 +237,15 @@ out:
237} 237}
238 238
239/* 239/*
240 * Function that does the work of pushing on the AIL 240 * xfsaild_push does the work of pushing on the AIL. Returning a timeout of
241 * zero indicates that the caller should sleep until woken.
241 */ 242 */
242long 243long
243xfsaild_push( 244xfsaild_push(
244 struct xfs_ail *ailp, 245 struct xfs_ail *ailp,
245 xfs_lsn_t *last_lsn) 246 xfs_lsn_t *last_lsn)
246{ 247{
247 long tout = 1000; /* milliseconds */ 248 long tout = 0;
248 xfs_lsn_t last_pushed_lsn = *last_lsn; 249 xfs_lsn_t last_pushed_lsn = *last_lsn;
249 xfs_lsn_t target = ailp->xa_target; 250 xfs_lsn_t target = ailp->xa_target;
250 xfs_lsn_t lsn; 251 xfs_lsn_t lsn;
@@ -262,7 +263,7 @@ xfsaild_push(
262 */ 263 */
263 xfs_trans_ail_cursor_done(ailp, cur); 264 xfs_trans_ail_cursor_done(ailp, cur);
264 spin_unlock(&ailp->xa_lock); 265 spin_unlock(&ailp->xa_lock);
265 last_pushed_lsn = 0; 266 *last_lsn = 0;
266 return tout; 267 return tout;
267 } 268 }
268 269
@@ -279,7 +280,6 @@ xfsaild_push(
279 * prevents use from spinning when we can't do anything or there is 280 * prevents use from spinning when we can't do anything or there is
280 * lots of contention on the AIL lists. 281 * lots of contention on the AIL lists.
281 */ 282 */
282 tout = 10;
283 lsn = lip->li_lsn; 283 lsn = lip->li_lsn;
284 flush_log = stuck = count = 0; 284 flush_log = stuck = count = 0;
285 while ((XFS_LSN_CMP(lip->li_lsn, target) < 0)) { 285 while ((XFS_LSN_CMP(lip->li_lsn, target) < 0)) {
@@ -376,14 +376,14 @@ xfsaild_push(
376 376
377 if (!count) { 377 if (!count) {
378 /* We're past our target or empty, so idle */ 378 /* We're past our target or empty, so idle */
379 tout = 1000; 379 last_pushed_lsn = 0;
380 } else if (XFS_LSN_CMP(lsn, target) >= 0) { 380 } else if (XFS_LSN_CMP(lsn, target) >= 0) {
381 /* 381 /*
382 * We reached the target so wait a bit longer for I/O to 382 * We reached the target so wait a bit longer for I/O to
383 * complete and remove pushed items from the AIL before we 383 * complete and remove pushed items from the AIL before we
384 * start the next scan from the start of the AIL. 384 * start the next scan from the start of the AIL.
385 */ 385 */
386 tout += 20; 386 tout = 50;
387 last_pushed_lsn = 0; 387 last_pushed_lsn = 0;
388 } else if ((stuck * 100) / count > 90) { 388 } else if ((stuck * 100) / count > 90) {
389 /* 389 /*
@@ -395,11 +395,14 @@ xfsaild_push(
395 * Backoff a bit more to allow some I/O to complete before 395 * Backoff a bit more to allow some I/O to complete before
396 * continuing from where we were. 396 * continuing from where we were.
397 */ 397 */
398 tout += 10; 398 tout = 20;
399 } else {
400 /* more to do, but wait a short while before continuing */
401 tout = 10;
399 } 402 }
400 *last_lsn = last_pushed_lsn; 403 *last_lsn = last_pushed_lsn;
401 return tout; 404 return tout;
402} /* xfsaild_push */ 405}
403 406
404 407
405/* 408/*