From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 25 15:59:13 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 3DDA010656A6 for ; Thu, 25 Nov 2010 15:59:13 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id E733D8FC08 for ; Thu, 25 Nov 2010 15:59:12 +0000 (UTC) Received: by yxh35 with SMTP id 35so545673yxh.13 for ; Thu, 25 Nov 2010 07:59:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=xptUBeGQ8MwazLTpc7AnstXemUOQVZPnL2bFDGePYU4=; b=nhWImrKHvgny+v2oubDuI6T6wvakTjHc/4hMFWIV5fWp1h74bOHdiVTHZeAp4kgh8a o4n4v0t/inB02HCXbqck3GFQ+dg4aw7Kll314gF8de/EC4wG7hsEd3Y3gu2P1sLhbp7B x/Pbu3okYUxHpusMTbZqaLOcA3xbH3T4LtBJ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=PgoW6VvRE8iigs3OKjlfXNiCbJjX/73EmHxBXfl1JXo5hV05yn9r/IzWwrqMZXTOaq 2uG+FYr1GGLAaa6SLw0mKYRYwjW240qreid8qboWBIK0FhrEClydvHgVyh+0OlhqeR1j hEGCCyOSydXVh250cktaKxCA2AQf4XHp1CIqc= MIME-Version: 1.0 Received: by 10.150.220.14 with SMTP id s14mr3251764ybg.266.1290699349855; Thu, 25 Nov 2010 07:35:49 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.236.102.161 with HTTP; Thu, 25 Nov 2010 07:35:49 -0800 (PST) In-Reply-To: <4CEE816C.4060306@freebsd.org> References: <201011220924.53709.jhb@freebsd.org> <4CEBDD42.5010007@freebsd.org> <4CEE80B1.6000602@FreeBSD.org> <4CEE816C.4060306@freebsd.org> Date: Thu, 25 Nov 2010 10:35:49 -0500 X-Google-Sender-Auth: 8oAiFEShKaRijhwGnN0xRuq_TOE Message-ID: From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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:59:13 -0000 2010/11/25 Andriy Gapon : > 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. = =C2=A0What you >>>> really want to do is take the logical CPUs offline when they are "halt= ed". >>>> Taking a CPU offline should trigger an EVENTHANDLER that various bits = of code >>>> could invoke. =C2=A0In the case of platforms that support binding inte= rrupts to CPUs >>>> (x86 and sparc64 at least), they would install an event handler that s= earches >>>> the MD interrupt tables (e.g. the interrupt_sources[] array on x86) an= d move >>>> bound interrupts to other CPUs. =C2=A0However, I think all the interru= pt >>>> 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. =C2=A0In other e-mails I've had on this topic, the idea h= as been to have >> a new online_cpus mask and maybe a CPU_ONLINE() test macro =C2=A0similar= to >> CPU_ABSENT(). =C2=A0In 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! One of the biggest issues here is that these bitmasks become no-more fixed for the kernel timelife, but you need proper locking to access them. I recall that one of the point for this plan is to benchmark and eventually optimize performance (as it is easilly feasible) on writing for rmlocks. In order to have a fully effective plan, there are several nits that need to be addressed here, I may have collected somewhere in a file, when I find it I will send to you. Attilio --=20 Peace can only be achieved by understanding - A. Einstein