lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 8 Aug 2013 17:04:40 +0800
From:	"ethan.zhao" <ethan.kernel@...il.com>
To:	Mike Galbraith <bitbucket@...ine.de>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>, johlstei@...eaurora.org,
	Yinghai Lu <yinghai@...nel.org>, Jin Feng <joe.jin@...cle.com>,
	Youquan Song <youquan.song@...el.com>,
	LenBrown <len.brown@...el.com>
Subject: Re: [PATCH V3]hrtimer: Fix a performance regression by disable reprogramming in remove_hrtimer

Kernel 3.11-rc1 +Peterz' patch+ Mike's patch, No C-states in BIOS, got the same result as only Peter's patch.
Of course , No C states to enter, make sense.
[root@...alhost ~]# time ./pip1m

real	0m4.381s
user	0m0.099s
sys	0m2.784s
[root@...alhost ~]# time ./pip1m

real	0m4.436s
user	0m0.093s
sys	0m2.809s
[root@...alhost ~]# 

Retest with C-states enabled in BIOS
[root@...alhost ~]# time ./pip1m

real	0m8.670s
user	0m0.203s
sys	0m5.459s
[root@...alhost ~]# time ./pip1m

real	0m8.489s
user	0m0.184s
sys	0m5.360s
[root@...alhost ~]# 

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@...alhost ~]# time ./pip1m

real	0m10.683s
user	0m0.204s
sys	0m6.597s
[root@...alhost ~]# time ./pip1m

real	0m10.629s
user	0m0.185s
sys	0m6.546s

So revert Mike's patch and retest, got
[root@...alhost ~]# time ./pip1m

real	0m8.606s
user	0m0.193s
sys	0m5.449s
[root@...alhost ~]# time ./pip1m

real	0m8.655s
user	0m0.198s
sys	0m5.519s
[root@...alhost ~]# 

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@...alhost ~]# time ./pip1m

real	0m3.915s
user	0m0.088s
sys	0m2.487s
[root@...alhost ~]# time ./pip1m

real	0m3.929s
user	0m0.082s
sys	0m2.560s
[root@...alhost ~]# 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@...il.com> 写道:
>>> 
>>> sched: ratelimit nohz
>>> 
>>> Entering nohz code on every micro-idle is too expensive to bear.
>>> 
>>> Signed-off-by: Mike Galbraith <efault@....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;
>>> 
>>> 
>> 
>> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ