virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] virtio: console: Wake up outvq on host notifications
@ 2011-01-31  7:36 Amit Shah
  2011-01-31  7:36 ` [PATCH 2/2] virtio: console: Update Copyright Amit Shah
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Amit Shah @ 2011-01-31  7:36 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Amit Shah, Hans de Goede, stable, Virtualization List

The outvq needs to be woken up on host notifications so that buffers
consumed by the host can be reclaimed, outvq freed, and application
writes may proceed again.

The need for this is now finally noticed when I have qemu patches ready
to use nonblocking IO and flow control.

CC: Hans de Goede <hdegoede@redhat.com>
CC: stable@kernel.org
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 drivers/tty/hvc/virtio_console.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/hvc/virtio_console.c b/drivers/tty/hvc/virtio_console.c
index c4b0255..1068095 100644
--- a/drivers/tty/hvc/virtio_console.c
+++ b/drivers/tty/hvc/virtio_console.c
@@ -1473,6 +1473,17 @@ static void control_work_handler(struct work_struct *work)
 	spin_unlock(&portdev->cvq_lock);
 }
 
+static void out_intr(struct virtqueue *vq)
+{
+	struct port *port;
+
+	port = find_port_by_vq(vq->vdev->priv, vq);
+	if (!port)
+		return;
+
+	wake_up_interruptible(&port->waitqueue);
+}
+
 static void in_intr(struct virtqueue *vq)
 {
 	struct port *port;
@@ -1577,7 +1588,7 @@ static int init_vqs(struct ports_device *portdev)
 	 */
 	j = 0;
 	io_callbacks[j] = in_intr;
-	io_callbacks[j + 1] = NULL;
+	io_callbacks[j + 1] = out_intr;
 	io_names[j] = "input";
 	io_names[j + 1] = "output";
 	j += 2;
@@ -1591,7 +1602,7 @@ static int init_vqs(struct ports_device *portdev)
 		for (i = 1; i < nr_ports; i++) {
 			j += 2;
 			io_callbacks[j] = in_intr;
-			io_callbacks[j + 1] = NULL;
+			io_callbacks[j + 1] = out_intr;
 			io_names[j] = "input";
 			io_names[j + 1] = "output";
 		}
-- 
1.7.3.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] virtio: console: Update Copyright
  2011-01-31  7:36 [PATCH 1/2] virtio: console: Wake up outvq on host notifications Amit Shah
@ 2011-01-31  7:36 ` Amit Shah
  2011-01-31  8:53 ` [PATCH 1/2] virtio: console: Wake up outvq on host notifications Hans de Goede
  2011-01-31 10:03 ` Rusty Russell
  2 siblings, 0 replies; 6+ messages in thread
From: Amit Shah @ 2011-01-31  7:36 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Amit Shah, Virtualization List

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 drivers/tty/hvc/virtio_console.c |    3 ++-
 include/linux/virtio_console.h   |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/hvc/virtio_console.c b/drivers/tty/hvc/virtio_console.c
index 1068095..f03338f 100644
--- a/drivers/tty/hvc/virtio_console.c
+++ b/drivers/tty/hvc/virtio_console.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2006, 2007, 2009 Rusty Russell, IBM Corporation
- * Copyright (C) 2009, 2010 Red Hat, Inc.
+ * Copyright (C) 2009, 2010, 2011 Red Hat, Inc.
+ * Copyright (C) 2009, 2010, 2011 Amit Shah <amit.shah@redhat.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index a85064d..e4d3335 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -7,7 +7,8 @@
  * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
  * anyone can use the definitions to implement compatible drivers/servers.
  *
- * Copyright (C) Red Hat, Inc., 2009, 2010
+ * Copyright (C) Red Hat, Inc., 2009, 2010, 2011
+ * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011
  */
 
 /* Feature bits */
-- 
1.7.3.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] virtio: console: Wake up outvq on host notifications
  2011-01-31  7:36 [PATCH 1/2] virtio: console: Wake up outvq on host notifications Amit Shah
  2011-01-31  7:36 ` [PATCH 2/2] virtio: console: Update Copyright Amit Shah
@ 2011-01-31  8:53 ` Hans de Goede
  2011-01-31 10:03 ` Rusty Russell
  2 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2011-01-31  8:53 UTC (permalink / raw)
  To: Amit Shah; +Cc: stable, Virtualization List

Acked-by: Hans de Goede <hdegoede@redhat.com>

On 01/31/2011 08:36 AM, Amit Shah wrote:
> The outvq needs to be woken up on host notifications so that buffers
> consumed by the host can be reclaimed, outvq freed, and application
> writes may proceed again.
>
> The need for this is now finally noticed when I have qemu patches ready
> to use nonblocking IO and flow control.
>
> CC: Hans de Goede<hdegoede@redhat.com>
> CC: stable@kernel.org
> Signed-off-by: Amit Shah<amit.shah@redhat.com>
> ---
>   drivers/tty/hvc/virtio_console.c |   15 +++++++++++++--
>   1 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/hvc/virtio_console.c b/drivers/tty/hvc/virtio_console.c
> index c4b0255..1068095 100644
> --- a/drivers/tty/hvc/virtio_console.c
> +++ b/drivers/tty/hvc/virtio_console.c
> @@ -1473,6 +1473,17 @@ static void control_work_handler(struct work_struct *work)
>   	spin_unlock(&portdev->cvq_lock);
>   }
>
> +static void out_intr(struct virtqueue *vq)
> +{
> +	struct port *port;
> +
> +	port = find_port_by_vq(vq->vdev->priv, vq);
> +	if (!port)
> +		return;
> +
> +	wake_up_interruptible(&port->waitqueue);
> +}
> +
>   static void in_intr(struct virtqueue *vq)
>   {
>   	struct port *port;
> @@ -1577,7 +1588,7 @@ static int init_vqs(struct ports_device *portdev)
>   	 */
>   	j = 0;
>   	io_callbacks[j] = in_intr;
> -	io_callbacks[j + 1] = NULL;
> +	io_callbacks[j + 1] = out_intr;
>   	io_names[j] = "input";
>   	io_names[j + 1] = "output";
>   	j += 2;
> @@ -1591,7 +1602,7 @@ static int init_vqs(struct ports_device *portdev)
>   		for (i = 1; i<  nr_ports; i++) {
>   			j += 2;
>   			io_callbacks[j] = in_intr;
> -			io_callbacks[j + 1] = NULL;
> +			io_callbacks[j + 1] = out_intr;
>   			io_names[j] = "input";
>   			io_names[j + 1] = "output";
>   		}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] virtio: console: Wake up outvq on host notifications
  2011-01-31  7:36 [PATCH 1/2] virtio: console: Wake up outvq on host notifications Amit Shah
  2011-01-31  7:36 ` [PATCH 2/2] virtio: console: Update Copyright Amit Shah
  2011-01-31  8:53 ` [PATCH 1/2] virtio: console: Wake up outvq on host notifications Hans de Goede
@ 2011-01-31 10:03 ` Rusty Russell
  2011-01-31 10:28   ` Amit Shah
  2011-01-31 10:29   ` Rusty Russell
  2 siblings, 2 replies; 6+ messages in thread
From: Rusty Russell @ 2011-01-31 10:03 UTC (permalink / raw)
  To: Amit Shah; +Cc: Hans de Goede, stable, Virtualization List

On Mon, 31 Jan 2011 06:06:36 pm Amit Shah wrote:
> The outvq needs to be woken up on host notifications so that buffers
> consumed by the host can be reclaimed, outvq freed, and application
> writes may proceed again.
> 
> The need for this is now finally noticed when I have qemu patches ready
> to use nonblocking IO and flow control.

What about -stable?

Thanks,
Rusty.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] virtio: console: Wake up outvq on host notifications
  2011-01-31 10:03 ` Rusty Russell
@ 2011-01-31 10:28   ` Amit Shah
  2011-01-31 10:29   ` Rusty Russell
  1 sibling, 0 replies; 6+ messages in thread
From: Amit Shah @ 2011-01-31 10:28 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Hans de Goede, stable, Virtualization List

On (Mon) Jan 31 2011 [20:33:15], Rusty Russell wrote:
> On Mon, 31 Jan 2011 06:06:36 pm Amit Shah wrote:
> > The outvq needs to be woken up on host notifications so that buffers
> > consumed by the host can be reclaimed, outvq freed, and application
> > writes may proceed again.
> > 
> > The need for this is now finally noticed when I have qemu patches ready
> > to use nonblocking IO and flow control.
> 
> What about -stable?

Yes, it's needed (I added the CC: stable@kernel.org tag -- that should
be enough, right?)

Thanks,
		Amit

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] virtio: console: Wake up outvq on host notifications
  2011-01-31 10:03 ` Rusty Russell
  2011-01-31 10:28   ` Amit Shah
@ 2011-01-31 10:29   ` Rusty Russell
  1 sibling, 0 replies; 6+ messages in thread
From: Rusty Russell @ 2011-01-31 10:29 UTC (permalink / raw)
  To: Amit Shah; +Cc: Hans de Goede, Virtualization List

On Mon, 31 Jan 2011 08:33:15 pm Rusty Russell wrote:
> On Mon, 31 Jan 2011 06:06:36 pm Amit Shah wrote:
> > The outvq needs to be woken up on host notifications so that buffers
> > consumed by the host can be reclaimed, outvq freed, and application
> > writes may proceed again.
> > 
> > The need for this is now finally noticed when I have qemu patches ready
> > to use nonblocking IO and flow control.
> 
> What about -stable?

Sorry, I missed the CC...

Thanks,
Rusty.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-31 10:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31  7:36 [PATCH 1/2] virtio: console: Wake up outvq on host notifications Amit Shah
2011-01-31  7:36 ` [PATCH 2/2] virtio: console: Update Copyright Amit Shah
2011-01-31  8:53 ` [PATCH 1/2] virtio: console: Wake up outvq on host notifications Hans de Goede
2011-01-31 10:03 ` Rusty Russell
2011-01-31 10:28   ` Amit Shah
2011-01-31 10:29   ` Rusty Russell

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).