From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751237AbcBCJPg (ORCPT ); Wed, 3 Feb 2016 04:15:36 -0500 Received: from outbound-smtp11.blacknight.com ([46.22.139.16]:53284 "EHLO outbound-smtp11.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbcBCJPa (ORCPT ); Wed, 3 Feb 2016 04:15:30 -0500 Date: Wed, 3 Feb 2016 09:15:26 +0000 From: Mel Gorman To: Srikar Dronamraju Cc: Peter Zijlstra , Ingo Molnar , Matt Fleming , Mike Galbraith , LKML , "Naveen N. Rao" Subject: Re: [PATCH 1/1] sched: Make schedstats a runtime tunable that is disabled by default v3 Message-ID: <20160203091526.GO8337@techsingularity.net> References: <1454319426-2658-1-git-send-email-mgorman@techsingularity.net> <20160202093207.GA9494@linux.vnet.ibm.com> <20160202115815.GD8337@techsingularity.net> <20160202144514.GA28611@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20160202144514.GA28611@linux.vnet.ibm.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 On Tue, Feb 02, 2016 at 08:15:14PM +0530, Srikar Dronamraju wrote: > > Yes. This on top? It's not completely bullet proof as a user could both > > force schedstat disabled and enable sleep profiling but it's a waste of > > memory to guard against it > > > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > index a10494a94cc3..5c2cd37c42e9 100644 > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -920,6 +920,14 @@ static inline int sched_info_on(void) > > #endif > > } > > > > +#ifdef CONFIG_SCHEDSTATS > > +void force_schedstat_enabled(void); > > +#else > > +static inline void force_schedstat_enabled(void) > > +{ > > +} > > +#endif > > One nit: > Since force_schedstat_enabled is called under CONFIG_SCHEDSTATS > we may not want the static define. > I'm not sure I get this either :(. It is a static inline that does nothing under !CONFIG_SCHEDSTAT because tehre is nothing to do. Otherwise it needs to be available for profiling and I just spotted it's needed by latencytop too. -- Mel Gorman SUSE Labs