From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Giovanni Gherdovich <ggherdovich@suse.cz>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Mike Galbraith <mgalbraith@suse.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in times()/clock_gettime()
Date: Mon, 15 Aug 2016 11:21:28 +0200 [thread overview]
Message-ID: <20160815092127.GB19741@redhat.com> (raw)
In-Reply-To: <CANRm+CwAaDu6UYMQAsKHipq-0zXkDPXbiy3=-pqSSOx1aC8TOQ@mail.gmail.com>
On Mon, Aug 15, 2016 at 05:13:30PM +0800, Wanpeng Li wrote:
> 2016-08-12 20:10 GMT+08:00 Stanislaw Gruszka <sgruszka@redhat.com>:
> > Hi
> >
> > On Wed, Aug 10, 2016 at 01:26:41PM +0200, Ingo Molnar wrote:
> >> Nice detective work! I'm wondering, where do we stand if compared with a
> >> pre-6e998916dfe3 kernel?
> >>
> >> I admit this is a difficult question: 6e998916dfe3 does not revert cleanly and I
> >> suspect v3.17 does not run easily on a recent distro. Could you attempt to revert
> >> the bad effects of 6e998916dfe3 perhaps, just to get numbers - i.e. don't try to
> >> make the result correct, just see what the performance gap is, roughly.
> >>
> >> If there's still a significant gap then it might make sense to optimize this some
> >> more.
> >
> > I measured (partial) revert performance on 4.7 using mmtest instructions
> > from Giovanni and also tested some other possible fix (draft version):
> >
> > diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
> > index 75f98c5..54fdf6d 100644
> > --- a/kernel/sched/cputime.c
> > +++ b/kernel/sched/cputime.c
> > @@ -294,6 +294,8 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
> > unsigned int seq, nextseq;
> > unsigned long flags;
> >
> > + (void) task_sched_runtime(tsk);
> > +
> > rcu_read_lock();
> > /* Attempt a lockless read on the first round. */
> > nextseq = 0;
> > @@ -308,7 +310,7 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
> > task_cputime(t, &utime, &stime);
> > times->utime += utime;
> > times->stime += stime;
> > - times->sum_exec_runtime += task_sched_runtime(t);
> > + times->sum_exec_runtime += t->se.sum_exec_runtime;
>
> If this will not have updated stats for other threads?
No, until tick/sched() on CPUs running threads.
Stanislaw
next prev parent reply other threads:[~2016-08-15 9:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 8:21 [PATCH 0/1] " Giovanni Gherdovich
2016-08-05 8:21 ` [PATCH 1/1] " Giovanni Gherdovich
2016-08-10 11:26 ` Ingo Molnar
2016-08-10 13:02 ` Giovanni Gherdovich
2016-08-12 12:10 ` Stanislaw Gruszka
2016-08-15 7:49 ` Giovanni Gherdovich
2016-08-15 8:33 ` Mel Gorman
2016-08-15 9:19 ` Stanislaw Gruszka
2016-08-15 9:58 ` Mel Gorman
2016-08-15 10:29 ` Stanislaw Gruszka
2016-08-15 9:13 ` Wanpeng Li
2016-08-15 9:21 ` Stanislaw Gruszka [this message]
2016-08-15 9:28 ` Wanpeng Li
2016-08-10 18:00 ` [tip:sched/core] " tip-bot for Giovanni Gherdovich
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=20160815092127.GB19741@redhat.com \
--to=sgruszka@redhat.com \
--cc=ggherdovich@suse.cz \
--cc=kernellwp@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgalbraith@suse.de \
--cc=mgorman@techsingularity.net \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--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
Powered by JetHome