Linux-S390 Archive mirror
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@linux.ibm.com>
To: Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>
Cc: Valentin Schneider <vschneid@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/core: Test online status in available_idle_cpu()
Date: Thu, 16 May 2024 18:38:06 +0200	[thread overview]
Message-ID: <yt9dcyplg1ap.fsf@linux.ibm.com> (raw)
In-Reply-To: <yt9dcypwrc96.fsf@linux.ibm.com> (Sven Schnelle's message of "Wed, 08 May 2024 09:31:01 +0200")

Sven Schnelle <svens@linux.ibm.com> writes:

> Valentin Schneider <vschneid@redhat.com> writes:
>
>> On 29/04/24 07:54, Sven Schnelle wrote:
>>> The current implementation of available_idle_cpu() doesn't test
>>> whether a possible cpu is offline. On s390 this dereferences a
>>> NULL pointer in arch_vcpu_is_preempted() because lowcore is not
>>> allocated for offline cpus. On x86, tracing also shows calls to
>>> available_idle_cpu() after a cpu is disabled, but it looks like
>>> this isn't causing any (obvious) issue. Nevertheless, add a check
>>> and return early if the cpu isn't online.
>>>
>>> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
>>
>>
>> So most of the uses of that function is in wakeup task placement.
>> o find_idlest_cpu() works on the sched_domain spans, so shouldn't
> deal with
>>   offline CPUs.
>> o select_idle_sibling() may issue an available_idle_cpu(prev) with
> an
>>   offline previous, which would trigger your issue.
>>
>> Currently, even if select_idle_sibling() picks an offline CPU, this
> will
>> get corrected by select_fallback_rq() at the end of
>> select_task_rq(). However, it would make sense to realize @prev
> isn't a
>> suitable pick before making it to the fallback machinery, in which
> case
>> your patch makes sense beyond just fixing s390.
>>
>> Reviewed-by: Valentin Schneider <vschneid@redhat.com>
>
> Thanks for the review! Ingo/Peter, gentle ping, are you planning to
> take
> this patch?

Ping?

Thanks,

Sven

      reply	other threads:[~2024-05-16 16:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  5:54 [PATCH] sched/core: Test online status in available_idle_cpu() Sven Schnelle
2024-05-02 15:57 ` Valentin Schneider
2024-05-08  7:31   ` Sven Schnelle
2024-05-16 16:38     ` Sven Schnelle [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=yt9dcyplg1ap.fsf@linux.ibm.com \
    --to=svens@linux.ibm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hca@linux.ibm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mgorman@suse.de \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).