public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
To: Adam Li <adamli@os.amperecomputing.com>
Cc: peterz@infradead.org, mingo@redhat.com, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, linux-kernel@vger.kernel.org,
	patches@amperecomputing.com, cl@linux.com,
	christian.loehle@arm.com,
	Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Subject: Re: [PATCH v2 3/3] sched/fair: Update comments regarding last and skip buddy
Date: Thu, 13 Mar 2025 14:00:34 +0530	[thread overview]
Message-ID: <3e31e4b7-d4de-4e23-a208-50effb4894a5@linux.ibm.com> (raw)
In-Reply-To: <20241127055610.7076-4-adamli@os.amperecomputing.com>

Hi Adam,

On 27/11/24 11:26, Adam Li wrote:
> Commit 5e963f2bd465 ("sched/fair: Commit to EEVDF") removed the "last"
> and "skip" buddy. Update comments in pick_next_entity().
> 
> Signed-off-by: Adam Li <adamli@os.amperecomputing.com>
> Reviewed-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
> ---
>  kernel/sched/fair.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index d5a3b5589e4e..259c56dcdff6 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5602,17 +5602,11 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
>  
>  static int dequeue_entities(struct rq *rq, struct sched_entity *se, int flags);
>  
> -/*
> - * Pick the next process, keeping these things in mind, in this order:
> - * 1) keep things fair between processes/task groups
> - * 2) pick the "next" process, since someone really wants that to run
> - * 3) pick the "last" process, for cache locality
> - * 4) do not run the "skip" process, if something else is available
> - */
>  static struct sched_entity *
>  pick_next_entity(struct rq *rq, struct cfs_rq *cfs_rq)
>  {
>  	/*
> +	 * Pick the "next" buddy, since someone really wants that to run.
>  	 * Enabling NEXT_BUDDY will affect latency but not fairness.
>  	 */
>  	if (sched_feat(NEXT_BUDDY) &&

There is one more reference to LAST_BUDDY in check_preempt_wakeup_fair.

Regarding pick_next_entity, the first two points are still valid, so only
points 3 and 4 could be removed?

Something like below

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 9dafb374d76d..379dbcbb24e9 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5578,8 +5578,6 @@ static int dequeue_entities(struct rq *rq, struct sched_entity *se, int flags);
  * Pick the next process, keeping these things in mind, in this order:
  * 1) keep things fair between processes/task groups
  * 2) pick the "next" process, since someone really wants that to run
- * 3) pick the "last" process, for cache locality
- * 4) do not run the "skip" process, if something else is available
  */
 static struct sched_entity *
 pick_next_entity(struct rq *rq, struct cfs_rq *cfs_rq)
@@ -8780,9 +8778,7 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
         *
         * Note: this also catches the edge-case of curr being in a throttled
         * group (e.g. via set_curr_task), since update_curr() (in the
-        * enqueue of curr) will have resulted in resched being set.  This
-        * prevents us from potentially nominating it as a false LAST_BUDDY
-        * below.
+        * enqueue of curr) will have resulted in resched being set.
         */
        if (test_tsk_need_resched(rq->curr))
                return;

Thanks,
Madadi Vineeth Reddy

  reply	other threads:[~2025-03-13  8:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-27  5:56 [PATCH v2 0/3] sched/fair: Fix NEXT_BUDDY panic and warning Adam Li
2024-11-27  5:56 ` [PATCH v2 1/3] sched/fair: Fix warning if NEXT_BUDDY enabled Adam Li
2024-11-28  7:29   ` K Prateek Nayak
2024-11-29  3:21     ` Adam Li
2024-11-29  4:28       ` K Prateek Nayak
2024-11-29  7:40         ` Adam Li
2024-11-29  8:00           ` K Prateek Nayak
2024-11-29  9:55     ` Peter Zijlstra
2024-11-29 10:15       ` [PATCH] sched/fair: Untangle NEXT_BUDDY and pick_next_task() Peter Zijlstra
2024-11-29 10:18         ` Peter Zijlstra
2024-11-29 10:37           ` Adam Li
2024-11-29 11:45             ` Peter Zijlstra
2024-12-06  6:47         ` Adam Li
2024-12-09 11:00         ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2024-11-29 17:46       ` [PATCH v2 1/3] sched/fair: Fix warning if NEXT_BUDDY enabled K Prateek Nayak
2024-11-29 17:53         ` K Prateek Nayak
2024-12-03 16:05     ` Peter Zijlstra
2024-12-03 16:48       ` K Prateek Nayak
2024-12-09 11:00     ` [tip: sched/core] sched/fair: Fix NEXT_BUDDY tip-bot2 for K Prateek Nayak
2024-11-27  5:56 ` [PATCH v2 2/3] sched/fair: Fix panic if pick_eevdf() returns NULL Adam Li
2024-11-29  9:18   ` Peter Zijlstra
2024-11-27  5:56 ` [PATCH v2 3/3] sched/fair: Update comments regarding last and skip buddy Adam Li
2025-03-13  8:30   ` Madadi Vineeth Reddy [this message]
2025-03-14  2:53     ` Adam Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e31e4b7-d4de-4e23-a208-50effb4894a5@linux.ibm.com \
    --to=vineethr@linux.ibm.com \
    --cc=adamli@os.amperecomputing.com \
    --cc=bsegall@google.com \
    --cc=christian.loehle@arm.com \
    --cc=cl@linux.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=patches@amperecomputing.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox