From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753674AbdDMOIR (ORCPT ); Thu, 13 Apr 2017 10:08:17 -0400 Received: from mail.kernel.org ([198.145.29.136]:37604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750745AbdDMOIQ (ORCPT ); Thu, 13 Apr 2017 10:08:16 -0400 Date: Thu, 13 Apr 2017 10:08:10 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Mel Gorman , LKML , Ingo Molnar , Matt Fleming , Srikar Dronamraju , Josh Poimboeuf Subject: Re: [PATCH v2] sched: Enabled schedstat when schedstat tracepoints are enabled Message-ID: <20170413100810.45f30148@gandalf.local.home> In-Reply-To: <20170413090124.qcawrqjkte5iwsyp@hirez.programming.kicks-ass.net> References: <20170412160432.481ee5fb@gandalf.local.home> <20170413090005.ewdwm3on5u2urhxw@hirez.programming.kicks-ass.net> <20170413090124.qcawrqjkte5iwsyp@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 13 Apr 2017 11:01:24 +0200 Peter Zijlstra wrote: > On Thu, Apr 13, 2017 at 11:00:05AM +0200, Peter Zijlstra wrote: > > On Wed, Apr 12, 2017 at 10:56:07PM -0400, Steven Rostedt wrote: > > > From: Steven Rostedt (VMware) > > > > > > During my tests, I see this in my dmesg: > > > > > > "Scheduler tracepoints stat_sleep, stat_iowait, stat_blocked and > > > stat_runtime require the kernel parameter schedstats=enabled or > > > kernel.sched_schedstats=1" > > > > > > And found the commit: > > > > > > cb2517653fc ("sched/debug: Make schedstats a runtime tunable that is > > > disabled by default") > > > > > > Which states: > > > > > > "For tracepoints, there is a simple warning as it's not safe to activate > > > schedstats in the context when it's known the tracepoint may be wanted > > > but is unavailable." > > > > > > I'm assuming that Mel did not know about the TRACE_EVENT_FN() and > > > DEFINE_EVENT_FN() that allow for callbacks for tracepoints as they are > > > enabled and disabled. I do not see any reason for not enabling > > > schedstat when one of its tracepoints are enabled. > > > > > > The state of schedstat is saved when the first tracepoint is enabled, > > > and that state is put back when the tracepoints are disabled. > > > > There is one additional complication with all this. > > > > Dynamically enabling the sched_stats like this doesn't guarantee correct > > information. So you've now taken away the informational print and > > silently generate bollocks numbers. > > Josh has a patch like: > > http://lkml.kernel.org/r/00e8805cc094657d5ccb20bb88e0d2ce1cbb92e1.1466184592.git.jpoimboe@redhat.com > > That tries to keep the few stats required for the tracepoint active at > all times. But I never managed to get performance overhead to 0. Interesting. I may take a look at that patch too. What benchmark did you use to measure performance? Thanks! -- Steve