From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 20:55:06 2015 Return-Path: Delivered-To: svn-src-head@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 AE84A26E; Wed, 8 Apr 2015 20:55:06 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CF9C8B3; Wed, 8 Apr 2015 20:55:05 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t38Kt18u015959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 8 Apr 2015 23:55:01 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t38Kt1Bi015958; Wed, 8 Apr 2015 23:55:01 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 8 Apr 2015 23:55:01 +0300 From: Gleb Smirnoff To: "George V. Neville-Neil" Subject: Re: svn commit: r281276 - head/sys/net Message-ID: <20150408205501.GW64665@FreeBSD.org> References: <201504082025.t38KPqU0019878@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201504082025.t38KPqU0019878@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2015 20:55:06 -0000 On Wed, Apr 08, 2015 at 08:25:51PM +0000, George V. Neville-Neil wrote: G> Author: gnn G> Date: Wed Apr 8 20:25:51 2015 G> New Revision: 281276 G> URL: https://svnweb.freebsd.org/changeset/base/281276 G> G> Log: G> Add support for a netisr polling tunable, which allows run time switching of G> device polling rather than having it only be controlled by the compile G> time option. G> G> Summary: Rubicon Communications (Netgate) G> Reviewers: #network, hiren G> Reviewed By: #network, hiren G> Subscribers: hiren G> Differential Revision: https://reviews.freebsd.org/D2258 You gave very short time to review it :( First, the sysctl namespace for device polling is kern.polling. The polling(4) has two additional (to hardclock) modes of polling: netisr polling and idle polling. The idle polling was always contolled by sysctl in kern.polling namespace. Thus, the new sysctl should reside in this namespace. The second important thing is whether sysctl isn't needed at all? What does Rubicon Communications (Netgate) need to achieve? My guess is that they got DEVICE_POLLING in the kernel, but zero interfaces with the IFCAP_POLLING bit set. And they don't want the poll_mtx to be locked routinely. If my guess is true, then the patch should be simple reverted, and in the kern/kern_poll.c, in the netisr_poll() and netisr_pollmore() there should be put: if (poll_handlers == 0) return; And that's all. Note that this is already done for hardclock polling. Accessing this value without poll_mtx held is entirely okay, since we don't care about a race on enabling/disabling polling for NIC. If my guess is wrong, and Rubicon Communications (Netgate) want to run hardclock polling, but have netisr polling disabled, then again the patch should be reverted, and then re-applied to kern_poll.c, moving the netisr_polling variable there and the checks as well, and fixing sysctl namespace. -- Totus tuus, Glebius.