Re: [lkp] [mm, vmstat] 373ccbe592: BUG: unable to handle kernel

From: Ben Hutchings
Date: Sun Jan 17 2016 - 21:27:23 EST


On Fri, 2016-01-08 at 19:32 +0900, Tetsuo Handa wrote:
[...]
> Thank you. I think that start_shepherd_timer() started shepherd item
> and vmstat_shepherd() is called before vmstat_wq = alloc_workqueue() is
> called. We are sometimes too late to allocate vmstat_wq workqueue.
> Please try below one.
>
> ----------
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index 4ebc17d..6478929 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -1545,12 +1545,12 @@ static struct notifier_block vmstat_notifier =
> Âstatic int __init setup_vmstat(void)
> Â{
> Â#ifdef CONFIG_SMP
> + vmstat_wq = alloc_workqueue("vmstat", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
> Â cpu_notifier_register_begin();
> Â __register_cpu_notifier(&vmstat_notifier);
> Â
> Â start_shepherd_timer();
> Â cpu_notifier_register_done();
> - vmstat_wq = alloc_workqueue("vmstat", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
> Â#endif
> Â#ifdef CONFIG_PROC_FS
> Â proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);
> ----------
>
> We need to backport this fix to stable since this commit already went to 3.2.75.

Thanks. ÂIn 3.2.75 this precise race doesn't seem to exist, but I did
put the alloc_workqueue() after register_cpu_notifier() whereas it
should go before.

Ben.

--
Ben Hutchings
A free society is one where it is safe to be unpopular. - Adlai Stevenson

Attachment: signature.asc
Description: This is a digitally signed message part