From owner-svn-src-all@freebsd.org Sat Jul 9 01:27:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 643C6B8368B; Sat, 9 Jul 2016 01:27:09 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (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 1C7601967; Sat, 9 Jul 2016 01:27:09 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qk0-x22e.google.com with SMTP id s63so16170977qkb.2; Fri, 08 Jul 2016 18:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=JKrfAhdcMTZlR5H6GEf3m99AohtWgebSE6GOHpKM37w=; b=pTQRcekTY1x2eOC+d3SZSXJr91to2pLZfYCSS5v5I73zqbK5xDxZ8rnjmf7zfh/vGd qoeL4L90Vmi8RpgM90m5g7aBpEsI1XuD4l3WNoQwmP21VQdyUr9dLz8GUEgKj+XX5Bn7 6kS/zj4YcpIAuTn2W7/843TGMt8Nxpb8UmKeJZoXvNNghrdcyzn7SeR7MStrzVi4C9z7 qIOijkxOCXiDthB8SvwTJYTLY2nsYEMrnQ+t69YlZyv6UtMi5kL6Cbyr4rOSwYX4z3g1 PgosF3jFD/aVyLpFQANzqAChz0ROClDvq3qoUAIViK9ndDe9m5lMb2woCJ8wmlUYgl+1 W46w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=JKrfAhdcMTZlR5H6GEf3m99AohtWgebSE6GOHpKM37w=; b=CfywR58C4nz5jGKeMaY9X8kKWhrmFW18LWCVW43byiE59Ec6ztyvIOqPewg1MNNxxS wi7dvSKSys64PkeS9WBZ0dLX4y/ibq5UKlx0obEi3mDArFb6zED7CNQhv9KBB4Id6Tpy +NMQlQG3HtQ4Zlv9WirYee//NikSpw69RwmyNMXozGOjcwap3RDRmLfpmn9UdS49SU5G Depo2S0XMwC5rV10+Y9VgjVwyq9DIAQ6y8EGoweH6q6M6ew0v4R2XGDxBIopJGU6SQ1w Ah8WfYqtjCSoVFIa4PQRE3ZfpkwiVuOtDESj1W7ANiHZkxKL/czn3bJJW9nIKLw1Azq3 N0hA== X-Gm-Message-State: ALyK8tL1ScBuaIaqZvu1NW2lxiIsRRPNBwHtrqpXeYZ66UbaisIaWHKNd/0fCtiHUXVb/w== X-Received: by 10.55.108.2 with SMTP id h2mr11086823qkc.97.1468027628070; Fri, 08 Jul 2016 18:27:08 -0700 (PDT) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id 2sm558610qtg.24.2016.07.08.18.27.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Jul 2016 18:27:07 -0700 (PDT) Date: Fri, 8 Jul 2016 21:27:00 -0400 From: Alexander Kabaev To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302350 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20160708212700.23c870ef@kan> In-Reply-To: <201607051847.u65IlIYf000901@repo.freebsd.org> References: <201607051847.u65IlIYf000901@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/jur74YpWMTnfvmTEPLvJtsk"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Sat, 09 Jul 2016 01:27:09 -0000 --Sig_/jur74YpWMTnfvmTEPLvJtsk Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 5 Jul 2016 18:47:18 +0000 (UTC) Gleb Smirnoff wrote: > Author: glebius > Date: Tue Jul 5 18:47:17 2016 > New Revision: 302350 > URL: https://svnweb.freebsd.org/changeset/base/302350 >=20 > Log: > The paradigm of a callout is that it has three consequent states: > not scheduled -> scheduled -> running -> not scheduled. The API and > the manual page assume that, some comments in the code assume that, > and looks like some contributors to the code also did. The problem is > that this paradigm isn't true. A callout can be scheduled and running > at the same time, which makes API description ambigouous. In such > case callout_stop() family of functions/macros should return 1 and 0 > at the same time, since it successfully unscheduled future callout > but the current one is running. Before this change we returned 1 in > such a case, with an exception that if running callout was migrating > we returned 0, unless CS_MIGRBLOCK was specified. > =20 > With this change, we now return 0 in case if future callout was > unscheduled, but another one is still in action, indicating to API > users that resources are not yet safe to be freed. > =20 > However, the sleepqueue code relies on getting 1 return code in > that case, and there already was CS_MIGRBLOCK flag, that covered one > of the edge cases. In the new return path we will also use this flag, > to keep sleepqueue safe.=20 > Since the flag CS_MIGRBLOCK doesn't block migration and now isn't > limited to migration edge case, rename it to CS_EXECUTING. > =20 > This change fixes panics on a high loaded TCP server. > =20 > Reviewed by: jch, hselasky, rrs, kib > Approved by: re (gjb) > Differential Revision: https://reviews.freebsd.org/D7042 >=20 Hi, this change also breaks ARP reliably in my nfsroot setup for multiple MIPS board. The cause is following: before this change, the sequence of calls: callout_init(&la->lle_timer, 1); ret =3D callout_stop(&ls->lle_timer); would result in ret =3D=3D -1 after the change, same sequence causes callout_stop to return 1. This does not bode well for lle entries that were allocated, but for which callout_reset was never called, because we have several constructs in the source tree that do something like if (callout_stop(&lle->lle_timer) > 0) LLE_REMREF(lle); This results in panics as described in: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210884 --=20 Alexander Kabaev --Sig_/jur74YpWMTnfvmTEPLvJtsk Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJXgFLlXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+5RMQAMkElhWV+PiSKMvWfiUuLjUi XsNW30X8Pnp+/9BPM7uRfyVE2G9I4ZLjMuWk/AVvvPdGCMEgVxoyY9omhF4MsdW0 hh5DtTF53XxnK2hWjO9n/aAxOGm5aEOX5amb1/VGhZYIuyxWbq0FdM+voh2dYBTZ 5UPq5MnJ1JyluTdzX8nlIXLpj2/ho4bdvi4PVCCrVVp3KNyQ5MHPnso7E9557rEP JjTw/r1VhuZQVo+bEZADFem1XBUlw2hl8XSNze9rC73Yv5Mzog3KTvXCDYNnKNvX nHkLFEzi+5wHGwnRl1M30/RSjj9IxKbAJ9Q+k+EqPPCsIuh/r+GPQX5fJkAPuXrt SbXsQpRDAB0FL8uPz/U41TXqAJZZ5NM1PAytyrJieyLY3yey/Qf48enkx8fh3XFD nEcCsBNqaMrIlP7lEkRtCpUy3Vl6rWtpuXbXlBZGs0votvioWsV/BE1jJCgku6mT 1ArH6wy3P7EtTHD6qS/V0h4LQZKzaqp5GiwU3T/K9GFTcez6SmsJuS/o2hsAqou5 hXhZU0iZBf0yeN8dQxiCvZeidROxqWy9W7R6K0Yhc06XOIOMKSs+W8dbQW2XdKfV N91znJ1DnY1aLTfLUbK7HK708Kr8p/nFiYd9nWnhvt8ZsWgFSzNtK7UlcTBSnzd5 NWwPikMro836MdHzZF1V =MWjQ -----END PGP SIGNATURE----- --Sig_/jur74YpWMTnfvmTEPLvJtsk--