public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fernand Sieber <sieberf@amazon.com>
To: <kprateek.nayak@amd.com>
Cc: <mingo@redhat.com>, <peterz@infradead.org>,
	<linux-kernel@vger.kernel.org>, <juri.lelli@redhat.com>,
	<vincent.guittot@linaro.org>, <dietmar.eggemann@arm.com>,
	<rostedt@goodmis.org>, <bsegall@google.com>,
	<mgorman@techsingularity.net>, <vschneid@redhat.com>,
	<dwmw@amazon.co.uk>, <jschoenh@amazon.de>, <liuyuxua@amazon.com>
Subject: Re: [PATCH] sched/fair: Add more core cookie check in wake up fast path
Date: Fri, 21 Nov 2025 13:17:54 +0200	[thread overview]
Message-ID: <20251121111754.374593-1-sieberf@amazon.com> (raw)
In-Reply-To: <92c22ad2-d84c-44e4-b34f-a80f7f3748a6@amd.com>

Hi Prateek,

Thank you for taking the time to review my patch.

On 11/21/2025 2:54 AM, K Prateek Nayak wrote:
> nit.
>
> You can replace the whole
>
>   (available_idle_cpu() || sched_idle_cpu()) && sched_core_cookie_match()
>
> with "__select_idle_cpu() != 1" [...]

I'm happy to do some code cleanup, however note that `__select_idle_cpu`
is using `sched_cpu_cookie_match` whereas at this point in
`select_idle_sibling` we don't know whether there's a full idle core or not
available so I am proposing to use `sched_core_cookie_match`.

We might be able to do the following alternatives:
* use `__select_idle_cpu` (e.g `sched_cpu_cookie_match`) and ignore the case
  where the cpu might be idle but one of its siblings run an incompatible
  cookie. Perhaps simpler code but could yield more force idle.
* use `test_idle_cores` before deciding whether `sched_cpu_cookie_match` or
  `sched_core_cookie_match` is appropriate. This is the most correct but
  perhaps overly complex.

The approach that I picked has the disadvantages that it might fail some
fast heuristics unnecessarily if there are no full idle core available
anyways but I thought this was acceptable since the `select_idle_cpu`
fallback at the end of the function seems reasonable.

Let me know what you think.

Best regards,
Fernand



Amazon Development Centre (South Africa) (Proprietary) Limited
29 Gogosoa Street, Observatory, Cape Town, Western Cape, 7925, South Africa
Registration Number: 2004 / 034463 / 07


      reply	other threads:[~2025-11-21 11:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 10:19 [PATCH] sched/fair: Add more core cookie check in wake up fast path Fernand Sieber
2025-11-21  2:54 ` K Prateek Nayak
2025-11-21 11:17   ` Fernand Sieber [this message]

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=20251121111754.374593-1-sieberf@amazon.com \
    --to=sieberf@amazon.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=dwmw@amazon.co.uk \
    --cc=jschoenh@amazon.de \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyuxua@amazon.com \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@redhat.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