Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752516AbbEHH6R (ORCPT ); Fri, 8 May 2015 03:58:17 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:38730 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751493AbbEHH6L (ORCPT ); Fri, 8 May 2015 03:58:11 -0400 Date: Fri, 8 May 2015 09:58:06 +0200 From: Ingo Molnar To: Rik van Riel Cc: Frederic Weisbecker , Andy Lutomirski , Mike Galbraith , "linux-kernel@vger.kernel.org" , X86 ML , williams@redhat.com, Andrew Lutomirski , fweisbec@redhat.com, Peter Zijlstra , Heiko Carstens , Thomas Gleixner , Ingo Molnar , Paolo Bonzini Subject: Re: [PATCH 3/3] context_tracking,x86: remove extraneous irq disable & enable from context tracking on syscall entry Message-ID: <20150508075806.GA5537@gmail.com> References: <20150501064044.GA18957@gmail.com> <554399D1.6010405@redhat.com> <1430659432.4233.3.camel@gmail.com> <55465B2D.6010300@redhat.com> <55466E72.8060602@redhat.com> <20150507104845.GB14924@gmail.com> <20150507121848.GB32271@lerouge> <20150507122913.GA17443@gmail.com> <554B891A.9040109@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <554B891A.9040109@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1791 Lines: 47 * Rik van Riel wrote: > On 05/07/2015 08:29 AM, Ingo Molnar wrote: > > > > * Frederic Weisbecker wrote: > > > >>>> We cannot take the lock_trace(task) from irq context, and we > >>>> probably do not need to anyway, since we do not care about a > >>>> precise stack trace for the task. > >>> > >>> So one worry with this and similar approaches of statistically > >>> detecting user mode would be the fact that on the way out to > >>> user-space we don't really destroy the previous call trace - we > >>> just pop off the stack (non-destructively), restore RIPs and are > >>> gone. > >>> > >>> We'll need that percpu flag I suspect. > >> > >> Note we have the context tracking state which tells where the > >> current task is: user/system/guest. > > > > Yes, but that overhead is what I'm suggesting we get rid of, I thought > > Rik was trying to find a mechanism that would be independent of that? > > One thing at a time :) > > I am working on the timer sampling stuff, which should be easy to > adapt to a different user/system/guest/irq/softirq/... tracking > thing, if somebody else comes up with a more efficient way to do > that. So if you make the timer sampling use a percpu variable, and set that variable from the existing callbacks, then we could do this gradually: first the timer sampling uses the flag, then RCU could use it, and finally we could push it out to minimal assembly code. But it's important to start out with a percpu flag to track this all. Thanks, Ingo -- 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/