From owner-freebsd-arch Tue Aug 20 12:33:11 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7004237B400 for ; Tue, 20 Aug 2002 12:33:09 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDEE943E6A for ; Tue, 20 Aug 2002 12:33:08 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.4) with ESMTP id g7KJX6dc084638; Tue, 20 Aug 2002 12:33:06 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.4/Submit) id g7KJX37j084635; Tue, 20 Aug 2002 12:33:03 -0700 (PDT) (envelope-from dillon) Date: Tue, 20 Aug 2002 12:33:03 -0700 (PDT) From: Matthew Dillon Message-Id: <200208201933.g7KJX37j084635@apollo.backplane.com> To: Alfred Perlstein Cc: Andrew Gallatin , Bruce Evans , Ian Dowse , arch@FreeBSD.ORG Subject: Re: Solving the stack gap issue References: <200208171918.aa72556@salmon.maths.tcd.ie> <20020818055951.N12475-100000@gamplex.bde.org> <15714.17605.575558.398279@grasshopper.cs.duke.edu> <20020820153515.GL75574@elvis.mu.org> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :* Andrew Gallatin [020820 06:32] wrote: :> :> For example, why do we check MPSAFE and conditionally grab and release :> GIANT in syscall instead of just grabbing/releasing it in the syscall :> itself? A few thousand instructions worth of bloat might be worth 2 :> compares in the critical path.. Also, if the copyin fails, why do we :> not just set the ret value and jump past the call, rather than setting :> error and doing an extra compare a few lines later? : :Grunt work that just needs to be done. I can take a shot at it :if no one else is currently. : :-- :-Alfred Perlstein [alfred@freebsd.org] [#bsdcode/efnet/irc.prison.net] : Please feel free to proceed, Alfred. I think we are at the point where we can get rid of the MPSAFE flag and shift Giant operation from the syscall trap code to the individual syscall procedures. It is, as you say, just a lot of grunt work. I originally put the MPSAFE code in the syscall trap handler because it was the most convenient solution, and performance wasn't an issue back then. I doubt people will notice the performance difference with Giant shifted to the syscalls but from an engineering perspective I think it's a good cleanup to make because it makes it easier for people working on the syscalls to shift Giant inward. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message