From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751479AbbJBVco (ORCPT ); Fri, 2 Oct 2015 17:32:44 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35583 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbbJBVcn (ORCPT ); Fri, 2 Oct 2015 17:32:43 -0400 Message-ID: <1443821560.32531.60.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: Soft lockup issue in Linux 4.1.9 From: Eric Dumazet To: Thomas Gleixner Cc: Eric Dumazet , Holger =?ISO-8859-1?Q?Hoffst=E4tte?= , "David S. Miller" , "Eric W. Biederman" , Stephen Hemminger , Greg Kroah-Hartman , LKML , stable@vger.kernel.org, netdev Date: Fri, 02 Oct 2015 14:32:40 -0700 In-Reply-To: References: <1443650383.13282.10.camel@daevel.fr> <560D1223.3070606@googlemail.com> <560D1C5A.3050508@googlemail.com> <1443819583.32531.55.camel@edumazet-glaptop2.roam.corp.google.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-10-02 at 23:04 +0200, Thomas Gleixner wrote: > On Fri, 2 Oct 2015, Eric Dumazet wrote: > > On Fri, 2015-10-02 at 22:04 +0200, Thomas Gleixner wrote: > > > > > What makes sure, that the timer cannot be readded while that timer > > > callback is running? > > > > What is exactly your question ? > > CPU0 CPU1 > > timer expires > callback > add timer > timer_pending() == true > ===> del_timer_sync() > > I was just curious how this is prevented as I got lost in the > networking code as usual :) Sure ;) I believe this can not happen for following reasons : mod_timer_pinned() is used only when req is created, while timer cannot possibly be running on the same req. The _pinned part is critical because we set the req->refcnt _after_ starting the timer, to avoid being visible and caught from rcu lookups in hash tables. Then, timer might be modified only by mod_timer_pending() from tcp_check_req() : This should not re-start timer if another cpu is in the timer callback. Thanks