Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754092AbbBTJcr (ORCPT ); Fri, 20 Feb 2015 04:32:47 -0500 Received: from cantor2.suse.de ([195.135.220.15]:44360 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092AbbBTJcp (ORCPT ); Fri, 20 Feb 2015 04:32:45 -0500 Date: Fri, 20 Feb 2015 10:32:43 +0100 (CET) From: Jiri Kosina To: Andrew Morton cc: Josh Poimboeuf , Ingo Molnar , Peter Zijlstra , Seth Jennings , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] stacktrace: add save_stack_trace_tsk_safe() In-Reply-To: <20150217161320.fb3da954106ad44e9f07ca9e@linux-foundation.org> Message-ID: References: <20150217161320.fb3da954106ad44e9f07ca9e@linux-foundation.org> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) 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 Content-Length: 1094 Lines: 26 On Tue, 17 Feb 2015, Andrew Morton wrote: > > It isn't possible to get the stack of a running task (other than > > current) because we don't have the stack pointer and the stack can be > > inconsistent anyway. Add a safe stack saving facility which only saves > > the stack of the task if it's sleeping or if it's the current task. > > Can you send the task an IPI and get it to save its stack for you? > > There's probably some (messy, arch-dependent) way of trimming away the > interrupt-related stuff off the stack, if that's really needed. I am afraid that you need to send broadcast IPI to all CPUs and only dump stack then to avoid races with reschedule and make it really consistent. If that is agreed to be a reasonable price to pay for consistent stack dump for a single process is of course a question. -- Jiri Kosina SUSE Labs -- 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/