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]
Message-ID: <417d11b4-d5a2-96c2-8007-5e8f90a422cb@yandex-team.ru>
Date:   Sat, 25 Jan 2020 19:15:16 +0300
From:   Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
To:     Cyrill Gorcunov <gorcunov@...il.com>
Cc:     linux-kernel@...r.kernel.org, Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>,
        Ingo Molnar <mingo@...hat.com>, Mel Gorman <mgorman@...e.de>,
        Dietmar Eggemann <dietmar.eggemann@....com>
Subject: Re: [PATCH] sched/rt: optimize checking group rt scheduler
 constraints



On 25/01/2020 18.32, Cyrill Gorcunov wrote:
> On Sat, Jan 25, 2020 at 05:50:38PM +0300, Konstantin Khlebnikov wrote:
> ...
>> -/* Must be called with tasklist_lock held */
>>   static inline int tg_has_rt_tasks(struct task_group *tg)
>>   {
>> -	struct task_struct *g, *p;
>> +	struct task_struct *task;
>> +	struct css_task_iter it;
>> +	int ret = 0;
>>   
>>   	/*
>>   	 * Autogroups do not have RT tasks; see autogroup_create().
>> @@ -2407,12 +2408,12 @@ static inline int tg_has_rt_tasks(struct task_group *tg)
>>   	if (task_group_is_autogroup(tg))
>>   		return 0;
>>   
>> -	for_each_process_thread(g, p) {
>> -		if (rt_task(p) && task_group(p) == tg)
>> -			return 1;
>> -	}
>> +	css_task_iter_start(&tg->css, 0, &it);
>> +	while (!ret && (task = css_task_iter_next(&it)))
>> +		ret |= rt_task(task);
> 
> Plain 'ret = rt_task(task);' won't work?

Should work too =)

> 
>> +	css_task_iter_end(&it);
>>   
>> -	return 0;
>> +	return ret;
>>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ