Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jul 2016 17:44:20 +0200
From:      Randall Stewart <rrs@netflix.com>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r302998 - head/sys/kern
Message-ID:  <64C1543A-3EDE-4852-88EA-5B0B78FCF016@netflix.com>
In-Reply-To: <201607180929.u6I9T9Uw063705@repo.freebsd.org>
References:  <201607180929.u6I9T9Uw063705@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Gleb:

This now leaks TCP-PCB=E2=80=99s since you have broken the return codes =
with all your
fixes that used to be in here.

It was

return 1 =E2=80=94 You stopped the callout
return 0 =E2=80=94 The callout could not be stopped
return -1 =E2=80=94 The callout was not running.

The LLRef code that was crashing in in.c depended on this to know to =
free
the memory.. i.e. if was > 0 then they needed to free the memory.

TCP depends on a return 0 to indicate the async-drain function will be =
called back and
thus increments a refcnt and waits for the callback.

You now return 0 when no timer was active.. which makes the stack then =
wait
for the not forth coming async-drain call.

R
> On Jul 18, 2016, at 11:29 AM, Gleb Smirnoff <glebius@freebsd.org> =
wrote:
>=20
> Author: glebius
> Date: Mon Jul 18 09:29:08 2016
> New Revision: 302998
> URL: https://svnweb.freebsd.org/changeset/base/302998
>=20
> Log:
>  Revert the last commit. It must get more review and testing first.
>=20
> Modified:
>  head/sys/kern/kern_timeout.c
>=20
> Modified: head/sys/kern/kern_timeout.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/kern/kern_timeout.c	Mon Jul 18 09:26:06 2016	=
(r302997)
> +++ head/sys/kern/kern_timeout.c	Mon Jul 18 09:29:08 2016	=
(r302998)
> @@ -1381,7 +1381,7 @@ again:
> 		CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
> 		    c, c->c_func, c->c_arg);
> 		CC_UNLOCK(cc);
> -		return (-1);
> +		return (0);
> 	}
>=20
> 	c->c_iflags &=3D ~CALLOUT_PENDING;
>=20

--------
Randall Stewart
rrs@netflix.com
803-317-4952








Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64C1543A-3EDE-4852-88EA-5B0B78FCF016>