From: Mel Gorman <mgorman@techsingularity.net>
To: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Matt Fleming <matt@codeblueprint.co.uk>,
Mike Galbraith <mgalbraith@suse.de>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched: Make schedstats a runtime tunable that is disabled by default
Date: Mon, 25 Jan 2016 20:11:42 +0000 [thread overview]
Message-ID: <20160125201142.GJ3162@techsingularity.net> (raw)
In-Reply-To: <20160125184000.GA6249@gmail.com>
On Mon, Jan 25, 2016 at 07:40:00PM +0100, Ingo Molnar wrote:
>
> * Mel Gorman <mgorman@techsingularity.net> wrote:
>
> > On Mon, Jan 25, 2016 at 04:46:35PM +0100, Ingo Molnar wrote:
> > > > Of course, it'll be our luck that tracking the data for these
> > > > tracepoints is the most expensive part of schedstats ...
> > > >
> > > > Ingo?
> > >
> > > IIRC it needed only a small subset of schedstats to make those tracepoints work.
> > >
> > > We already have too much overhead in the scheduler as-is - and the extra cache
> > > footprint does not even show on the typically cache-rich enterprise CPUs most of
> > > the scalability testing goes on.
> > >
> > > My minimum requirement for such runtime enablement would be to make it entirely
> > > static-branch patched and triggered at the call sites as well - not hidden inside
> > > schedstat functions.
> > >
> >
> > As it is, it's static-branch patched but I'm struggling to see why they cannot
> > be hidden in the schedstat_* functions which are just preprocessor macros. The
> > checks could be put in the callsites but it's a lot of updates and I don't think
> > the end result would be very nice to read.
>
> So I was judging by:
>
> @@ -755,7 +755,12 @@ static void
> update_stats_wait_end(struct cfs_rq *cfs_rq, struct sched_entity *se)
> {
> struct task_struct *p;
> - u64 delta = rq_clock(rq_of(cfs_rq)) - se->statistics.wait_start;
> + u64 delta;
> +
> + if (static_branch_unlikely(&sched_schedstats))
> + return;
> +
>
> which puts a static branch inside a real function, not preprocessor macros.
>
Ok, I see your point, thanks.
The vast majority of the checks are in the schedstat_[inc|dec|set) helpers.
update_stats_wait_end() is an oddity in that it's a large function
that only exists in schedstat and does a number of calculations. Ideally
update_stats_wait would be updated too. In the next revision, I'll create
a schedstats_enabled() helper that is an alias of static_branch_unlikely()
and returns 0 if stats are not configured in for use at the call-site
of large functions like this. That has the added benefit of avoiding any
function call overhead.
I'm less concerned with the exact coding style at the moment. I'm more
concerned about whether people are ok with the dead tracepoints dead and
hidden stats when schedstat is disabled at runtime by default.
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2016-01-25 20:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 10:05 [PATCH] sched: Make schedstats a runtime tunable that is disabled by default Mel Gorman
2016-01-25 11:26 ` Peter Zijlstra
2016-01-25 13:39 ` Mel Gorman
2016-01-25 14:59 ` Peter Zijlstra
2016-01-25 15:46 ` Ingo Molnar
2016-01-25 17:07 ` Mel Gorman
2016-01-25 18:40 ` Ingo Molnar
2016-01-25 20:11 ` Mel Gorman [this message]
2016-01-25 20:45 ` Mel Gorman
2016-01-26 8:13 ` Ingo Molnar
2016-01-25 17:05 ` Mel Gorman
2016-01-25 15:29 ` Matt Fleming
2016-01-25 16:46 ` Mel Gorman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160125201142.GJ3162@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@codeblueprint.co.uk \
--cc=mgalbraith@suse.de \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).