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:   Fri, 11 Nov 2022 18:01:29 +0000
From:   Valentin Schneider <vschneid@...hat.com>
To:     Chengming Zhou <zhouchengming@...edance.com>, peterz@...radead.org,
        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
Cc:     linux-kernel@...r.kernel.org,
        Chengming Zhou <zhouchengming@...edance.com>
Subject: Re: [PATCH v2] sched/core: Minor optimize ttwu_runnable()


Hi,

some minor changelog nitpicks, otherwise this LGTM

On 09/11/22 00:24, Chengming Zhou wrote:
> ttwu_runnable() is used as a fast wakeup path when the wakee task
> is running on CPU or runnable on RQ, in both cases we can just
> set its state to TASK_RUNNING to prevent a sleep.
>
> If the wakee task is on_cpu running, we don't need to update_rq_clock()
> or check_preempt_curr().
>
> But if the wakee task is on_rq && !on_cpu (e.g. an IRQ hit before
> the task got to schedule() and the task been preempted), we should
> check_preempt_curr() to see if it can preempt the current running.
>
> This patch reorg ttwu_do_wakeup() and ttwu_do_activate() to make
> ttwu_do_wakeup() only mark the task runnable, so it can be used
> in ttwu_runnable() and try_to_wake_up() fast paths.
>
> As for p->sched_class->task_woken(), ttwu_do_wakeup() needn't it
> anymore, since p isn't a woken task in this case, so should not
> affect RT/DL push/pull.

I would rephrase that last paragraph into something like:
"""
This also removes the class->task_woken() callback from ttwu_runnable(),
which wasn't required per the RT/DL implementations: any required push
operation would have been queued during class->set_next_task() when p
got preempted.

ttwu_runnable() also loses the update to rq->idle_stamp, as by definition
the rq cannot be idle in this scenario.
"""

>
> Signed-off-by: Chengming Zhou <zhouchengming@...edance.com>
> Suggested-by: Valentin Schneider <vschneid@...hat.com>
> Suggested-by: Peter Zijlstra <peterz@...radead.org>

With those changes:

Reviewed-by: Valentin Schneider <vschneid@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ