From owner-freebsd-current Thu Aug 19 11: 9: 3 1999 Delivered-To: freebsd-current@freebsd.org Received: from cygnus.rush.net (cygnus.rush.net [209.45.245.133]) by hub.freebsd.org (Postfix) with ESMTP id ACD1015081; Thu, 19 Aug 1999 11:08:42 -0700 (PDT) (envelope-from bright@rush.net) Received: from localhost (bright@localhost) by cygnus.rush.net (8.9.3/8.9.3) with SMTP id OAA09950; Thu, 19 Aug 1999 14:14:24 -0400 (EDT) Date: Thu, 19 Aug 1999 14:14:22 -0400 (EDT) From: Alfred Perlstein To: Matthew Dillon Cc: Eivind Eklund , Peter Wemm , current@FreeBSD.ORG Subject: Re: NFS HEADS UP (was Re: cvs commit: src/sys/nfs nfsm_subs.h xdr_subs.h) In-Reply-To: <199908191720.KAA56717@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 19 Aug 1999, Matthew Dillon wrote: > > :On Thu, Aug 19, 1999 at 07:50:13AM -0700, Peter Wemm wrote: > :> peter 1999/08/19 07:50:13 PDT > :> > :> Modified files: > :> sys/nfs nfsm_subs.h xdr_subs.h > :> Log: > :> Convert all the nfs macros to do { blah } while (0) to ensure it > :> works correctly in if/else etc. egcs had probably picked up most of the > :> problems here before with "ambiguous braces" etc, but this should > :> increase the robustness a bit. Based on an idea from Eivind Eklund. > : > :When I tested this, I got significant binary changes after changing > :the macros to be . Writing a couple of test programs, I was not able > :to get binary changes without actual semantic changes - the optimizer > :optimize away do { ... } while(0); just fine. I didn't have any > :testbed for NFS, which was why I didn't commit similar changes myself. > : > :Interpretation: NFS is likely to be different now than it was before > :these commits. This hopefully mean less bugs, but we might also have > :had bugs cancelling each other and 'mystery fixes' that no longer > :work. If you get strange effects in NFS in the upcoming time, you > :might try flipping this commit. > : > :I still think the change is a good and necessary one. > : > :Eivind. > > The compiler optimizes differently, that's all. The same thing happened > when we fixed the macros in vm_map.h. In that case we also found a bug > in i386/include/globals.h --- the inline assembly macros are missing > the "memory" side effect specification and the code was trying to optimize > global references across subroutine calls! I'll send Luoqi another email. > > In the case of the NFS stuff, the changes have been pretty well tested > so I think we are in the clear. On a somewhat similar note, what do you think about converting a lot of the NFS macros to functions, yes i know it will be difficult, but there is so much forced inlining it just seems like it would reduce the codesize signifigantly and play nicer with the CPU cache. It would also make the code a lot more readable. Worthwhile exercise? -Alfred Perlstein - [bright@rush.net|bright@wintelcom.net] systems administrator and programmer Wintelcom - http://www.wintelcom.net/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message