From: Corey Minyard <cminyard@mvista.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>,
linux-rt-users <linux-rt-users@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Tejun Heo <tj@kernel.org>
Subject: Re: Warning from swake_up_all in 4.14.15-rt13 non-RT
Date: Fri, 9 Mar 2018 10:03:22 -0600 [thread overview]
Message-ID: <e1347561-1cfd-c8d6-6abd-cce800bc1b05@mvista.com> (raw)
In-Reply-To: <20180309145819.af2546nfa4z6qqxm@linutronix.de>
On 03/09/2018 08:58 AM, Sebastian Andrzej Siewior wrote:
> On 2018-03-09 07:29:31 [-0600], Corey Minyard wrote:
>> From what I can tell, wake_up_q() is unbounded, and you have undone what
>> the previous code had tried to accomplish. In the scenario I'm talking
>> about,
>> interrupts are still disabled here. That's why I was asking about where to
>> put
>> wake_up_q(), I knew you could put it here, but it didn't seem to me to help
>> at all.
> So you are worried about unbound latencies on !RT. Okay. So for !RT this
> does not help but it is not worse then before (before the RT patch was
> applied and changed things).
> In fact it is better now (with RT patch and this one) because before
> that patch you would not only open interrupts between the wake up but you
> would leave the function with interrupts open which is wrong. Any
> interrupt (or a context switch due to need-resched() that would invoke
> percpu_ref_put() would freeze the CPU/system.
> Also, every user that invoked swake_up_all() with enabled interrupts
> will still perform the wake up with enabled interrupts. So nothing
> changes here.
Ah, ok, that makes sense. Sorry, I was mixing things up. Yes. on RT
this should
fix the unbounded time issue, and it should also solve the interrupts
disabled
issue on !RT.
I'll try this out.
-corey
>>>> I had another idea. This is only occurring if RT is not enabled, because
>>>> with
>>>> RT all the irq disable things go away and you are generally running in task
>>>> context. So why not have a different version of swake_up_all() for non-RT
>>>> that does work from irqs-off context?
>>> With the patch above I have puzzle part which would allow to use swait
>>> based completions upstream. That ifdef would probably not help.
>> I agree that having a bounded time way to wake up a bunch of threads while
>> interrupts are disabled would solve a bunch of issues. I just don't see how
>> it
>> can be done without pushing it off to a softirq or workqueue.
> true but this is a different story. We started with a WARN_ON() which
> triggered correctly and the problem it pointed to looks solved to me.
>
> This "unbounded runtime during the wake up of many tasks with interrupts
> disabled via percpu_ref_kill() -> blk_queue_usage_counter_release()"
> thing exists already in the vanilla kernel and does not exist
> with the RT patch applied and RT enabled. If you are affected by this
> and you don't like it - fine. Using a workqueue is one way of getting
> around it (the softirq is not preemptible in !RT so it wouldn't change
> much). However, I see no benefit in carrying such a patch because as I
> said only !RT is affected by this.
>
>> -corey
> Sebastian
next prev parent reply other threads:[~2018-03-09 16:03 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-05 15:08 Warning from swake_up_all in 4.14.15-rt13 non-RT Corey Minyard
2018-03-06 17:46 ` Sebastian Andrzej Siewior
2018-03-06 22:51 ` Corey Minyard
2018-03-07 15:45 ` Corey Minyard
2018-03-08 17:41 ` Sebastian Andrzej Siewior
2018-03-08 19:54 ` Corey Minyard
2018-03-09 11:04 ` Sebastian Andrzej Siewior
2018-03-09 13:29 ` Corey Minyard
2018-03-09 14:58 ` Sebastian Andrzej Siewior
2018-03-09 16:03 ` Corey Minyard [this message]
2018-03-09 17:46 ` Peter Zijlstra
2018-03-09 20:25 ` Sebastian Andrzej Siewior
2018-03-09 22:26 ` Peter Zijlstra
2018-03-12 10:51 ` Sebastian Andrzej Siewior
2018-03-12 13:27 ` Peter Zijlstra
2018-03-12 14:11 ` Sebastian Andrzej Siewior
2018-03-12 14:29 ` Peter Zijlstra
2018-03-12 19:51 ` Sebastian Andrzej Siewior
2018-03-13 18:40 ` [RT PATCH 1/2] Revert "block: blk-mq: Use swait" Sebastian Andrzej Siewior
2018-03-13 18:42 ` [RT PATCH 2/2] block: blk-mq: move blk_queue_usage_counter_release() into process context Sebastian Andrzej Siewior
2018-03-13 20:10 ` Peter Zijlstra
2018-03-14 15:23 ` Sebastian Andrzej Siewior
2018-03-09 22:02 ` Warning from swake_up_all in 4.14.15-rt13 non-RT Corey Minyard
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=e1347561-1cfd-c8d6-6abd-cce800bc1b05@mvista.com \
--to=cminyard@mvista.com \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
/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 NNTP newsgroup(s).