Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755738AbbKDLsm (ORCPT ); Wed, 4 Nov 2015 06:48:42 -0500 Received: from mail-qg0-f43.google.com ([209.85.192.43]:34965 "EHLO mail-qg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754162AbbKDLsk (ORCPT ); Wed, 4 Nov 2015 06:48:40 -0500 Date: Wed, 4 Nov 2015 06:48:36 -0500 From: Jeff Layton To: Tejun Heo Cc: Chris Worley , linux-kernel@vger.kernel.org, bfields@fieldses.org, Michael Skralivetsky , Trond Myklebust , Shaohua Li Subject: Re: timer code oops when calling mod_delayed_work Message-ID: <20151104064836.661b0e01@tlielax.poochiereds.net> In-Reply-To: <20151104000658.GH5749@mtj.duckdns.org> References: <20151029135836.02ad9000@synchrony.poochiereds.net> <20151031020012.GH3582@mtj.duckdns.org> <20151031073400.2cf05d77@tlielax.poochiereds.net> <20151031213107.GA23841@mtj.duckdns.org> <20151031175404.3c57a17a@tlielax.poochiereds.net> <20151102145633.5329f3da@tlielax.poochiereds.net> <20151102203339.7ed8f2bb@synchrony.poochiereds.net> <20151103125504.6649138f@tlielax.poochiereds.net> <20151103225405.GG5749@mtj.duckdns.org> <20151104000658.GH5749@mtj.duckdns.org> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1550 Lines: 48 On Tue, 3 Nov 2015 19:06:58 -0500 Tejun Heo wrote: > Hello, Jeff. > > Can you please verify whether the following patch fixes the issue? > > Thanks. > > diff --git a/kernel/time/timer.c b/kernel/time/timer.c > index 84190f0..566a282 100644 > --- a/kernel/time/timer.c > +++ b/kernel/time/timer.c > @@ -970,12 +970,21 @@ EXPORT_SYMBOL(add_timer); > */ > void add_timer_on(struct timer_list *timer, int cpu) > { > - struct tvec_base *base = per_cpu_ptr(&tvec_bases, cpu); > + struct tvec_base *new_base = per_cpu_ptr(&tvec_bases, cpu); > + struct tvec_base *base; > unsigned long flags; > > timer_stats_timer_set_start_info(timer); > BUG_ON(timer_pending(timer) || !timer->function); > - spin_lock_irqsave(&base->lock, flags); > + > + base = lock_timer_base(timer, &flags); > + if (base != new_base) { > + timer->flags |= TIMER_MIGRATING; > + spin_unlock(&base->lock); > + base = new_base; > + spin_lock(&base->lock); > + } > + > timer->flags = (timer->flags & ~TIMER_BASEMASK) | cpu; > debug_activate(timer, timer->expires); > internal_add_timer(base, timer); Yes, thanks! That fixes my reproducer and Chris also said he was unable to reproduce the bug after applying that patch. You can add this if you like: Tested-by: Jeff Layton -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/