Date: Thu, 8 Apr 2004 11:59:49 -0700 From: Marcel Moolenaar <marcel@xcllnt.net> To: Robert Watson <rwatson@freebsd.org> Cc: current@freebsd.org Subject: Re: panic on one cpu leaves others running... Message-ID: <20040408185949.GA22954@dhcp01.pn.xcllnt.net> In-Reply-To: <Pine.NEB.3.96L.1040408114813.47476A-100000@fledge.watson.org> References: <20040408154004.GA22500@dhcp01.pn.xcllnt.net> <Pine.NEB.3.96L.1040408114813.47476A-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 08, 2004 at 11:51:24AM -0400, Robert Watson wrote: > > > > Presumably in large part because I'm in code that doesn't require Giant, > > > so there are no lock conflicts. > > > > I don't think that's the case. It think we're just not stopping the CPUs > > or keep them stopped. > > I agree with that interpretation -- I was suggesting that the reason this > problem might not be noticed is that a lot of our code paths require > Giant, and it's only when you panic in code without Giant that Ah, ok. The thing that strikes me as odd, if not wrong, is that we use PCPU(CPUID) to update the stopped_cpus mask, while we should be using PCPU(CPUMASK) for that. See attached patch (untested). Am I off-base here? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="apic.diff" Index: apic_vector.s =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/apic_vector.s,v retrieving revision 1.97 diff -u -r1.97 apic_vector.s --- apic_vector.s 3 Feb 2004 22:00:41 -0000 1.97 +++ apic_vector.s 8 Apr 2004 18:58:31 -0000 @@ -336,7 +336,7 @@ call CNAME(savectx) /* Save process context */ addl $4, %esp - movl PCPU(CPUID), %eax + movl PCPU(CPUMASK), %eax lock btsl %eax, CNAME(stopped_cpus) /* stopped_cpus |= (1<<id) */ Index: genassym.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/genassym.c,v retrieving revision 1.146 diff -u -r1.146 genassym.c --- genassym.c 12 Nov 2003 18:14:34 -0000 1.146 +++ genassym.c 8 Apr 2004 18:58:19 -0000 @@ -200,6 +200,7 @@ ASSYM(PC_TSS_GDT, offsetof(struct pcpu, pc_tss_gdt)); ASSYM(PC_CURRENTLDT, offsetof(struct pcpu, pc_currentldt)); ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); +ASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask)); ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); #ifdef DEV_APIC --n8g4imXOkfNTN/H1--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040408185949.GA22954>