mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: Frederic Weisbecker <frederic@kernel.org>,
	Cruz Zhao <CruzZhao@linux.alibaba.com>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com, vschneid@redhat.com, paulmck@kernel.org,
	quic_neeraju@quicinc.com, josh@joshtriplett.org,
	boqun.feng@gmail.com, mathieu.desnoyers@efficios.com,
	jiangshanlai@gmail.com, qiang1.zhang@intel.com,
	jstultz@google.com, clingutla@codeaurora.org,
	nsaenzju@redhat.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org,
	Vineeth Pillai <vineeth@bitbyteword.org>
Subject: Re: [PATCH v2] sched/core: introduce sched_core_idle_cpu()
Date: Mon, 26 Jun 2023 21:07:54 -0400	[thread overview]
Message-ID: <47c1dc89-2a1e-99df-aae1-7147dc281a67@joelfernandes.org> (raw)
In-Reply-To: <ZJixj2RJrp8A8POz@localhost.localdomain>

On 6/25/23 17:28, Frederic Weisbecker wrote:
>>   drivers/tty/sysrq.c     |  2 +-
>>   include/linux/sched.h   |  2 ++
>>   kernel/rcu/tree_stall.h |  2 +-
>>   kernel/sched/core.c     | 13 +++++++++++++
>>   kernel/softirq.c        |  2 +-
>>   5 files changed, 18 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
>> index b6e70c5cfa17..8a6586800385 100644
>> --- a/drivers/tty/sysrq.c
>> +++ b/drivers/tty/sysrq.c
>> @@ -232,7 +232,7 @@ static void showacpu(void *dummy)
>>   	unsigned long flags;
>>   
>>   	/* Idle CPUs have no interesting backtrace. */
>> -	if (idle_cpu(smp_processor_id())) {
>> +	if (sched_core_idle_cpu(smp_processor_id())) {
>>   		pr_info("CPU%d: backtrace skipped as idling\n", smp_processor_id());
> Actually perhaps an idle injection's backtrace is worth dumping. I guess
> it might accidentally produce lockups and it's worth knowing the source then.
> 
> Though I don't have a strong opinion on that...
> 
>>   		return;
>>   	}
>> diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
>> index b10b8349bb2a..6169faf30ecd 100644
>> --- a/kernel/rcu/tree_stall.h
>> +++ b/kernel/rcu/tree_stall.h
>> @@ -418,7 +418,7 @@ static bool rcu_is_rcuc_kthread_starving(struct rcu_data *rdp, unsigned long *jp
>>   		return false;
>>   
>>   	cpu = task_cpu(rcuc);
>> -	if (cpu_is_offline(cpu) || idle_cpu(cpu))
>> +	if (cpu_is_offline(cpu) || sched_core_idle_cpu(cpu))
> An idle injection could possibly starve the RCU boost kthread, and then it's
> worth knowing about it. I would suggest keeping idle_cpu() here.
> 

Actually I think it should just be idle_cpu() for rcu_is_rcuc_kthread_starving() 
and showacpu() because "force idling" is different from "idling".

Force idling happens because there is something incompatible on the sibling 
runqueue in the core. That just makes the 2 runqueues on the core appear to be a 
single runqueue. The concept of "force idling" is more closer to "preemption of 
tasks on a single runqueue".

Considering that, I would vote for only converting the tick user. If force 
idling happens for too long, it'd be good to know that as Frederic also mentioned.

thanks,

  - Joel







      reply	other threads:[~2023-06-27  1:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-24 18:28 Cruz Zhao
2023-06-25 21:28 ` Frederic Weisbecker
2023-06-27  1:07   ` Joel Fernandes [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=47c1dc89-2a1e-99df-aae1-7147dc281a67@joelfernandes.org \
    --to=joel@joelfernandes.org \
    --cc=CruzZhao@linux.alibaba.com \
    --cc=boqun.feng@gmail.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=clingutla@codeaurora.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=frederic@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiangshanlai@gmail.com \
    --cc=jirislaby@kernel.org \
    --cc=josh@joshtriplett.org \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=nsaenzju@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qiang1.zhang@intel.com \
    --cc=quic_neeraju@quicinc.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vineeth@bitbyteword.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

all inboxes | Powered by JetHome®