From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 12:55:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF716106564A; Tue, 10 Apr 2012 12:55:33 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id A2D748FC0C; Tue, 10 Apr 2012 12:55:32 +0000 (UTC) Received: by lagv3 with SMTP id v3so5806759lag.13 for ; Tue, 10 Apr 2012 05:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=DEqyn8nRn+2D9Ur/Z3yj0xeDrzpSGbpBQTrq3vSgwzE=; b=PcUk7dQC3iNiupKf5UavuxZSNAN79nihDbBB9KnakZlOpAcrMURCwRD91e7o9hZTeF zYb/39APjNXzee0tjf5ZyLYJn6+qHVreRCU7wsDFUx62fO4RM1tTND0mk0U3arQFJ0us hVYCfUz3yVl4w4dlBr6vYQ2ZNEUfGPaFswhhGfFZXl/XTpwH5jlkXz2GUyvagKexB53b qeMaclI+HoLMsLEbMefOqXNpfTB+QWq8V1PsyZ9PZrjmn8rz2Z3DkEaoVCluSv5UnMxo iQTIRCypkPy2V1/XAfx/RnpBgIpRlrOqEO4PSHnlieVPFMmTTaQgxNqDXltcsrqR4xKU K1Jg== MIME-Version: 1.0 Received: by 10.112.24.103 with SMTP id t7mr1190143lbf.22.1334062531399; Tue, 10 Apr 2012 05:55:31 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.93.138 with HTTP; Tue, 10 Apr 2012 05:55:31 -0700 (PDT) In-Reply-To: <20120410114118.GB93449@alchemy.franken.de> References: <201204092241.q39MfJZn081610@svn.freebsd.org> <20120409230949.GB68111@alchemy.franken.de> <20120410114118.GB93449@alchemy.franken.de> Date: Tue, 10 Apr 2012 13:55:31 +0100 X-Google-Sender-Auth: a-tWbvcxa0dFdcwVNeOCGrJzbFE Message-ID: From: Attilio Rao To: Marius Strobl Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 12:55:33 -0000 Il 10 aprile 2012 12:41, Marius Strobl ha scritto: > On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote: >> Il 10 aprile 2012 00:09, Marius Strobl ha scritto: >> > On Mon, Apr 09, 2012 at 10:41:19PM +0000, Attilio Rao wrote: >> >> Author: attilio >> >> Date: Mon Apr ??9 22:41:19 2012 >> >> New Revision: 234074 >> >> URL: http://svn.freebsd.org/changeset/base/234074 >> >> >> >> Log: >> >> ?? BSP is not added to the mask of valid target CPUs for interrupts >> >> ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not >> >> ?? called in the !SMP case too. >> >> ?? Fix this by: >> >> ?? - Adding the BSP as an interrupt target directly in cpu_startup(). >> >> ?? - Remove an obsolete optimization where the BSP are skipped in >> >> ?? ?? set_apic_interrupt_ids(). >> >> >> >> ?? Reported by: ?? ?? ?? ??jh >> >> ?? Reviewed by: ?? ?? ?? ??jhb >> >> ?? MFC after: ??3 days >> >> ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961 >> >> ?? Pointy hat to: ?? ?? ??me >> >> >> >> Modified: >> >> ?? head/sys/amd64/amd64/machdep.c >> >> ?? head/sys/amd64/amd64/mp_machdep.c >> >> ?? head/sys/i386/i386/machdep.c >> >> ?? head/sys/i386/i386/mp_machdep.c >> >> >> >> Modified: head/sys/amd64/amd64/machdep.c >> >> ============================================================================== >> >> --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 ?? ?? ?? ??(r234073) >> >> +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 ?? ?? ?? ??(r234074) >> >> @@ -295,6 +295,11 @@ cpu_startup(dummy) >> >> ?? ?? ?? vm_pager_bufferinit(); >> >> >> >> ?? ?? ?? cpu_setregs(); >> >> + >> >> + ?? ?? /* >> >> + ?? ?? ??* Add BSP as an interrupt target. >> >> + ?? ?? ??*/ >> >> + ?? ?? intr_add_cpu(0); >> >> ??} >> > >> > If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be >> > here as well. >> >> You are right, sorry, I did forgot to test without SMP. >> I think we still need intr_add_cpu() on cpu_startup() because of the >> case smp_disabled = 1. >> I think the attached patch should make its dirty job, opinion? > > I currently fail to see why the latter approach would be necessary, > i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should > be sufficient. In case the kernel is compiled without SMP support, > interrupt balancing support isn't available in the first place and > the BSP is always the only available target (see the UP version of > intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's > no need to add the BSP as a valid target. If an SMP kernel is run > on a UP machine or with SMP disabled, interrupt balancing support > is available but the intr_add_cpu() calls in cpu_startup() will add > the BSP as (the only) target, so everything should be fine. Maybe > you can elaborate on why you think an SMP kernel with SMP disabled > needs special handling. I do not understand what you mean. Right now there is a compile time issue where for !SMP kernel it won't compile and this is what I'm trying to fix now, so I don't understand what do you mean here. Attilio -- Peace can only be achieved by understanding - A. Einstein