From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 25 15:31:59 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB1810656B6; Thu, 25 Nov 2010 15:31:59 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B66378FC17; Thu, 25 Nov 2010 15:31:58 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA06417; Thu, 25 Nov 2010 17:31:56 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4CEE816C.4060306@freebsd.org> Date: Thu, 25 Nov 2010 17:31:56 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: John Baldwin References: <201011220924.53709.jhb@freebsd.org> <4CEBDD42.5010007@freebsd.org> <4CEE80B1.6000602@FreeBSD.org> In-Reply-To: <4CEE80B1.6000602@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , freebsd-hackers@freebsd.org Subject: Re: Best way to determine if an IRQ is present X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2010 15:31:59 -0000 on 25/11/2010 17:28 John Baldwin said the following: > Andriy Gapon wrote: >> on 22/11/2010 16:24 John Baldwin said the following: >>> Well, the real solution is actually larger than described in the PR. What you >>> really want to do is take the logical CPUs offline when they are "halted". >>> Taking a CPU offline should trigger an EVENTHANDLER that various bits of code >>> could invoke. In the case of platforms that support binding interrupts to CPUs >>> (x86 and sparc64 at least), they would install an event handler that searches >>> the MD interrupt tables (e.g. the interrupt_sources[] array on x86) and move >>> bound interrupts to other CPUs. However, I think all the interrupt >>> bits will be MD, not MI. >> >> That's a good idea and a comprehensive approach. >> One minor technical detail - should an offlined CPU be removed from all_cpus >> mask/set? > > That's tricky. In other e-mails I've had on this topic, the idea has been to have > a new online_cpus mask and maybe a CPU_ONLINE() test macro similar to > CPU_ABSENT(). In that case, an offline CPU should still be in all_cpus, but many > places that use all_cpus would need to use online_cpus instead. > This sounds like a plan. CPU_FOREACH_ONLINE() could also come handy, Thanks! -- Andriy Gapon