Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752078AbbHQSdb (ORCPT ); Mon, 17 Aug 2015 14:33:31 -0400 Received: from vserver.eikelenboom.it ([84.200.39.61]:51051 "EHLO smtp.eikelenboom.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028AbbHQSd2 (ORCPT ); Mon, 17 Aug 2015 14:33:28 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 17 Aug 2015 20:27:42 +0200 From: Sander Eikelenboom To: Eric Dumazet Cc: Thomas Gleixner , Jon Christopherson , David Miller , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, xen-devel@lists.xen.org, david.vrabel@citrix.com Subject: Re: Linux 4.2-rc6 regression: RIP: e030:[] [] =?UTF-8?Q?detach=5Fif=5Fpending+=30x=31=38/=30x=38?= =?UTF-8?Q?=30?= In-Reply-To: <1439831928.32680.11.camel@edumazet-glaptop2.roam.corp.google.com> References: <7c39e6332aae572372108d5fd68c503b@eikelenboom.it> <1439412094.29802.21.camel@edumazet-glaptop2.roam.corp.google.com> <0de9f30086ee2e662bdafee61d24b3c1@eikelenboom.it> <20150812.144040.1151964094247340464.davem@davemloft.net> <1439419279.29802.25.camel@edumazet-glaptop2.roam.corp.google.com> <3b284689aaa1573610c0e388e66e756a@eikelenboom.it> <1439591965.7507.6.camel@edumazet-glaptop2.roam.corp.google.com> <963062024.20150817110956@eikelenboom.it> <1439818633.7258.16.camel@edumazet-glaptop2.roam.corp.google.com> <196897465.20150817154802@eikelenboom.it> <55D1E97B.6090309@jons.org> <1439821307.7258.20.camel@edumazet-glaptop2.roam.corp.google.com> <373726164.20150817162534@eikelenboom.it> <1439831928.32680.11.camel@edumazet-glaptop2.roam.corp.google.com> Message-ID: User-Agent: Roundcube Webmail/0.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2595 Lines: 78 On 2015-08-17 19:18, Eric Dumazet wrote: > From: Eric Dumazet > > On Mon, 2015-08-17 at 16:25 +0200, Sander Eikelenboom wrote: >> Monday, August 17, 2015, 4:21:47 PM, you wrote: >> >> > On Mon, 2015-08-17 at 09:02 -0500, Jon Christopherson wrote: >> >> This is very similar to the behavior I am seeing in this bug: >> >> >> >> https://bugzilla.kernel.org/show_bug.cgi?id=102911 >> >> > OK, but have you applied the fix ? >> >> > http://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=83fccfc3940c4a2db90fd7e7079f5b465cd8c6af >> >> > It will be part of net iteration from David Miller to Linus Torvald. >> >> >> I did have that patch in for my last report. >> But i don't think he had (looking at the second part of his oops). >> > > Then can you try following fix as well ? > > Thanks ! Running now :) > > [PATCH] timer: fix a race in __mod_timer() > > lock_timer_base() can not catch following : > > CPU1 ( in __mod_timer() > timer->flags |= TIMER_MIGRATING; > spin_unlock(&base->lock); > base = new_base; > spin_lock(&base->lock); > timer->flags &= ~TIMER_BASEMASK; > CPU2 (in lock_timer_base()) > see timer base is cpu0 base > spin_lock_irqsave(&base->lock, > *flags); > if (timer->flags == tf) > return base; // oops, wrong base > timer->flags |= base->cpu // too late > > We must write timer->flags in one go, otherwise we can fool other cpus. > > Fixes: bc7a34b8b9eb ("timer: Reduce timer migration overhead if > disabled") > Signed-off-by: Eric Dumazet > Cc: Thomas Gleixner > --- > kernel/time/timer.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/time/timer.c b/kernel/time/timer.c > index 5e097fa9faf7..84190f02b521 100644 > --- a/kernel/time/timer.c > +++ b/kernel/time/timer.c > @@ -807,8 +807,8 @@ __mod_timer(struct timer_list *timer, unsigned long > expires, > spin_unlock(&base->lock); > base = new_base; > spin_lock(&base->lock); > - timer->flags &= ~TIMER_BASEMASK; > - timer->flags |= base->cpu; > + WRITE_ONCE(timer->flags, > + (timer->flags & ~TIMER_BASEMASK) | base->cpu); > } > } -- 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/