Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264030
b: refs/heads/master
c: 5a042aa
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara authored and Jens Axboe committed Sep 2, 2011
1 parent 4c72527 commit b1913c7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 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: 56ebdaf2fa3c5276be201c5d1aff1490b682ecf2
refs/heads/master: 5a042aa4b8e994a15d2c2ee750219971f0ab3905
23 changes: 14 additions & 9 deletions trunk/mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,17 @@ static unsigned long bdi_longest_inactive(void)
return max(5UL * 60 * HZ, interval);
}

/*
* Clear pending bit and wakeup anybody waiting for flusher thread creation or
* shutdown
*/
static void bdi_clear_pending(struct backing_dev_info *bdi)
{
clear_bit(BDI_pending, &bdi->state);
smp_mb__after_clear_bit();
wake_up_bit(&bdi->state, BDI_pending);
}

static int bdi_forker_thread(void *ptr)
{
struct bdi_writeback *me = ptr;
Expand Down Expand Up @@ -469,11 +480,13 @@ static int bdi_forker_thread(void *ptr)
spin_unlock_bh(&bdi->wb_lock);
wake_up_process(task);
}
bdi_clear_pending(bdi);
break;

case KILL_THREAD:
__set_current_state(TASK_RUNNING);
kthread_stop(task);
bdi_clear_pending(bdi);
break;

case NO_ACTION:
Expand All @@ -489,16 +502,8 @@ static int bdi_forker_thread(void *ptr)
else
schedule_timeout(msecs_to_jiffies(dirty_writeback_interval * 10));
try_to_freeze();
/* Back to the main loop */
continue;
break;
}

/*
* Clear pending bit and wakeup anybody waiting to tear us down.
*/
clear_bit(BDI_pending, &bdi->state);
smp_mb__after_clear_bit();
wake_up_bit(&bdi->state, BDI_pending);
}

return 0;
Expand Down

0 comments on commit b1913c7

Please sign in to comment.