Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181780
b: refs/heads/master
c: c9c1297
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Alex Elder committed Jan 15, 2010
1 parent 8580b0c commit f8652d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 453eac8a9aa417878a38bdfbccafd5f7ce4e8e4e
refs/heads/master: c9c129714e71c890bed1bd5b61697a896c3c2d54
20 changes: 15 additions & 5 deletions trunk/fs/xfs/linux-2.6/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,11 @@ xfs_buf_delwri_queue(
list_del(&bp->b_list);
}

if (list_empty(dwq)) {
/* start xfsbufd as it is about to have something to do */
wake_up_process(bp->b_target->bt_task);
}

bp->b_flags |= _XBF_DELWRI_Q;
list_add_tail(&bp->b_list, dwq);
bp->b_queuetime = jiffies;
Expand Down Expand Up @@ -1644,6 +1649,8 @@ xfsbufd_wakeup(
list_for_each_entry(btp, &xfs_buftarg_list, bt_list) {
if (test_bit(XBT_FORCE_SLEEP, &btp->bt_flags))
continue;
if (list_empty(&btp->bt_delwrite_queue))
continue;
set_bit(XBT_FORCE_FLUSH, &btp->bt_flags);
wake_up_process(btp->bt_task);
}
Expand Down Expand Up @@ -1708,19 +1715,22 @@ xfsbufd(
set_freezable();

do {
long age = xfs_buf_age_centisecs * msecs_to_jiffies(10);
long tout = xfs_buf_timer_centisecs * msecs_to_jiffies(10);

if (unlikely(freezing(current))) {
set_bit(XBT_FORCE_SLEEP, &target->bt_flags);
refrigerator();
} else {
clear_bit(XBT_FORCE_SLEEP, &target->bt_flags);
}

schedule_timeout_interruptible(
xfs_buf_timer_centisecs * msecs_to_jiffies(10));

xfs_buf_delwri_split(target, &tmp,
xfs_buf_age_centisecs * msecs_to_jiffies(10));
/* sleep for a long time if there is nothing to do. */
if (list_empty(&target->bt_delwrite_queue))
tout = MAX_SCHEDULE_TIMEOUT;
schedule_timeout_interruptible(tout);

xfs_buf_delwri_split(target, &tmp, age);
count = 0;
while (!list_empty(&tmp)) {
bp = list_entry(tmp.next, xfs_buf_t, b_list);
Expand Down

0 comments on commit f8652d3

Please sign in to comment.