From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Schspa Shi <schspa@gmail.com>
Cc: rostedt@goodmis.org, linux-kernel@vger.kernel.org,
linux-rt-users@vger.kernel.org
Subject: Re: [RFC PATCH] irq_work: wakeup irq_workd when queued first rt_lazy work
Date: Thu, 18 Aug 2022 18:28:02 +0200 [thread overview]
Message-ID: <Yv5okqzH92iPytgl@linutronix.de> (raw)
In-Reply-To: <20220711172314.603717-1-schspa@gmail.com>
On 2022-07-12 01:23:15 [+0800], Schspa Shi wrote:
> I want to know if this difference is by design.
Yes. type1 (LAZY) does not need immediate action but can't be scheduled
regularly like a workqueue.
> If this is by design, we have a problem that the irq_work of type2
> will not execute as quickly as expected, it may be delayed by the
> irq_work of type1.
>
> Please consider the following scenarios:
>
> If the CPU queued a type1 irq_work A, and then a type2 irq_work B.
> But we won't make B executed quickly, because we won't issue the IPI
> interrupt to wakeup irq_workd (the llist_add call will return false).
But those two are different lists. So adding type1 to list1 does not
affect type2 with list2
> This PATCH will issue the IPI_IRQ_WORK to make B execute quickly.
>
> One thing that needs to be optimized is that we now have
> lazy_list.node.llist and lazy_work_raised which need to be granted
> to be atomicity, disabled the local CPU IRQ to make this atomic.
> There should be a better way to make these two variants to be atomically
> and I can go in deep if this little problem is not by design, and need
> to be fixed.
>
> If these two types of irq_work should be the same with the priority.
> maybe we should change.
>
> if (!lazy_work || tick_nohz_tick_stopped()) {
> arch_irq_work_raise();
> }
>
> to
>
> if (!(lazy_work || rt_lazy_work) || tick_nohz_tick_stopped()) {
> arch_irq_work_raise();
> }
but we wait for the timer for the lazy-work. RT has more LAZY items
compared to !RT. So if there is an error then it should be visible
there, too.
Is there a problem with this? Adding (as you call it) type1 item does
not affect type2 items. They will will processed asap.
Sebastian
next prev parent reply other threads:[~2022-08-18 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 17:23 [RFC PATCH] irq_work: wakeup irq_workd when queued first rt_lazy work Schspa Shi
2022-08-18 16:28 ` Sebastian Andrzej Siewior [this message]
2022-08-18 19:56 ` Schspa Shi
2022-08-18 20:42 ` Schspa Shi
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=Yv5okqzH92iPytgl@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=schspa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox