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: <20240408091605.GE21904@noisy.programming.kicks-ass.net>
Date: Mon, 8 Apr 2024 11:16:05 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Shrikanth Hegde <sshegde@...ux.ibm.com>,
	Valentin Schneider <vschneid@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH 5/5] sched/fair: Rename set_next_buddy() to
 set_next_pick()

On Sun, Apr 07, 2024 at 10:43:19AM +0200, Ingo Molnar wrote:
> This is a mechanism to set the next task_pick target,
> 'buddy' is too ambiguous and refers to a historic feature we
> don't have anymore.
> 
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
> ---
>  kernel/sched/fair.c | 28 +++++++++++++---------------
>  1 file changed, 13 insertions(+), 15 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 93ea653065f5..fe730f232ffd 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3200,7 +3200,16 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
>  	hrtick_update(rq);
>  }
>  
> -static void set_next_buddy(struct sched_entity *se);
> +static void set_next_pick(struct sched_entity *se)
> +{
> +	for_each_sched_entity(se) {
> +		if (SCHED_WARN_ON(!se->on_rq))
> +			return;
> +		if (se_is_idle(se))
> +			return;
> +		cfs_rq_of(se)->next = se;
> +	}
> +}
>  
>  /*
>   * The dequeue_task method is called before nr_running is
> @@ -3240,7 +3249,7 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
>  			 * p is sleeping when it is within its sched_slice.
>  			 */
>  			if (task_sleep && se && !throttled_hierarchy(cfs_rq))
> -				set_next_buddy(se);
> +				set_next_pick(se);
>  			break;
>  		}
>  		flags |= DEQUEUE_SLEEP;
> @@ -4631,17 +4640,6 @@ balance_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
>  static inline void set_task_max_allowed_capacity(struct task_struct *p) {}
>  #endif /* CONFIG_SMP */
>  
> -static void set_next_buddy(struct sched_entity *se)
> -{
> -	for_each_sched_entity(se) {
> -		if (SCHED_WARN_ON(!se->on_rq))
> -			return;
> -		if (se_is_idle(se))
> -			return;
> -		cfs_rq_of(se)->next = se;
> -	}
> -}
> -

Hurmmm.. afaict the only actual user of cfs_rq->next left is task_hot(),
no? Is that thing worth it?

That is, should we not totally nuke the thing?

>  /*
>   * Preempt the current task with a newly woken task if needed:
>   */
> @@ -4769,7 +4767,7 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf
>  		goto simple;
>  
>  	/*
> -	 * Because of the set_next_buddy() in dequeue_task_fair() it is rather
> +	 * Because of the set_next_pick() in dequeue_task_fair() it is rather
>  	 * likely that a next task is from the same cgroup as the current.
>  	 *

So, given you killed the ->next consideration in pick, isn't this
comment 'misleading' at best?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ