Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757533Ab1EXVEd (ORCPT ); Tue, 24 May 2011 17:04:33 -0400 Received: from mail.skyhub.de ([78.46.96.112]:37383 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754185Ab1EXVEc (ORCPT ); Tue, 24 May 2011 17:04:32 -0400 Date: Tue, 24 May 2011 23:04:17 +0200 From: Borislav Petkov To: Tony Luck Cc: Borislav Petkov , Ingo Molnar , "linux-kernel@vger.kernel.org" , "Huang, Ying" , Andi Kleen , Linus Torvalds , Andrew Morton , Mauro Carvalho Chehab , Peter Zijlstra Subject: Re: [RFC 0/9] mce recovery for Sandy Bridge server Message-ID: <20110524210417.GA21660@eferding.osrc.amd.com> Mail-Followup-To: Borislav Petkov , Tony Luck , Borislav Petkov , Ingo Molnar , "linux-kernel@vger.kernel.org" , "Huang, Ying" , Andi Kleen , Linus Torvalds , Andrew Morton , Mauro Carvalho Chehab , Peter Zijlstra References: <4ddad79317108eb33d@agluck-desktop.sc.intel.com> <20110524034023.GB25230@elte.hu> <987664A83D2D224EAE907B061CE93D5301D5D0595B@orsmsx505.amr.corp.intel.com> <20110524173326.GA7635@gere.osrc.amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1450 Lines: 40 On Tue, May 24, 2011 at 10:56:26AM -0700, Tony Luck wrote: > > Maybe something like > > > > set_current_state(TASK_UNINTERRUPTIBLE); > > > > finish work in NMI context > > > > do remaining work in process context like sending appropriate signals > > etc; finally: > > > > set_task_state(tsk, TASK_RUNNING) > > That looks pretty easy - are their any weird side effects that I should > be worried about? My perf/event can't really include the "task" pointer > (that sounds way too internal) - but I can provide the process id, so > the "RAS daemon" that sees this event can look up the task to do that > final set_task_state(tsk, TASK_RUNNING). Actually, I was thinking more in the direction of doing this in a kernel thread or workqueue without going back to the RAS daemon. Then you would only need to save the task_struct ptr. > Does this work in the threaded case? In the case where the task was in > kernel context (but in a CONFIG_PREEMT=y kernel at some point > where preemption is allowed)? Well, IIUC and depending on the error, if it is severe enough, you would want to run the remaining work right after the NMI handler finishes without going to userspace. Hmm.. -- Regards/Gruss, Boris. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/