From owner-freebsd-current Tue Apr 17 15:19:15 2001 Delivered-To: freebsd-current@freebsd.org Received: from a.mx.everquick.net (a.mx.everquick.net [216.89.137.3]) by hub.freebsd.org (Postfix) with ESMTP id E5B6837B423 for ; Tue, 17 Apr 2001 15:18:58 -0700 (PDT) (envelope-from eddy+public+spam@noc.everquick.net) Received: from localhost (eddy@localhost) by a.mx.everquick.net (8.10.2/8.10.2) with ESMTP id f3HMIZ312233; Tue, 17 Apr 2001 22:18:35 GMT X-EverQuick-No-Abuse: Report any e-mail abuse to Date: Tue, 17 Apr 2001 22:18:34 +0000 (GMT) From: "E.B. Dreger" To: Alfred Perlstein Cc: Matt Dillon , "Justin T. Gibbs" , Doug Barton , "'current@freebsd.org'" Subject: Re: FW: Filesystem gets a huge performance boost In-Reply-To: <20010417145206.T976@fw.wintelcom.net> 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 > Date: Tue, 17 Apr 2001 14:52:06 -0700 > From: Alfred Perlstein Disclaimer: I am not a kernel hacker. > The goal is to have a kernel that's able to have more concurrancy, Right... > things like pre-emption and task switching on mutex collisions can > be examined and possibly changed later. I think that Matt is saying, why bother? Task switches are expensive. With a heavily loaded system, the amount of time spent arbitrating mutexes would exceed spin time. With a lightly loaded system, do we really care that much about spinning? > Once the mutexes are in place the underlying implementation can > change pretty easily from task switching always to only task > switching when the mutex is owned by the same CPU that I'm running I'm not sure that I follow... if the task switch is on the same CPU, then why do we need any new structures? Without a global memory cache*, I think that keeping processes on the same CPU is the first goal, anyway, and increased concurrency second. * Does Intel have any sort of cache coherency mechanism, where a processor can tell other CPUs, "hey, this line is dirty" and the others retrieve the new info as needed? The Alpha? > on. (to avoid spinlock deadlock) > > I agree that task switching _might_ be a performance hit, however > that can be fixed by only task switching when in interrupt context. Ughh. AFAIK, traditional wisdom holds that interrupt loops should be as short as possible. Assuming that one performs quick operations, DMA transfers, etc., preemptive task switching *would* be expensive. > A lot of things remain to be seen, but only if people like you sit > down and start working with the SMP team to achieve the main goal, > which is making the kernel MP safe for concurrant execution by > locking down the appropriate structures and code paths. Let's look at userland code. I don't use async I/O because I don't want to screw with interrupts and callbacks. Polling of large structures? Ughh. Kernel queues are the solution, and what totally sold me on FreeBSD. How about basing things on *cooperative* multitasking? All else being equal, cooperative is faster because of lower overhead. What makes co-op break down is greedy programs that monopolize the CPU... but there should not be any code like that in the kernel. My instinct (whatever it's worth; remember my disclaimer) is that co-op switching using something like tsleep() and wakeup_one() or similar would be more efficient than trying to screw with mutexes. However, perhaps that could be improved upon: Use something a la kqueue for portions of the kernel to say "I'm waiting for condition XYZ". When we wakeup_one(), we specify "for condition XYZ". We could then avoid waking processes that would only go back to sleep again. I hope that I'm not too far out of my league, here... :-) Eddy --------------------------------------------------------------------------- Brotsman & Dreger, Inc. EverQuick Internet / EternalCommerce Division Phone: (316) 794-8922 --------------------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message