lkml.org 
[lkml]   [2012]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2] backing-dev: fix wakeup timer races with bdi_unregister()
On Fri, Jan 20, 2012 at 08:18:31PM +0900, Namjae Jeon wrote:
> The following case is not possible with racing of __mark_inode_dirty ?
> --------------------------------------------------------------------------------------------------
> spin_lock
> bdi->dev = NULL;
> spin_unlock
> spin_lock
> ......
> ......
> trace_writeback_wake_forker_thread(bdi);
> spin_unlock
> -----------------------------------------------------------------------------

After this patch, this is what wakeup_timer_fn looks like:

static void wakeup_timer_fn(unsigned long data)
{
struct backing_dev_info *bdi = (struct backing_dev_info *)data;

spin_lock_bh(&bdi->wb_lock);
if (bdi->wb.task) {
trace_writeback_wake_thread(bdi);
wake_up_process(bdi->wb.task);
} else if (bdi->dev) {
/*
* When bdi tasks are inactive for long time, they are killed.
* In this case we have to wake-up the forker thread which
* should create and run the bdi thread.
*/
trace_writeback_wake_forker_thread(bdi);
wake_up_process(default_backing_dev_info.wb.task);
}
spin_unlock_bh(&bdi->wb_lock);
}

So how will trace_writeback_wake_forker_thread() be called if bdi->dev is NULL?

This patch added the if (bdi->dev) check, perhaps you overlooked that?


\
 
 \ /
  Last update: 2012-01-20 13:13    [W:0.037 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site