From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Amit Shah <amit.shah@redhat.com>
Cc: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org,
linux-kernel@vger.kernel.org, miltonm@bga.com,
qemu-devel@nongnu.org, borntraeger@de.ibm.com,
brueckner@linux.vnet.ibm.com,
virtualization@lists.linux-foundation.org, alan@linux.intel.com
Subject: Re: Extending virtio_console to support multiple ports
Date: Thu, 27 Aug 2009 14:07:03 +1000 [thread overview]
Message-ID: <1251346023.20467.21.camel@pasglop> (raw)
In-Reply-To: <20090826154552.GA31910@amit-x200.redhat.com>
On Wed, 2009-08-26 at 21:15 +0530, Amit Shah wrote:
>
> > - Convert hvc's usage of spinlocks to mutexes. I've no idea how this
> > will play out; I'm no expert here. But I did try doing this and so far
> > it all looks OK. No lockups, lockdep warnings, nothing. I have full
> > debugging enabled. But this doesn't mean it's right.
>
> So just to test this further I added the capability to have more than
> one hvc console spawn from virtio_console, created two consoles and did
> a 'cat' of a file in each of the virtio-consoles. It's been running for
> half an hour now without any badness. No spew in debug logs too.
>
> I also checked the code in hvc_console.c that takes the spin_locks.
> Nothing there that runs from (or needs to run from) interrupt context.
> So the change to mutexes does seem reasonable. Also, the spinlock code
> was added really long back -- git blame shows Linus' first git commit
> introduced them in the git history, so it's pure legacy baggage.
Two things here:
- First you seem to have completely missed the fact that hvc_poll() can
be called from interrupt time :-) Look at hvc_irq.c which is used by
some backends. Maybe that can be "fixed" by deferring to a work queue,
though it's nice to have the keyboard input have somewhat of a higher
priority than anything else here.
So unless that's fixed, or I missed something, that's a big NACK for
now.
- Then, are we certain that there's no case where the tty layer will
call us with some lock held or in an atomic context ? To be honest, I've
totally lost track of the locking rules in tty land lately so it might
well be ok, but something to verify.
Cheers,
Ben.
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Amit Shah <amit.shah@redhat.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
virtualization@lists.linux-foundation.org,
borntraeger@de.ibm.com, linux-kernel@vger.kernel.org,
miltonm@bga.com, linuxppc-dev@ozlabs.org,
brueckner@linux.vnet.ibm.com, alan@linux.intel.com
Subject: Re: Extending virtio_console to support multiple ports
Date: Thu, 27 Aug 2009 14:07:03 +1000 [thread overview]
Message-ID: <1251346023.20467.21.camel@pasglop> (raw)
In-Reply-To: <20090826154552.GA31910@amit-x200.redhat.com>
On Wed, 2009-08-26 at 21:15 +0530, Amit Shah wrote:
>
> > - Convert hvc's usage of spinlocks to mutexes. I've no idea how this
> > will play out; I'm no expert here. But I did try doing this and so far
> > it all looks OK. No lockups, lockdep warnings, nothing. I have full
> > debugging enabled. But this doesn't mean it's right.
>
> So just to test this further I added the capability to have more than
> one hvc console spawn from virtio_console, created two consoles and did
> a 'cat' of a file in each of the virtio-consoles. It's been running for
> half an hour now without any badness. No spew in debug logs too.
>
> I also checked the code in hvc_console.c that takes the spin_locks.
> Nothing there that runs from (or needs to run from) interrupt context.
> So the change to mutexes does seem reasonable. Also, the spinlock code
> was added really long back -- git blame shows Linus' first git commit
> introduced them in the git history, so it's pure legacy baggage.
Two things here:
- First you seem to have completely missed the fact that hvc_poll() can
be called from interrupt time :-) Look at hvc_irq.c which is used by
some backends. Maybe that can be "fixed" by deferring to a work queue,
though it's nice to have the keyboard input have somewhat of a higher
priority than anything else here.
So unless that's fixed, or I missed something, that's a big NACK for
now.
- Then, are we certain that there's no case where the tty layer will
call us with some lock held or in an atomic context ? To be honest, I've
totally lost track of the locking rules in tty land lately so it might
well be ok, but something to verify.
Cheers,
Ben.
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Amit Shah <amit.shah@redhat.com>
Cc: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org,
linux-kernel@vger.kernel.org, miltonm@bga.com,
qemu-devel@nongnu.org, borntraeger@de.ibm.com,
brueckner@linux.vnet.ibm.com,
virtualization@lists.linux-foundation.org, alan@linux.intel.com
Subject: [Qemu-devel] Re: Extending virtio_console to support multiple ports
Date: Thu, 27 Aug 2009 14:07:03 +1000 [thread overview]
Message-ID: <1251346023.20467.21.camel@pasglop> (raw)
In-Reply-To: <20090826154552.GA31910@amit-x200.redhat.com>
On Wed, 2009-08-26 at 21:15 +0530, Amit Shah wrote:
>
> > - Convert hvc's usage of spinlocks to mutexes. I've no idea how this
> > will play out; I'm no expert here. But I did try doing this and so far
> > it all looks OK. No lockups, lockdep warnings, nothing. I have full
> > debugging enabled. But this doesn't mean it's right.
>
> So just to test this further I added the capability to have more than
> one hvc console spawn from virtio_console, created two consoles and did
> a 'cat' of a file in each of the virtio-consoles. It's been running for
> half an hour now without any badness. No spew in debug logs too.
>
> I also checked the code in hvc_console.c that takes the spin_locks.
> Nothing there that runs from (or needs to run from) interrupt context.
> So the change to mutexes does seem reasonable. Also, the spinlock code
> was added really long back -- git blame shows Linus' first git commit
> introduced them in the git history, so it's pure legacy baggage.
Two things here:
- First you seem to have completely missed the fact that hvc_poll() can
be called from interrupt time :-) Look at hvc_irq.c which is used by
some backends. Maybe that can be "fixed" by deferring to a work queue,
though it's nice to have the keyboard input have somewhat of a higher
priority than anything else here.
So unless that's fixed, or I missed something, that's a big NACK for
now.
- Then, are we certain that there's no case where the tty layer will
call us with some lock held or in an atomic context ? To be honest, I've
totally lost track of the locking rules in tty land lately so it might
well be ok, but something to verify.
Cheers,
Ben.
next prev parent reply other threads:[~2009-08-27 4:07 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-25 6:17 Extending virtio_console to support multiple ports Amit Shah
2009-08-25 6:17 ` [Qemu-devel] " Amit Shah
2009-08-25 6:17 ` [PATCH] virtio_console: Add interface for guest and host communication Amit Shah
2009-08-25 6:17 ` [Qemu-devel] " Amit Shah
2009-08-25 6:17 ` [PATCH 1/3] char: Emit 'CLOSED' events on char device close Amit Shah
2009-08-25 6:17 ` Amit Shah
2009-08-25 6:17 ` [Qemu-devel] " Amit Shah
2009-08-25 6:17 ` [PATCH 2/3] virtio-console: rename dvq to ovq Amit Shah
2009-08-25 6:17 ` [Qemu-devel] " Amit Shah
2009-08-25 6:17 ` Amit Shah
2009-08-25 6:17 ` [PATCH] virtio_console: Add interface for guest and host communication Amit Shah
2009-08-25 8:16 ` [PATCH 3/3] virtio-console: Add interface for generic guest-host communication Amit Shah
2009-08-25 8:16 ` [Qemu-devel] " Amit Shah
2009-08-25 8:16 ` Amit Shah
2009-08-26 11:27 ` Extending virtio_console to support multiple ports Amit Shah
2009-08-26 11:27 ` Amit Shah
2009-08-26 11:27 ` [Qemu-devel] " Amit Shah
2009-08-26 15:45 ` Amit Shah
2009-08-26 15:45 ` Amit Shah
2009-08-26 15:45 ` [Qemu-devel] " Amit Shah
2009-08-26 15:45 ` Amit Shah
2009-08-27 4:07 ` Benjamin Herrenschmidt [this message]
2009-08-27 4:07 ` [Qemu-devel] " Benjamin Herrenschmidt
2009-08-27 4:07 ` Benjamin Herrenschmidt
2009-08-27 6:51 ` [Qemu-devel] " Amit Shah
2009-08-27 6:51 ` Amit Shah
2009-08-27 6:51 ` Amit Shah
2009-08-27 9:08 ` Alan Cox
2009-08-27 9:08 ` [Qemu-devel] " Alan Cox
2009-08-27 9:08 ` Alan Cox
2009-08-27 9:27 ` Benjamin Herrenschmidt
2009-08-27 9:27 ` [Qemu-devel] " Benjamin Herrenschmidt
2009-08-27 9:27 ` Benjamin Herrenschmidt
2009-08-27 11:45 ` [PATCH] hvc_console: provide (un)locked version for hvc_resize() Hendrik Brueckner
2009-08-27 11:45 ` [Qemu-devel] " Hendrik Brueckner
2009-08-27 11:45 ` Hendrik Brueckner
2009-08-27 11:45 ` Hendrik Brueckner
2009-08-27 9:27 ` Extending virtio_console to support multiple ports Benjamin Herrenschmidt
2009-08-29 1:15 ` [Qemu-devel] " Jamie Lokier
2009-08-29 1:15 ` Jamie Lokier
2009-08-29 1:15 ` Jamie Lokier
2009-08-27 9:08 ` Alan Cox
2009-08-27 4:07 ` Benjamin Herrenschmidt
2009-08-27 5:04 ` Michael Ellerman
2009-08-27 5:04 ` Michael Ellerman
2009-08-27 5:04 ` [Qemu-devel] " Michael Ellerman
2009-08-27 5:04 ` Michael Ellerman
2009-08-27 6:52 ` Amit Shah
2009-08-27 6:52 ` Amit Shah
2009-08-27 6:52 ` [Qemu-devel] " Amit Shah
2009-08-27 6:52 ` Amit Shah
2009-08-27 14:13 ` Ryan Arnold
2009-08-27 14:13 ` Ryan Arnold
2009-08-27 14:13 ` [Qemu-devel] " Ryan Arnold
2009-08-27 14:13 ` Ryan Arnold
2009-08-28 17:00 ` Anthony Liguori
2009-08-28 17:00 ` [Qemu-devel] " Anthony Liguori
2009-08-30 10:10 ` Amit Shah
2009-08-30 10:10 ` [Qemu-devel] " Amit Shah
2009-08-30 12:48 ` Anthony Liguori
2009-08-30 12:48 ` [Qemu-devel] " Anthony Liguori
2009-08-30 13:17 ` Amit Shah
2009-08-30 13:17 ` Amit Shah
2009-08-30 13:17 ` [Qemu-devel] " Amit Shah
2009-08-31 13:17 ` Anthony Liguori
2009-08-31 13:17 ` [Qemu-devel] " Anthony Liguori
2009-08-31 13:51 ` Amit Shah
2009-08-31 13:51 ` [Qemu-devel] " Amit Shah
2009-08-31 14:21 ` Anthony Liguori
2009-08-31 14:21 ` Anthony Liguori
2009-08-31 14:21 ` [Qemu-devel] " Anthony Liguori
2009-08-31 14:31 ` Amit Shah
2009-08-31 14:31 ` Amit Shah
2009-08-31 14:31 ` [Qemu-devel] " Amit Shah
2009-08-31 15:56 ` Anthony Liguori
2009-08-31 15:56 ` [Qemu-devel] " Anthony Liguori
2009-08-31 16:19 ` Amit Shah
2009-08-31 16:19 ` Amit Shah
2009-08-31 16:19 ` [Qemu-devel] " Amit Shah
2009-08-31 16:37 ` Anthony Liguori
2009-08-31 16:37 ` [Qemu-devel] " Anthony Liguori
2009-09-21 5:20 ` Rusty Russell
2009-09-21 5:20 ` [Qemu-devel] " Rusty Russell
2009-09-21 5:20 ` Rusty Russell
2009-08-31 16:37 ` Anthony Liguori
2009-08-31 13:51 ` Amit Shah
2009-08-31 13:17 ` Anthony Liguori
2009-08-30 12:48 ` Anthony Liguori
2009-08-30 10:10 ` Amit Shah
-- strict thread matches above, loose matches on Subject: below --
2009-08-25 6:17 Amit Shah
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=1251346023.20467.21.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=alan@linux.intel.com \
--cc=amit.shah@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=brueckner@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=miltonm@bga.com \
--cc=qemu-devel@nongnu.org \
--cc=virtualization@lists.linux-foundation.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 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.