From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757723AbYDGWd5 (ORCPT ); Mon, 7 Apr 2008 18:33:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754233AbYDGWdt (ORCPT ); Mon, 7 Apr 2008 18:33:49 -0400 Received: from styx.suse.cz ([82.119.242.94]:59175 "EHLO mail.suse.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753063AbYDGWdt (ORCPT ); Mon, 7 Apr 2008 18:33:49 -0400 Date: Tue, 8 Apr 2008 00:33:48 +0200 (CEST) From: Jiri Kosina To: "Rafael J. Wysocki" cc: Andi Kleen , Zdenek Kabelac , Kernel development list , Ingo Molnar , Thomas Gleixner Subject: Re: BUG: using smp_processor_id() during suspend with 2.6.25-rc8 In-Reply-To: <200804080029.31102.rjw@sisk.pl> Message-ID: References: <20080407222352.GG16647@one.firstfloor.org> <200804080029.31102.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Apr 2008, Rafael J. Wysocki wrote: > > The mce resume is a sysdev. > > sysdevs were always supposed to run completely with interrupts off. If they > > don't anymore that's some kind of higher level resume code bug which you need > > to fix there, not hack around in the low level code. > They are executed with interrupts disabled, on one CPU. So, any idea why mce_resume() -> mce_init() -> debug_smp_processor_id() triggers the warning? Apparently preempt_count is zero, irqs_disabled() returns false, and cpumask_of_cpu() is not equal to current->cpus_allowed. So there clearly is a bug somewhere. > > Obviously turning on preemption anywhere around the machine check is > > fatal because it touches CPU state and if you reschedule you could > > switch to another CPU and change or access the wrong CPU's state. > FWIW, at the point when sysdevs are resumed we are single-threaded. Is that really relevant here? We still could be switched over to another CPU, and that would break things. -- Jiri Kosina SUSE Labs