From owner-svn-src-all@FreeBSD.ORG Thu Jun 11 13:18:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A824FA15 for ; Thu, 11 Jun 2015 13:18:20 +0000 (UTC) (envelope-from julien@jch.io) Received: from mail-qc0-f180.google.com (mail-qc0-f180.google.com [209.85.216.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66A9D1951 for ; Thu, 11 Jun 2015 13:18:19 +0000 (UTC) (envelope-from julien@jch.io) Received: by qcej9 with SMTP id j9so1914718qce.1 for ; Thu, 11 Jun 2015 06:18:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=ueoUyRDaTj8N9BbD0SRdP6MJothQeLL2buAC5r8iXu8=; b=bMp5mYlxLZ+5jdu1nrBe9s7vOaBNd7CNaBRbVBW0TQX9StvWAwNpHeSzAVHc0YGH5d Gs7VklvGdRghGnwxpu6fq3xGeJExmaYj5GgCkeLJWPgbr+vDs954sRanSnSXLO5sFbjO Ge5m092KVbahgh4DHwElYSym3J4DijtVKn6hnDtYuRlx/SklbsMI0aNsKitJntcNwKar cqj78MM/4rhr8h/XjcL1ShN0ggzWkg1H9JJletnHH42AOH6K69v1LklxoHs8qPMYalks AS3xRVivibKESK29+JFDAAIXayVceHXGQY3bz6hLpXsi/yszN5KPnQh4M8F5waWyDK9Z KEpw== X-Gm-Message-State: ALoCoQkqqQ2XazYo4yjyOdIAzOBkJrsai6Owx6GlSr8jy8jnGbBP7rD0fH+E+SPmLFiJwdzGePdZ X-Received: by 10.140.94.116 with SMTP id f107mr11082528qge.101.1434028698333; Thu, 11 Jun 2015 06:18:18 -0700 (PDT) Received: from FRI2JCHARBON-M1.local (h87.s239.verisign.com. [216.168.239.87]) by mx.google.com with ESMTPSA id j143sm233224qhc.32.2015.06.11.06.18.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 06:18:17 -0700 (PDT) Message-ID: <55798A8F.3080308@freebsd.org> Date: Thu, 11 Jun 2015 09:18:07 -0400 From: Julien Charbon User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284245 - head/sys/netinet References: <201506102043.t5AKh8YB058825@svn.freebsd.org> <5578ACEC.2070209@FreeBSD.org> In-Reply-To: <5578ACEC.2070209@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WHPKl0evAFXGXOSuORv2QMg5aobn7U5eH" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2015 13:18:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WHPKl0evAFXGXOSuORv2QMg5aobn7U5eH Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi John, On 10/06/15 17:32, John Baldwin wrote: > On 6/10/15 4:43 PM, Julien Charbon wrote: >> Author: jch >> Date: Wed Jun 10 20:43:07 2015 >> New Revision: 284245 >> URL: https://svnweb.freebsd.org/changeset/base/284245 >> >> Log: >> Fix a callout race condition introduced in TCP timers callouts with = r281599. >> In TCP timer context, it is not enough to check callout_stop() retur= n value >> to decide if a callout is still running or not, previous callout_res= et() >> return values have also to be checked. >> =20 >> Differential Revision: https://reviews.freebsd.org/D2763 >> Reviewed by: hiren >> Approved by: hiren >> MFC after: 1 day >> Sponsored by: Verisign, Inc. >> >> Modified: >> head/sys/netinet/tcp_timer.c >> head/sys/netinet/tcp_timer.h >> >> Modified: head/sys/netinet/tcp_timer.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/netinet/tcp_timer.c Wed Jun 10 20:11:28 2015 (r284244) >> +++ head/sys/netinet/tcp_timer.c Wed Jun 10 20:43:07 2015 (r284245) >> @@ -347,11 +347,12 @@ tcp_timer_2msl(void *xtp) >> tp =3D tcp_close(tp); =20 >> } else { >> if (tp->t_state !=3D TCPS_TIME_WAIT && >> - ticks - tp->t_rcvtime <=3D TP_MAXIDLE(tp)) >> - callout_reset_on(&tp->t_timers->tt_2msl, >> - TP_KEEPINTVL(tp), tcp_timer_2msl, tp, >> - inp_to_cpuid(inp)); >> - else >> + ticks - tp->t_rcvtime <=3D TP_MAXIDLE(tp)) { >> + if (!callout_reset(&tp->t_timers->tt_2msl, >> + TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) { >> + tp->t_timers->tt_flags &=3D ~TT_2MSL_RST; >> + } >> + } else >> tp =3D tcp_close(tp); >=20 > Did you mean to use callout_reset() instead of callout_reset_on() here = and > elsewhere in this change? Thanks for this question. Exactly, the goal here is to make clear that once a TCP timer callout is scheduled on a core, we always reset this callout on the same core. It was already the case before, but having only one callout_reset_on() call in tcp_timer_activate() when we start callout the first time, and callout_reset() calls everywhere else make it (hopefully) clearer. My 2 cents. -- Julien --WHPKl0evAFXGXOSuORv2QMg5aobn7U5eH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJVeYqYAAoJEKVlQ5Je6dhx400H/20EQhfM69CwW5ZmhYHGhCTg cfubDWC9tfm5ipd6nzPw1Fp0ILp0Lk/BGvp0q7dFbY35kt5aRBbiY6sV7W6GJrge Vf0g5zA06M37vHGZ8MK5GXcynWfX4GaXfvIvd99WLg4Hwj77YZLyMFSBfBFYA7be IvDJ956k3fc9w7wve5RUgkXgAXCiedsJQYDxZlUMb9FgUq23qQpTup+Gnc36t4qa X8YWrQuMJhbP59/hCcp3jRfqy8dEpbLSO44SiKQlcSCPZ7OYiODKgK2lobO9YXqA EklPVNiWVEPiIPmoKUYayrNSGoGKvcB8CwFPzZ3XM5IzluG1W5n+O6Xl0jT9UBQ= =L5Rs -----END PGP SIGNATURE----- --WHPKl0evAFXGXOSuORv2QMg5aobn7U5eH--