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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 6 Jul 2022 15:45:13 +0800
From:   cruzzhao <cruzzhao@...ux.alibaba.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     mingo@...hat.com, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] sched/core: Introduce nr_running percpu for each
 cookie



在 2022/7/4 下午5:45, Peter Zijlstra 写道:
> On Tue, Jun 28, 2022 at 03:57:24PM +0800, Cruz Zhao wrote:
> 
>>  static unsigned long sched_core_alloc_cookie(void)
>>  {
>>  	struct sched_core_cookie *ck = kmalloc(sizeof(*ck), GFP_KERNEL);
>> +	int cpu;
>> +
>>  	if (!ck)
>>  		return 0;
>>  
>>  	refcount_set(&ck->refcnt, 1);
>> +
>> +	ck->nr_running = alloc_percpu(unsigned int);
> 
> 	if (!ck->nr_running)
> 		// do something
> 
>> +	for_each_possible_cpu(cpu)
>> +		*per_cpu_ptr(ck->nr_running, cpu) = 0;
> 
> So I really, as in *really* dislike how this blows up the size of
> cookies. Esp. with 100s of CPUs not actually being rare these days.

My idea is to get the distribution of cookie'd tasks on each runqueue
through ck->nr_running, so as to facilitate optimization of load
balance. Sorry for not stating this in the change log.

This does blow up the size of cookies in scenarios with a large number
of CPUs, and I'll try to get around this problem.

Many thanks for reviewing.
Best wishes,
Cruz Zhao

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ