From owner-freebsd-alpha Thu Sep 5 18:50: 6 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8778537B400; Thu, 5 Sep 2002 18:50:00 -0700 (PDT) Received: from avocet.mail.pas.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D30143E4A; Thu, 5 Sep 2002 18:50:00 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0142.cvx22-bradley.dialup.earthlink.net ([209.179.198.142] helo=mindspring.com) by avocet.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17n8Fz-0006Do-00; Thu, 05 Sep 2002 18:49:59 -0700 Message-ID: <3D78098B.CEBF13EC@mindspring.com> Date: Thu, 05 Sep 2002 18:48:59 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: John Baldwin Cc: Andrew Gallatin , freebsd-alpha@FreeBSD.ORG Subject: Re: ithread preemption References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org John Baldwin wrote: > > Hey ... I think you have it on the nose! That makes the most sense > > I've heard yet. > > > > Do we have any way to bind a thread to a cpu? > > I used to. Then KSE3 was committed. I suppose I could rewrite it from > scratch again. The ithreads are different from threads. People don't seem to get this idea, but it is nevertheless true. The x86 SMP doesn't have this problem (yet), in that the IRQ is disabled on the I/O APIC, so it doesn't matter what CPU it runs on, it's a seperate thing. If x86 NUMA systems are ever supported, or in some cases the AMD Alpha-derived arbitration is used, there could be a problem (but not for the same reasons as on the Alpha). Using all the same primitives for ithreads as for threads will lead to things like a shared IRQ which comes true for multiple devices will need to count down to enable, if the ithreads for servicing are run simultaneously on seperate CPUs. This also implies a global lock on enabling a newly arrived device that's sharing an already allocated IRQ, and inter-CPU contnetion on any IRQ whose use cont is != 1. Interrupt threads make some very messy thing elegant, but they do so at the cost of moving the mess elsewhere. If you have to characterize it, call it "The law of conservation of inelegance". 8-). The only thing that ever saves you from it is a top-down design. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message