lkml.org 
[lkml]   [2015]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/2] sched/rt: Check to push the task when changing its affinity
From
On 8 February 2015 at 22:55, Xunlei Pang <pang.xunlei@linaro.org> wrote:
> Hi Steve,
>
> On 7 February 2015 at 05:09, Steven Rostedt <rostedt@goodmis.org> wrote:
>> On Thu, 5 Feb 2015 23:59:33 +0800
>>
>> if (task_running(rq, p)) {
>> if (cpumask_test_cpu() && cpupri_find()) {
>> }
>> } else {
>> direct push = 1
>>
>> Also, is the copy of cpus_allowed only done so that cpupri_find is
>> called? If so maybe move it in there too:
>>
>> if (task_running(rq, p)) {
>> if (!cpumask_test_cpu())
>> goto update;
>>
>> cpumask_copy(&p->cpus_allowed, new_mask);
>> p->nr_cpus_allowed = new_weight;
>>
>> if (!cpupri_find())
>> goto update;
>>
>> [...]
>>
>> This way we avoid the double copy of cpumask unless we truly need to do
>> it.
>
> The new_mask can also be used by direct_push case, so I think it's ok.

I guess you mean to avoid the copy if cpumask_test_cpu() is false.
I think this function is not the hot path, making this will make the code
indents too many times or not so good to look, a little awful.

Thanks,
Xunlei


\
 
 \ /
  Last update: 2015-02-08 16:21    [W:0.035 / U:3.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site