mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "ethan.zhao" <ethan.kernel@gmail.com>
To: Mike Galbraith <bitbucket@online.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	johlstei@codeaurora.org, Yinghai Lu <yinghai@kernel.org>,
	Jin Feng <joe.jin@oracle.com>,
	Youquan Song <youquan.song@intel.com>,
	LenBrown <len.brown@intel.com>
Subject: Re: [PATCH V3]hrtimer: Fix a performance regression by disable reprogramming in remove_hrtimer
Date: Thu, 8 Aug 2013 17:05:56 +0800	[thread overview]
Message-ID: <3DC3126A-3ABF-4B2D-8B90-F00DB18C2F29@gmail.com> (raw)
In-Reply-To: <260513AB-5C95-49F1-B437-91039CD8CD26@gmail.com>


在 2013-8-8,下午5:04,"ethan.zhao" <ethan.kernel@gmail.com> 写道:

> Kernel 3.11-rc1 +Peterz' patch+ Mike's patch, No C-states in BIOS, got the same result as only Peter's patch.

Typo   3.11-rc3
> Of course , No C states to enter, make sense.
> [root@localhost ~]# time ./pip1m
> 
> real	0m4.381s
> user	0m0.099s
> sys	0m2.784s
> [root@localhost ~]# time ./pip1m
> 
> real	0m4.436s
> user	0m0.093s
> sys	0m2.809s
> [root@localhost ~]# 
> 
> Retest with C-states enabled in BIOS
> [root@localhost ~]# time ./pip1m
> 
> real	0m8.670s
> user	0m0.203s
> sys	0m5.459s
> [root@localhost ~]# time ./pip1m
> 
> real	0m8.489s
> user	0m0.184s
> sys	0m5.360s
> [root@localhost ~]# 
> 
> So the result is Peter's patch working or Mike's ?  Compared with default 3.11-rc3
> result of test case 1 as following, looks great.
> [root@localhost ~]# time ./pip1m
> 
> real	0m10.683s
> user	0m0.204s
> sys	0m6.597s
> [root@localhost ~]# time ./pip1m
> 
> real	0m10.629s
> user	0m0.185s
> sys	0m6.546s
> 
> So revert Mike's patch and retest, got
> [root@localhost ~]# time ./pip1m
> 
> real	0m8.606s
> user	0m0.193s
> sys	0m5.449s
> [root@localhost ~]# time ./pip1m
> 
> real	0m8.655s
> user	0m0.198s
> sys	0m5.519s
> [root@localhost ~]# 
> 
> So, it's Peter's patch working………
> 
> The result of kernel 3.11-rc3 + Peter's patch + no rescheduling IPI and no C-states in BIOS is :
> [root@localhost ~]# time ./pip1m
> 
> real	0m3.915s
> user	0m0.088s
> sys	0m2.487s
> [root@localhost ~]# time ./pip1m
> 
> real	0m3.929s
> user	0m0.082s
> sys	0m2.560s
> [root@localhost ~]# time ./pip1m
> 
> Got about 0.5 sec better than only Peter's patch, but it is strange, only no rescheduling IPI almost got the
> same result.
> 
> 
> Thanks,
> Ethan
> 
> 
> 在 2013-8-8,下午12:31,ethan.zhao <ethan.kernel@gmail.com> 写道:
>>>> 
>>>> sched: ratelimit nohz
>>>> 
>>>> Entering nohz code on every micro-idle is too expensive to bear.
>>>> 
>>>> Signed-off-by: Mike Galbraith <efault@gmx.de>
>>>> 
>>>> ---
>>>> include/linux/sched.h    |    5 +++++
>>>> kernel/sched/core.c      |    5 +++++
>>>> kernel/time/tick-sched.c |    2 +-
>>>> 3 files changed, 11 insertions(+), 1 deletion(-)
>>>> 
>>>> --- a/include/linux/sched.h
>>>> +++ b/include/linux/sched.h
>>>> @@ -235,9 +235,14 @@ extern int runqueue_is_locked(int cpu);
>>>> extern void nohz_balance_enter_idle(int cpu);
>>>> extern void set_cpu_sd_state_idle(void);
>>>> extern int get_nohz_timer_target(void);
>>>> +extern int sched_needs_cpu(int cpu);
>>>> #else
>>>> static inline void nohz_balance_enter_idle(int cpu) { }
>>>> static inline void set_cpu_sd_state_idle(void) { }
>>>> +static inline int sched_needs_cpu(int cpu)
>>>> +{
>>>> +	return 0;
>>>> +}
>>>> #endif
>>>> 
>>>> /*
>>>> --- a/kernel/sched/core.c
>>>> +++ b/kernel/sched/core.c
>>>> @@ -650,6 +650,11 @@ static inline bool got_nohz_idle_kick(vo
>>>> 	return false;
>>>> }
>>>> 
>>>> +int sched_needs_cpu(int cpu)
>>>> +{
>>>> +	return  cpu_rq(cpu)->avg_idle < sysctl_sched_migration_cost;
>>>> +}
>>>> +
>>>> #else /* CONFIG_NO_HZ_COMMON */
>>>> 
>>>> static inline bool got_nohz_idle_kick(void)
>>>> --- a/kernel/time/tick-sched.c
>>>> +++ b/kernel/time/tick-sched.c
>>>> @@ -548,7 +548,7 @@ static ktime_t tick_nohz_stop_sched_tick
>>>> 		time_delta = timekeeping_max_deferment();
>>>> 	} while (read_seqretry(&jiffies_lock, seq));
>>>> 
>>>> -	if (rcu_needs_cpu(cpu, &rcu_delta_jiffies) ||
>>>> +	if (sched_needs_cpu(cpu) || rcu_needs_cpu(cpu, &rcu_delta_jiffies) ||
>>>> 	    arch_needs_cpu(cpu) || irq_work_needs_cpu()) {
>>>> 		next_jiffies = last_jiffies + 1;
>>>> 		delta_jiffies = 1;
>>>> 
>>>> 
>>> 
>>> 
>> 
> 


  reply	other threads:[~2013-08-08  9:06 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27 20:04 ethan.kernel
2013-07-29 10:18 ` Thomas Gleixner
2013-07-29 11:57   ` Peter Zijlstra
2013-08-08  7:32     ` ethan.zhao
2013-09-05  6:36       ` Mike Galbraith
     [not found]         ` <20130905111428.GB23362@gmail.com>
     [not found]           ` <1378386697.6567.9.camel@marge.simpson.net>
     [not found]             ` <20130905133750.GA26637@gmail.com>
     [not found]               ` <1378445942.5434.31.camel@marge.simpson.net>
     [not found]                 ` <20130909122325.GX31370@twins.programming.kicks-ass.net>
     [not found]                   ` <1378730538.5586.30.camel@marge.simpson.net>
2013-09-09 13:30                     ` Peter Zijlstra
2013-09-09 13:46                       ` Peter Zijlstra
2013-09-11  8:56                         ` Peter Zijlstra
2013-09-11 10:25                           ` Mike Galbraith
2013-10-04 12:06                             ` Ethan Zhao
2013-10-07  4:41                               ` Mike Galbraith
2013-10-07  4:57                                 ` Ethan Zhao
2013-12-12 14:14                                   ` Ethan Zhao
2013-12-12 14:42                                     ` Mike Galbraith
     [not found]   ` <CABawtvP4oLuvHOS3prbbgPShXVziV_wTo7i6KCqJ9KkoVdz0ag@mail.gmail.com>
2013-07-30  9:35     ` Peter Zijlstra
2013-07-30 11:44       ` Ethan Zhao
2013-07-30 11:59         ` Peter Zijlstra
2013-08-03  6:55           ` ethan
2013-08-03  7:37           ` ethan
2013-08-06  7:29       ` Mike Galbraith
2013-08-06  7:46         ` Mike Galbraith
2013-08-08  4:31           ` ethan.zhao
2013-08-08  5:29             ` Mike Galbraith
2013-08-08  5:51               ` Mike Galbraith
2013-08-08  9:04             ` ethan.zhao
2013-08-08  9:05               ` ethan.zhao [this message]
2013-08-08 12:14               ` Mike Galbraith
2013-08-07  8:25         ` Mike Galbraith
2013-08-08  4:05           ` Mike Galbraith
2013-08-08 15:02         ` ethan.zhao
2013-08-09  6:52           ` Mike Galbraith

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=3DC3126A-3ABF-4B2D-8B90-F00DB18C2F29@gmail.com \
    --to=ethan.kernel@gmail.com \
    --cc=bitbucket@online.de \
    --cc=joe.jin@oracle.com \
    --cc=johlstei@codeaurora.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=yinghai@kernel.org \
    --cc=youquan.song@intel.com \
    /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