From owner-svn-src-head@FreeBSD.ORG Thu May 29 03:42:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADE45DC8; Thu, 29 May 2014 03:42:48 +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 301EE24DE; Thu, 29 May 2014 03:42:47 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4T3ghGa087522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 May 2014 07:42:43 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4T3ghVL087521; Thu, 29 May 2014 07:42:43 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 29 May 2014 07:42:43 +0400 From: Gleb Smirnoff To: Julian Elischer Subject: Re: svn commit: r266806 - head/sys/netgraph Message-ID: <20140529034243.GR50679@FreeBSD.org> References: <201405281315.s4SDFEvc061176@svn.freebsd.org> <5385EED0.1010506@freebsd.org> <20140528145619.GM50679@FreeBSD.org> <538603A3.7080303@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <538603A3.7080303@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, dmitryluhtionov@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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: Thu, 29 May 2014 03:42:48 -0000 On Wed, May 28, 2014 at 11:41:23PM +0800, Julian Elischer wrote: J> On 5/28/14, 10:56 PM, Gleb Smirnoff wrote: J> > On Wed, May 28, 2014 at 10:12:32PM +0800, Julian Elischer wrote: J> > J> On 5/28/14, 9:15 PM, Gleb Smirnoff wrote: J> > J> > Author: glebius J> > J> > Date: Wed May 28 13:15:14 2014 J> > J> > New Revision: 266806 J> > J> > URL: http://svnweb.freebsd.org/changeset/base/266806 J> > J> > J> > J> > Log: J> > J> > Use M_WAITOK for the NGM_PIPE_SET_CFG control message. We expect it to J> > J> > arrive from userland only. J> > J> > J> > J> > Submitted by: Dmitry Luhtionov J> > J> what's to stop another node from generating it and sending it on? J> > J> generally a message may come from anywhere. J> > J> Just becasue YOU don't have module that J> > J> sends messages to ng_pipe, doesn't mean there never will be.. J> > J> also there are cases when the locking may force a message to be J> > J> delivered asynchronously. J> > J> > I know that. After resolving many issues with netgraph, I feel that J> > our policy should be towards putting some invariants on what events J> > SHOULD come from userland only and which events SHOULD be serviced J> > without memory failures. J> > J> > Current paradigma that messages are fully symmetrical and can come J> > from anywhere are quite a curious thought experiment. I liked that J> > for a long time. But in practice if we want to build a robust software J> > we should make more strict rules of using it. J> > J> > You could disagree, but if you try to fix this particular one liner J> > in the paradigma of "messages come from anywhere", then you will end J> > up with smth like 20 lines of code to this particular module. Next J> > comes the need to fix any software or script that sends NGM_PIPE_SET_CFG, J> > it now should be taught of dealing with ENOMEM. So, instead of one J> > liner you will bury yourself under tons of work. J> > J> > J> Then I suggest that we increment the protocol, and add support to messages J> to say whether they come from user space. J> and some providers only accept such messages. J> J> I have lost track of the code so I don't know if my comment about J> messages getting queued instead of delivered is still true. J> However if it is, then a message could be delivered by a kernel agent J> even J> if it is initiated by a userspace program. I don't think we need to increment protocol. Does it change? Right now we have a de facto standard, that some messages are expected from userland only. It is not enforced, it is just a habit. We should just keep this direction. -- Totus tuus, Glebius.