linux-um archives
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	linux-um@lists.infradead.org
Cc: richard@nod.at, hch@lst.de
Subject: Re: New Patch series for the UBD Driver
Date: Tue, 13 Nov 2018 08:14:31 -0700	[thread overview]
Message-ID: <1991d24c-eda6-8d07-3d59-cb591c04ac4b@kernel.dk> (raw)
In-Reply-To: <80368030-ddd5-df57-1ecd-28fa91cc37b0@cambridgegreys.com>

On 11/13/18 6:56 AM, Anton Ivanov wrote:
> On 13/11/2018 13:30, Jens Axboe wrote:
>> On 11/13/18 3:15 AM, Anton Ivanov wrote:
>>> I have figured out part of it. It is not caused by the block layer at
>>> all. The offending parts are printks in the io thread. You simply cannot
>>> printk out of there, that causes the spinlock recursion, irqs, on/off,
>>> etc warning.
>>>
>>> This means that any errors MUST be reported only after they have gone
>>> back to the main UML kernel thread.
>> That's a pretty serious issue with UML, there's absolutely nothing wrong
>> with doing printk from IRQ context, or from an IO thread like this one.
>> You don't know what the call stack below you will do for functions you
>> call, this is a ticking time bomb.
> 
> This is not a normal kernel IO thread. It is a host-side helper thread. 
> There are two of those - one for UBD and and one for sigio.
> 
> I am not qualified to judge what is normal and not there, but they 
> operate "outside" normal kernel authority and communicate only via their 
> IPC pipe.
> 
> It is not interrupt context - it is an equivalent of "inside the actual 
> device".

But it's running in the kernel, which means it's eligible to call
any functions. If you have ANY function in your call path that
isn't 100% controller by ubd or UML, then all bets are off.

I don't even see how your new patch 4 fixes anything, whether the
printk happens in the io_thread() or some call off of that should
be the same issue.

-- 
Jens Axboe


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


  reply	other threads:[~2018-11-13 15:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 17:41 New Patch series for the UBD Driver anton.ivanov
2018-11-12 17:41 ` [PATCH 1/3] um: Switch to block-mq constants in the UML UBD driver anton.ivanov
2018-11-12 17:48   ` Jens Axboe
2018-11-12 17:52     ` Anton Ivanov
2018-11-12 17:42 ` [PATCH 2/3] um: Clean-up command processing in " anton.ivanov
2018-11-12 17:42 ` [PATCH 3/3] um: Add support for DISCARD in the UBD Driver anton.ivanov
2018-11-12 17:50 ` New Patch series for " Jens Axboe
2018-11-12 18:00   ` Anton Ivanov
2018-11-12 18:04     ` Jens Axboe
2018-11-12 18:12       ` Anton Ivanov
2018-11-12 18:14         ` Jens Axboe
2018-11-12 18:23           ` Anton Ivanov
2018-11-12 18:24             ` Anton Ivanov
2018-11-12 18:28             ` Jens Axboe
2018-11-12 18:41               ` Anton Ivanov
2018-11-12 19:11                 ` Jens Axboe
2018-11-12 19:26                   ` Jens Axboe
2018-11-13  8:42                     ` Anton Ivanov
2018-11-13 10:15                       ` Anton Ivanov
2018-11-13 10:20                         ` Anton Ivanov
2018-11-13 13:30                         ` Jens Axboe
2018-11-13 13:56                           ` Anton Ivanov
2018-11-13 15:14                             ` Jens Axboe [this message]
2018-11-13 15:24                               ` Anton Ivanov
2018-11-13 15:29                                 ` Jens Axboe

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=1991d24c-eda6-8d07-3d59-cb591c04ac4b@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=hch@lst.de \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    /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