Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208333
b: refs/heads/master
c: 94eac5e
h: refs/heads/master
i:
  208331: 57461c8
v: v3
  • Loading branch information
Artem Bityutskiy authored and Jens Axboe committed Aug 7, 2010
1 parent 9cab51e commit 52f347f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 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: 6f904ff0e39ea88f81eb77e8dfb4e1238492f0a8
refs/heads/master: 94eac5e62364df4e605e451218ee6024a7ba664f
28 changes: 11 additions & 17 deletions trunk/mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ static int bdi_forker_thread(void *ptr)
set_user_nice(current, 0);

for (;;) {
struct task_struct *task;
struct backing_dev_info *bdi, *tmp;
struct bdi_writeback *wb;

/*
* Temporary measure, we want to make sure we don't see
Expand Down Expand Up @@ -383,29 +383,23 @@ static int bdi_forker_thread(void *ptr)
list_del_init(&bdi->bdi_list);
spin_unlock_bh(&bdi_lock);

wb = &bdi->wb;
wb->task = kthread_run(bdi_writeback_thread, wb, "flush-%s",
dev_name(bdi->dev));
/*
* If thread creation fails, then readd the bdi to
* the pending list and force writeout of the bdi
* from this forker thread. That will free some memory
* and we can try again.
*/
if (IS_ERR(wb->task)) {
wb->task = NULL;

task = kthread_run(bdi_writeback_thread, &bdi->wb, "flush-%s",
dev_name(bdi->dev));
if (IS_ERR(task)) {
/*
* Add this 'bdi' to the back, so we get
* a chance to flush other bdi's to free
* memory.
* If thread creation fails, then readd the bdi back to
* the list and force writeout of the bdi from this
* forker thread. That will free some memory and we can
* try again. Add it to the tail so we get a chance to
* flush other bdi's to free memory.
*/
spin_lock_bh(&bdi_lock);
list_add_tail(&bdi->bdi_list, &bdi_pending_list);
spin_unlock_bh(&bdi_lock);

bdi_flush_io(bdi);
}
} else
bdi->wb.task = task;
}

return 0;
Expand Down

0 comments on commit 52f347f

Please sign in to comment.