From owner-freebsd-current@FreeBSD.ORG Wed Apr 28 11:26:17 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8975116A4D0; Wed, 28 Apr 2004 11:26:17 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 715B143D58; Wed, 28 Apr 2004 11:26:17 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc11) with ESMTP id <2004042818261601300i4fdhe>; Wed, 28 Apr 2004 18:26:17 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA73682; Wed, 28 Apr 2004 11:26:15 -0700 (PDT) Date: Wed, 28 Apr 2004 11:26:14 -0700 (PDT) From: Julian Elischer To: John Baldwin In-Reply-To: <200404281329.16675.jhb@FreeBSD.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: "freebsd-current@freebsd.org" cc: Alex Lyashkov Subject: Re: code cleanup X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2004 18:26:17 -0000 On Wed, 28 Apr 2004, John Baldwin wrote: > On Wednesday 28 April 2004 02:26 am, Alex Lyashkov wrote: > > Hi All > > > > how i see many points at kernel work with allproc list direct, but > > proc.h introduce macros FOREACH_PROC_IN_SYSTEM. > > This patch clean this places. > > I'd actually rather see the FOREACH_PROC macro removed, I don't think hiding > the fact that it's a TAILQ is all that useful. it makes it possible (well, easier) to do: FOREACH_PROC_IN_SYSTEM(p) { FOREACH_KSEGROUP_IN_PROC(p, kg) { FOREACH_THREAD_IN_GROUP(kg.td) { something(td, kg); } } } Which is a lot easier to read and understand than the expanded version. You don't kave to remember the linkage pointer's names and you can add debugging to it and check that the correct loks are held etc. (the latter being a major reason I did it). > > -- > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve" = http://www.FreeBSD.org > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >