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] [day] [month] [year] [list]
Date:   Thu, 6 Aug 2020 16:48:50 +0200
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     benbjiang(蒋彪) <benbjiang@...cent.com>
Cc:     Jiang Biao <benbjiang@...il.com>,
        "mingo@...hat.com" <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        "juri.lelli@...hat.com" <juri.lelli@...hat.com>,
        "vincent.guittot@...aro.org" <vincent.guittot@...aro.org>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        "bsegall@...gle.com" <bsegall@...gle.com>,
        "mgorman@...e.de" <mgorman@...e.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC] sched/fair: simplfy the work when reweighting entity

On 06/08/2020 04:42, benbjiang(蒋彪) wrote:
> 
> 
>> On Aug 6, 2020, at 12:21 AM, Dietmar Eggemann <dietmar.eggemann@....com> wrote:
>>
>> On 04/08/2020 09:12, Jiang Biao wrote:
>>> If a se is on_rq when reweighting entity, all we need should be
>>> updating the load of cfs_rq, other dequeue/enqueue works could be
>>> redundant, such as,
>>> * account_numa_dequeue/account_numa_enqueue
>>> * list_del/list_add from/into cfs_tasks
>>> * nr_running--/nr_running++
>>
>> I think this could make sense. Have you spotted a code path where this
>> gives you a change?
>>
>> I guess only for a task on the rq, so: entity_is_task(se) && se->on_rq
> Yes, you're right. No other code path I spotted except what you list below.
> 
>>
>>> Just simplfy the work. Could be helpful for the hot path.
>>
>> IMHO hotpath is update_cfs_group() -> reweight_entity() but this is only
>> called for '!entity_is_task(se)'.
>>
>> See
>>
>> 3290         if (!gcfs_rq)
>> 3291                 return;
>>
>> in update_cfs_group().
> Yes, It is.
> But *nr_running--/nr_running++* works are still redundant for
> ‘!entity_is_task(se)' hot path. :)

True.

> Besides, I guess we could simplify the logic and make it cleaner and
> more readable with this patch.

Yes.

> If it could make sense to you, would you mind if I resend the patch
> with the commit log amended?

LGTM so why not?

>> The 'entity_is_task(se)' case is
>>
>> set_load_weight(struct task_struct *p, ...) -> reweight_task(p, ...) ->
>> reweight_entity(..., &p->se, ...)
>>
>> but here !se->on_rq.
> Yes, indeed.

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ