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
[-- Attachment #1 --] 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 = *(u_char *)p" into "x = LEN(p)" makes locking easier? In the end: Yes it does! In this particular example I can easily tell what the new version does, while I wouldn't be able to tell it from the first (w/o context). It just way easier to read, keeping it obscure as all the other 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 brave who happen to know <your_network_subsystem_here> from top to bottom and can easily tell what "x = *(u_char *)p" is supposed to mean, but we have some who have a good idea how to do locking. The changes Luigi is trying to do, should enable better readability of the network code to make it possible for others 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 read and understand. And honest, when one sees the current radix code (etc.), the first thing that comes to mind is "run!". Same applies to IPv6/KAME-code, btw - and I didn't see anybody to work on the locking there and I know a reason why. -- Best regards, | mlaier@freebsd.org Max Laier | ICQ #67774661 http://pf4freebsd.love2party.net/ | mlaier@EFnet [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAhzUhXyyEoT62BG0RAuv6AJ9y7lsZZuRsXmTa8tJJo/nbEYjc6ACeOFu3 EOi/dlbKDG/KLlC338qCXpo= =y/kc -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404220259.45651.max>
