Re: [PATCHv2] backing-dev: fix wakeup timer races with bdi_unregister()

From: Namjae Jeon
Date: Fri Jan 20 2012 - 10:04:23 EST


>
> 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?

Hi Rabin.
I clearly understand. Thanks for your explanation.

Reviewed-by: Namjae Jeon <linkinjeon@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/