From owner-p4-projects@FreeBSD.ORG Thu Oct 18 22:45:09 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 681DD16A41B; Thu, 18 Oct 2007 22:45:09 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF8ED16A419 for ; Thu, 18 Oct 2007 22:45:08 +0000 (UTC) (envelope-from zec@icir.org) Received: from xaqua.tel.fer.hr (xaqua.tel.fer.hr [161.53.19.25]) by mx1.freebsd.org (Postfix) with ESMTP id AABFC13C44B for ; Thu, 18 Oct 2007 22:45:08 +0000 (UTC) (envelope-from zec@icir.org) Received: by xaqua.tel.fer.hr (Postfix, from userid 20006) id 96BFE9B742; Fri, 19 Oct 2007 00:45:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on xaqua.tel.fer.hr X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.7 Received: from [192.168.200.100] (zec2.tel.fer.hr [161.53.19.79]) by xaqua.tel.fer.hr (Postfix) with ESMTP id 96D419B6F6; Fri, 19 Oct 2007 00:45:06 +0200 (CEST) From: Marko Zec To: Julian Elischer Date: Fri, 19 Oct 2007 00:44:58 +0200 User-Agent: KMail/1.9.7 References: <200710172258.l9HMw33S061205@repoman.freebsd.org> <4716BB87.1040004@elischer.org> In-Reply-To: <4716BB87.1040004@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710190044.59319.zec@icir.org> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 127639 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2007 22:45:09 -0000 On Thursday 18 October 2007 03:48:55 Julian Elischer wrote: ... > > + INIT_VPROCG(TD_TO_VPROCG(curthread)); > > > > + INIT_VNET_NET(TD_TO_VNET(curthread)); > > might not they be further macroised as: > > #define VNET_FROM_TD(_td) INIT_VNET_NET(TD_TO_VNET(_td)) > #define VPROCG_FROM_TD(_td) INIT_VPROCG(TD_TO_VPROCG(_td)) In general I think we should avoid as much as possible to resolve vnet context from curthread whenever possible, i.e. where we have a socket or ifnet or inpcb at hand this should be our primary source of vnet context instead. Some people have already expressed concerns about the extensiveness of curthread macro use in vimage branch and it may happen that at some point we might wish to abandon such an implicit method of vnet context passing along the function call graph alltogether. Introducing a macro that resolves vnet from thread directly might encourage programmers to take that path as granted, i.e. let one think that this is something OK to do, which it is probably not. Hence, I wouldn't rush with introducing such a macro (or a whole family of macros)... Cheers, Marko > etc. > > not a requirement.. just a comment.