From owner-freebsd-hackers Fri Aug 6 0:11:17 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from dingo.cdrom.com (castles549.castles.com [208.214.165.113]) by hub.freebsd.org (Postfix) with ESMTP id 6348B150AB for ; Fri, 6 Aug 1999 00:11:13 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost [127.0.0.1]) by dingo.cdrom.com (8.9.3/8.8.8) with ESMTP id AAA00655; Fri, 6 Aug 1999 00:05:04 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Message-Id: <199908060705.AAA00655@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Arun Sharma Cc: freebsd-hackers@freebsd.org Subject: Re: Excessive assembly code ? In-reply-to: Your message of "Thu, 05 Aug 1999 23:35:54 PDT." <19990805233554.A1698@home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 06 Aug 1999 00:05:04 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > I wonder if so much assembly code is really necessary for FreeBSD. One > argument for minimal usage of assembly code is that it is easier to code > non trivial algorithms in C. > > One such example is the scheduler. Since the decision about which process > is going to run next is decided in assembly code, it is restricted to a > relatively dumb algorithm of scanning the runqs and picking one. If the > mechanism (i.e nuts and bolts of the context switch) is coded in assembly > and the policy (which process to pick next) is done in C, the code would > be much more maintainable, IMO. > > How do people feel about it here ? I've been studying this just recently. The "pick the next proc" code really should be MI and written carefully in C, yes. But if you look at the code surrounding it, for example, it needs some very careful thought. Much of the assembly code actually in use is there for performance or architecture-related reasons; in many cases if you were to rewrite in C you would just end up with a lot of asm() macros... -- \\ The mind's the standard \\ Mike Smith \\ of the man. \\ msmith@freebsd.org \\ -- Joseph Merrick \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message