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: <20230617122622.GC1830050@hirez.programming.kicks-ass.net>
Date:   Sat, 17 Jun 2023 14:26:22 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Miaohe Lin <linmiaohe@...wei.com>
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, vschneid@...hat.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/deadline: Use helper function task_current()

On Sat, Jun 17, 2023 at 03:43:05PM +0800, Miaohe Lin wrote:
> Use helper function task_current() to check whether task is currently
> running on the runqueue. No functional change intended.

Why though? this makes no sense. Please leave perfectly fine code alone.

> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
>  kernel/sched/deadline.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index f827067ad03b..23284229e16b 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -2424,7 +2424,7 @@ static void pull_dl_task(struct rq *this_rq)
>  		 */
>  		if (p && dl_time_before(p->dl.deadline, dmin) &&
>  		    dl_task_is_earliest_deadline(p, this_rq)) {
> -			WARN_ON(p == src_rq->curr);
> +			WARN_ON(task_current(src_rq, p));
>  			WARN_ON(!task_on_rq_queued(p));
>  
>  			/*
> @@ -2636,7 +2636,7 @@ static void switched_to_dl(struct rq *rq, struct task_struct *p)
>  		return;
>  	}
>  
> -	if (rq->curr != p) {
> +	if (!task_current(rq, p)) {
>  #ifdef CONFIG_SMP
>  		if (p->nr_cpus_allowed > 1 && rq->dl.overloaded)
>  			deadline_queue_push_tasks(rq);
> -- 
> 2.27.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ