Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1462663

Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in times()/clock_gettime()

From Wanpeng Li <kernellwp@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in times()/clock_gettime()
Date 2016-08-15 11:20 +0200
Message-ID <s6mdP-3HY-7@gated-at.bofh.it> (permalink)
References <s2IFX-52N-9@gated-at.bofh.it> <s2IFX-52N-11@gated-at.bofh.it> <s4Gqm-b4-55@gated-at.bofh.it> <s5jBo-1uO-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

Regards,
Wanpeng Li

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Stanislaw Gruszka <sgruszka@redhat.com> - 2016-08-12 14:20 +0200
  Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Giovanni Gherdovich <ggherdovich@suse.cz> - 2016-08-15 09:50 +0200
    Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Mel Gorman <mgorman@techsingularity.net> - 2016-08-15 10:40 +0200
      Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Stanislaw Gruszka <sgruszka@redhat.com> - 2016-08-15 11:30 +0200
        Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Mel Gorman <mgorman@techsingularity.net> - 2016-08-15 12:00 +0200
          Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Stanislaw Gruszka <sgruszka@redhat.com> - 2016-08-15 12:40 +0200
  Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in times()/clock_gettime() Wanpeng Li <kernellwp@gmail.com> - 2016-08-15 11:20 +0200
    Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Stanislaw Gruszka <sgruszka@redhat.com> - 2016-08-15 11:30 +0200
      Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in times()/clock_gettime() Wanpeng Li <kernellwp@gmail.com> - 2016-08-15 11:30 +0200

csiph-web