Date: Thu, 24 May 2007 21:26:57 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Attilio Rao <attilio@freebsd.org> Cc: alc@freebsd.org, arch@freebsd.org, Jeff Roberson <jeff@freebsd.org> Subject: Re: sched_lock && thread_lock() Message-ID: <20070524210030.J36089@besplex.bde.org> In-Reply-To: <4655C67A.9060000@FreeBSD.org> References: <20070520155103.K632@10.0.0.1> <20070521113648.F86217@besplex.bde.org> <20070520213132.K632@10.0.0.1> <4651CAB8.8070007@FreeBSD.org> <4651CE2F.8080908@FreeBSD.org> <20070521022847.D679@10.0.0.1> <20070521195811.G56785@delplex.bde.org> <4651FCB5.7070604@FreeBSD.org> <20070521225032.C57233@delplex.bde.org> <20070522162819.N5249@besplex.bde.org> <20070522201336.C87981@besplex.bde.org> <46533CAD.8030104@FreeBSD.org> <4655C67A.9060000@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 24 May 2007, Attilio Rao wrote: > Hello, > Let me know if this patch is right for you and if you have feedbacks, > comments, etc: > http://users.gufi.org/~rookie/works/patches/schedlock/vmmeter3.diff > > This should fix translation errors Bruce has found and switching the _SET() > method in order to being a simple assignment (as Bruce has suggested). OK. Note that I won't be really happy until the macros and volatiles go away. But keep at least the macros for development. The volatiles are easier to remove: put them in the access macros instead of putting them in the declarations and cancelling them in the access macros where they are most needed. This would leave them broken in the access macros where they are most needed, the same as now (since the sysctl macros just don't support volatile, they must be cancelled now and cannot be added). Note that we use this method for almost all "volatile" variables in the kernel -- we don't declare quite enough things volatile, but we add volatiles in the atomic function calls and depend on a combination of atomic accesses and locking to avoid races. It is easy to get this wrong, but if we get it wrong then declaring things volatile only reduces the races. I forgot to mention another easy-to-fix bug: missing parentheses around the `val' arg in macro definitions. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070524210030.J36089>