Date: Thu, 22 Apr 2004 02:59:38 +0000 From: Max Laier <max@love2party.net> To: Darren Reed <darrenr@hub.freebsd.org> Cc: Colin Percival <colin.percival@wadham.ox.ac.uk> Subject: Re: cvs commit: src/sys/net radix.c Message-ID: <200404220259.45651.max@love2party.net> In-Reply-To: <20040422002143.GC60368@hub.freebsd.org> References: <200404211527.i3LFRabS088245@repoman.freebsd.org> <6.0.1.1.1.20040422005919.03afaaa0@imap.sfu.ca> <20040422002143.GC60368@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--Boundary-02=_hUzhAUHD/cpQ2Kx Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 22 April 2004 00:21, Darren Reed wrote: > On Thu, Apr 22, 2004 at 01:03:42AM +0100, Colin Percival wrote: > > At 00:24 22/04/2004, Darren Reed wrote: > > >Some of these changes, for the sake of change, can be annoying... > > > > As Luigi mentioned when he started this, these aren't changes "for the > > sake of change"; rather, these are changes to clean things up so that it > > is easier to add all the necessary locking. > > Uh, really? > Changing variable names is required to make locking easier? > Changing "x =3D *(u_char *)p" into "x =3D LEN(p)" makes locking easier? In the end: Yes it does! In this particular example I can easily tell what = the=20 new version does, while I wouldn't be able to tell it from the first (w/o=20 context). It just way easier to read, keeping it obscure as all the other=20 BSDs have it this way and it was this way for years is just baloney. To put some emphasis on why this will help locking, we don't have many brav= e=20 who happen to know <your_network_subsystem_here> from top to bottom and can= =20 easily tell what "x =3D *(u_char *)p" is supposed to mean, but we have some= who=20 have a good idea how to do locking. The changes Luigi is trying to do, shou= ld=20 enable better readability of the network code to make it possible for other= s=20 to lock things down. I find readable code a good thing (even if it does not help locking). > In the end, if someone decides that the code needs to be restructured > for better performance in SMP hardware, then that's what'll happen and > changes like these will have little significance at that point in time. I don't think so. It's much easier to restructure code you can actually rea= d=20 and understand. And honest, when one sees the current radix code (etc.), th= e=20 first thing that comes to mind is "run!". Same applies to IPv6/KAME-code, b= tw=20 =2D and I didn't see anybody to work on the locking there and I know a reas= on=20 why. =2D-=20 Best regards, | mlaier@freebsd.org Max Laier | ICQ #67774661 http://pf4freebsd.love2party.net/ | mlaier@EFnet --Boundary-02=_hUzhAUHD/cpQ2Kx Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAhzUhXyyEoT62BG0RAuv6AJ9y7lsZZuRsXmTa8tJJo/nbEYjc6ACeOFu3 EOi/dlbKDG/KLlC338qCXpo= =y/kc -----END PGP SIGNATURE----- --Boundary-02=_hUzhAUHD/cpQ2Kx--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404220259.45651.max>