All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, virtio-dev@lists.oasis-open.org,
	virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
	Michal Hocko <mhocko@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	David Hildenbrand <david@redhat.com>,
	Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Subject: [PATCH v3 14/15] virtio-mem: Use -ETXTBSY as error code if the device is busy
Date: Thu,  7 May 2020 12:31:18 +0200	[thread overview]
Message-ID: <20200507103119.11219-15-david@redhat.com> (raw)
In-Reply-To: <20200507103119.11219-1-david@redhat.com>

Let's be able to distinguish if the device or if memory is busy.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 drivers/virtio/virtio_mem.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
index a719e1a04ac7..abd93b778a26 100644
--- a/drivers/virtio/virtio_mem.c
+++ b/drivers/virtio/virtio_mem.c
@@ -893,7 +893,7 @@ static int virtio_mem_send_plug_request(struct virtio_mem *vm, uint64_t addr,
 	case VIRTIO_MEM_RESP_NACK:
 		return -EAGAIN;
 	case VIRTIO_MEM_RESP_BUSY:
-		return -EBUSY;
+		return -ETXTBSY;
 	case VIRTIO_MEM_RESP_ERROR:
 		return -EINVAL;
 	default:
@@ -919,7 +919,7 @@ static int virtio_mem_send_unplug_request(struct virtio_mem *vm, uint64_t addr,
 		vm->plugged_size -= size;
 		return 0;
 	case VIRTIO_MEM_RESP_BUSY:
-		return -EBUSY;
+		return -ETXTBSY;
 	case VIRTIO_MEM_RESP_ERROR:
 		return -EINVAL;
 	default:
@@ -941,7 +941,7 @@ static int virtio_mem_send_unplug_all_request(struct virtio_mem *vm)
 		atomic_set(&vm->config_changed, 1);
 		return 0;
 	case VIRTIO_MEM_RESP_BUSY:
-		return -EBUSY;
+		return -ETXTBSY;
 	default:
 		return -ENOMEM;
 	}
@@ -1557,11 +1557,15 @@ static void virtio_mem_run_wq(struct work_struct *work)
 		 * or we have too many offline memory blocks.
 		 */
 		break;
-	case -EBUSY:
+	case -ETXTBSY:
 		/*
 		 * The hypervisor cannot process our request right now
-		 * (e.g., out of memory, migrating) or we cannot free up
-		 * any memory to unplug it (all plugged memory is busy).
+		 * (e.g., out of memory, migrating);
+		 */
+	case -EBUSY:
+		/*
+		 * We cannot free up any memory to unplug it (all plugged memory
+		 * is busy).
 		 */
 	case -ENOMEM:
 		/* Out of memory, try again later. */
-- 
2.25.3


WARNING: multiple messages have this Message-ID (diff)
From: David Hildenbrand <david@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Michal Hocko <mhocko@kernel.org>,
	linux-mm@kvack.org, Pankaj Gupta <pankaj.gupta.linux@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	virtualization@lists.linux-foundation.org
Subject: [PATCH v3 14/15] virtio-mem: Use -ETXTBSY as error code if the device is busy
Date: Thu,  7 May 2020 12:31:18 +0200	[thread overview]
Message-ID: <20200507103119.11219-15-david@redhat.com> (raw)
In-Reply-To: <20200507103119.11219-1-david@redhat.com>

Let's be able to distinguish if the device or if memory is busy.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 drivers/virtio/virtio_mem.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
index a719e1a04ac7..abd93b778a26 100644
--- a/drivers/virtio/virtio_mem.c
+++ b/drivers/virtio/virtio_mem.c
@@ -893,7 +893,7 @@ static int virtio_mem_send_plug_request(struct virtio_mem *vm, uint64_t addr,
 	case VIRTIO_MEM_RESP_NACK:
 		return -EAGAIN;
 	case VIRTIO_MEM_RESP_BUSY:
-		return -EBUSY;
+		return -ETXTBSY;
 	case VIRTIO_MEM_RESP_ERROR:
 		return -EINVAL;
 	default:
@@ -919,7 +919,7 @@ static int virtio_mem_send_unplug_request(struct virtio_mem *vm, uint64_t addr,
 		vm->plugged_size -= size;
 		return 0;
 	case VIRTIO_MEM_RESP_BUSY:
-		return -EBUSY;
+		return -ETXTBSY;
 	case VIRTIO_MEM_RESP_ERROR:
 		return -EINVAL;
 	default:
@@ -941,7 +941,7 @@ static int virtio_mem_send_unplug_all_request(struct virtio_mem *vm)
 		atomic_set(&vm->config_changed, 1);
 		return 0;
 	case VIRTIO_MEM_RESP_BUSY:
-		return -EBUSY;
+		return -ETXTBSY;
 	default:
 		return -ENOMEM;
 	}
@@ -1557,11 +1557,15 @@ static void virtio_mem_run_wq(struct work_struct *work)
 		 * or we have too many offline memory blocks.
 		 */
 		break;
-	case -EBUSY:
+	case -ETXTBSY:
 		/*
 		 * The hypervisor cannot process our request right now
-		 * (e.g., out of memory, migrating) or we cannot free up
-		 * any memory to unplug it (all plugged memory is busy).
+		 * (e.g., out of memory, migrating);
+		 */
+	case -EBUSY:
+		/*
+		 * We cannot free up any memory to unplug it (all plugged memory
+		 * is busy).
 		 */
 	case -ENOMEM:
 		/* Out of memory, try again later. */
-- 
2.25.3

WARNING: multiple messages have this Message-ID (diff)
From: David Hildenbrand <david@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, virtio-dev@lists.oasis-open.org,
	virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
	Michal Hocko <mhocko@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	David Hildenbrand <david@redhat.com>,
	Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Subject: [virtio-dev] [PATCH v3 14/15] virtio-mem: Use -ETXTBSY as error code if the device is busy
Date: Thu,  7 May 2020 12:31:18 +0200	[thread overview]
Message-ID: <20200507103119.11219-15-david@redhat.com> (raw)
In-Reply-To: <20200507103119.11219-1-david@redhat.com>

Let's be able to distinguish if the device or if memory is busy.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 drivers/virtio/virtio_mem.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
index a719e1a04ac7..abd93b778a26 100644
--- a/drivers/virtio/virtio_mem.c
+++ b/drivers/virtio/virtio_mem.c
@@ -893,7 +893,7 @@ static int virtio_mem_send_plug_request(struct virtio_mem *vm, uint64_t addr,
 	case VIRTIO_MEM_RESP_NACK:
 		return -EAGAIN;
 	case VIRTIO_MEM_RESP_BUSY:
-		return -EBUSY;
+		return -ETXTBSY;
 	case VIRTIO_MEM_RESP_ERROR:
 		return -EINVAL;
 	default:
@@ -919,7 +919,7 @@ static int virtio_mem_send_unplug_request(struct virtio_mem *vm, uint64_t addr,
 		vm->plugged_size -= size;
 		return 0;
 	case VIRTIO_MEM_RESP_BUSY:
-		return -EBUSY;
+		return -ETXTBSY;
 	case VIRTIO_MEM_RESP_ERROR:
 		return -EINVAL;
 	default:
@@ -941,7 +941,7 @@ static int virtio_mem_send_unplug_all_request(struct virtio_mem *vm)
 		atomic_set(&vm->config_changed, 1);
 		return 0;
 	case VIRTIO_MEM_RESP_BUSY:
-		return -EBUSY;
+		return -ETXTBSY;
 	default:
 		return -ENOMEM;
 	}
@@ -1557,11 +1557,15 @@ static void virtio_mem_run_wq(struct work_struct *work)
 		 * or we have too many offline memory blocks.
 		 */
 		break;
-	case -EBUSY:
+	case -ETXTBSY:
 		/*
 		 * The hypervisor cannot process our request right now
-		 * (e.g., out of memory, migrating) or we cannot free up
-		 * any memory to unplug it (all plugged memory is busy).
+		 * (e.g., out of memory, migrating);
+		 */
+	case -EBUSY:
+		/*
+		 * We cannot free up any memory to unplug it (all plugged memory
+		 * is busy).
 		 */
 	case -ENOMEM:
 		/* Out of memory, try again later. */
-- 
2.25.3


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


  parent reply	other threads:[~2020-05-07 10:33 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 10:31 [PATCH v3 00/15] virtio-mem: paravirtualized memory David Hildenbrand
2020-05-07 10:31 ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31 ` David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 01/15] virtio-mem: Paravirtualized memory hotplug David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 02/15] virtio-mem: Allow to specify an ACPI PXM as nid David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 03/15] virtio-mem: Paravirtualized memory hotunplug part 1 David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 04/15] virtio-mem: Paravirtualized memory hotunplug part 2 David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31   ` David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 05/15] mm: Allow to offline unmovable PageOffline() pages via MEM_GOING_OFFLINE David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31   ` David Hildenbrand
2020-05-07 10:48   ` Michael S. Tsirkin
2020-05-07 10:48     ` [virtio-dev] " Michael S. Tsirkin
2020-05-07 10:48     ` Michael S. Tsirkin
2020-05-07 10:31 ` [PATCH v3 06/15] virtio-mem: Allow to offline partially unplugged memory blocks David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31   ` David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 07/15] mm/memory_hotplug: Introduce offline_and_remove_memory() David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:46   ` Michael S. Tsirkin
2020-05-07 10:46     ` [virtio-dev] " Michael S. Tsirkin
2020-05-07 11:24     ` David Hildenbrand
2020-05-07 11:24       ` [virtio-dev] " David Hildenbrand
2020-05-07 11:33       ` David Hildenbrand
2020-05-07 11:33         ` [virtio-dev] " David Hildenbrand
2020-05-07 11:34         ` Michael S. Tsirkin
2020-05-07 11:34           ` [virtio-dev] " Michael S. Tsirkin
2020-05-07 11:37           ` David Hildenbrand
2020-05-07 11:37             ` [virtio-dev] " David Hildenbrand
2020-05-07 12:11             ` Michael S. Tsirkin
2020-05-07 12:11               ` [virtio-dev] " Michael S. Tsirkin
2020-05-07 12:24               ` David Hildenbrand
2020-05-07 12:24                 ` [virtio-dev] " David Hildenbrand
2020-05-07 11:33       ` Michael S. Tsirkin
2020-05-07 11:33         ` [virtio-dev] " Michael S. Tsirkin
2020-05-07 10:31 ` [PATCH v3 08/15] virtio-mem: Offline and remove completely unplugged memory blocks David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31   ` David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 09/15] virtio-mem: Better retry handling David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 10/15] MAINTAINERS: Add myself as virtio-mem maintainer David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:47   ` Michael S. Tsirkin
2020-05-07 10:47     ` [virtio-dev] " Michael S. Tsirkin
2020-05-07 11:25     ` David Hildenbrand
2020-05-07 11:25       ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 11/15] virtio-mem: Add parent resource for all added "System RAM" David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 12/15] virtio-mem: Drop manual check for already present memory David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31   ` David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 13/15] virtio-mem: Unplug subblocks right-to-left David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:31   ` David Hildenbrand
2020-05-07 10:31 ` David Hildenbrand [this message]
2020-05-07 10:31   ` [virtio-dev] [PATCH v3 14/15] virtio-mem: Use -ETXTBSY as error code if the device is busy David Hildenbrand
2020-05-07 10:31   ` David Hildenbrand
2020-05-07 10:31 ` [PATCH v3 15/15] virtio-mem: Try to unplug the complete online memory block first David Hildenbrand
2020-05-07 10:31   ` [virtio-dev] " David Hildenbrand
2020-05-07 10:48 ` [PATCH v3 00/15] virtio-mem: paravirtualized memory Michael S. Tsirkin
2020-05-07 10:48   ` [virtio-dev] " Michael S. Tsirkin
2020-05-07 10:48   ` Michael S. Tsirkin
2020-05-07 11:23   ` David Hildenbrand
2020-05-07 11:23     ` [virtio-dev] " David Hildenbrand
2020-05-07 11:23     ` David Hildenbrand
2020-05-14  6:44 ` [virtio-dev] " teawater
2020-05-14  6:44   ` teawater
2020-05-14  6:44   ` teawater
2020-05-14  8:48   ` [virtio-dev] " David Hildenbrand
2020-05-14  8:48     ` David Hildenbrand
2020-05-14  8:48     ` David Hildenbrand
2020-05-14 10:02     ` [virtio-dev] " teawater
2020-05-14 10:02       ` teawater
2020-05-14 10:02       ` teawater
2020-05-14 10:12       ` [virtio-dev] " David Hildenbrand
2020-05-14 10:12         ` David Hildenbrand
2020-05-14 10:12         ` David Hildenbrand
2020-05-14 11:10         ` [virtio-dev] " David Hildenbrand
2020-05-14 11:10           ` David Hildenbrand
2020-05-14 11:10           ` David Hildenbrand
2020-05-14 11:47           ` [virtio-dev] " David Hildenbrand
2020-05-14 11:47             ` David Hildenbrand
2020-05-14 11:47             ` David Hildenbrand
2020-05-14 12:19             ` [virtio-dev] " David Hildenbrand
2020-05-14 12:19               ` David Hildenbrand
2020-05-14 12:19               ` David Hildenbrand
2020-05-15  2:58               ` [virtio-dev] " teawater
2020-05-15  2:58                 ` teawater
2020-05-15  2:58                 ` teawater

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=20200507103119.11219-15-david@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mst@redhat.com \
    --cc=pankaj.gupta.linux@gmail.com \
    --cc=virtio-dev@lists.oasis-open.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.