All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Qiang1" <qiang1.zhang@intel.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: "paulmck@kernel.org" <paulmck@kernel.org>,
	"frederic@kernel.org" <frederic@kernel.org>,
	"urezki@gmail.com" <urezki@gmail.com>,
	"quic_neeraju@quicinc.com" <quic_neeraju@quicinc.com>,
	"josh@joshtriplett.org" <josh@joshtriplett.org>,
	"juri.lelli@redhat.com" <juri.lelli@redhat.com>,
	"rcu@vger.kernel.org" <rcu@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v3] rcu: Only boost rcu reader tasks with lower priority than boost kthreads
Date: Sat, 12 Mar 2022 03:11:04 +0000	[thread overview]
Message-ID: <PH0PR11MB58807AD9A1BAA122218B92DBDA0D9@PH0PR11MB5880.namprd11.prod.outlook.com> (raw)
In-Reply-To: <PH0PR11MB58802B8804EDFFC73BA676F2DA0D9@PH0PR11MB5880.namprd11.prod.outlook.com>

On 2022-03-11 10:22:26 [+0800], Zqiang wrote:
> When RCU_BOOST is enabled, the boost kthreads will boosting readers
> who are blocking a given grace period, if the current reader tasks
                                       ^ Period.

> have a higher priority than boost kthreads(the boost kthreads priority
> not always 1, if the kthread_prio is set), 

>>This confuses me:
>>- Why does this matter

In preempt-rt system, if the kthread_prio is not set, it prio is 1.
the boost kthreads can preempt almost  rt task, It will affect
the real-time performance of some user rt  tasks.  In preempt-rt systems,
in most scenarios, this kthread_prio will be configured.

Thanks
Zqiang

>>- If it is not RT prio, what is then? Higher or lower? Afaik it is
>>  always >= 1.

>>>If it is not RT prio, the sanitize_kthread_prio() will limit RT prio

> boosting is useless, skip
> current task and select next task to boosting, reduce the time for a
> given grace period.

>>So if the task, that is stuck in a rcu_read() section, has a higher
>>priority than the boosting thread then boosting is futile. Understood.
>>
>>Please correct me if I'm wrong but this is intended for !SCHED_OTHER
>>tasks since there shouldn't a be PI chain on boost_mtx so that its
>>default RT priority is boosted above what has been configured.

>>>Yes, you are right. If the boosting task which itself already boosted due to PI chain,
>>>and Its priority may only be temporarily higher than boost kthreads,  once that
>>>PI boost is lifted the task may still be in a RCU section, but if we have been skipped it,
>>>this task have been missed the opportunity to be boosted.

>>
>>You skip boosting tasks which are itself already boosted due to a PI
>>chain. Once that PI boost is lifted the task may still be in a RCU
>>section. But if I understand you right, your intention is skip boosting
>>tasks with a higher priority and concentrate and those which are in
>>need. This shouldn't make a difference unless the scheduler is able to
>>move the rcu-boosted task to another CPU.
>>

>>>Yes, It make sense when the rcu-boosted kthreads and task which to be boosting
>>>should run  difference CPU .

>>Am I right so far? If so this should be part of the commit message (the
>>intention and the result). Also, please add that part with
>>boost_exp_tasks. The comment above boost_mtx is now above
>>boost_exp_tasks with a space so it looks (at least to me) like these two
>>don't belong together.

>>>Yes, I will add your description to the commit  information.


> Suggested-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> Signed-off-by: Zqiang <qiang1.zhang@intel.com>

>Sebastian

  reply	other threads:[~2022-03-12  3:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11  2:22 [PATCH v3] rcu: Only boost rcu reader tasks with lower priority than boost kthreads Zqiang
2022-03-11 11:09 ` Sebastian Andrzej Siewior
2022-03-12  2:57   ` Zhang, Qiang1
2022-03-12  3:11     ` Zhang, Qiang1 [this message]
2022-03-16 16:59       ` Paul E. McKenney
2022-03-18  5:50         ` Zhang, Qiang1
2022-03-18 14:57           ` Paul E. McKenney
2022-03-30 19:35             ` Uladzislau Rezki
2022-03-30 20:21               ` Paul E. McKenney

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=PH0PR11MB58807AD9A1BAA122218B92DBDA0D9@PH0PR11MB5880.namprd11.prod.outlook.com \
    --to=qiang1.zhang@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=josh@joshtriplett.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=quic_neeraju@quicinc.com \
    --cc=rcu@vger.kernel.org \
    --cc=urezki@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.