* [net-next V7 PATCH] virtio-net: send gratuitous packets when needed
From: Jason Wang @ 2012-04-12 6:43 UTC (permalink / raw)
To: netdev, rusty, virtualization, linux-kernel, mst
As hypervior does not have the knowledge of guest network configuration, it's
better to ask guest to send gratuitous packets when needed.
This patch implements VIRTIO_NET_F_GUEST_ANNOUNCE feature: hypervisor would
notice the guest when it thinks it's time for guest to announce the link
presnece. Guest tests VIRTIO_NET_S_ANNOUNCE bit during config change interrupt
and woule send gratuitous packets through netif_notify_peers() and ack the
notification through ctrl vq.
We need to make sure the atomicy of read and ack in guest otherwise we may ack
more times than being notified. This is done through handling the whole config
change interrupt in an non-reentrant workqueue.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
Changes from v6:
- move the whole event processing to system_nrt_wq
- introduce the config_enable and config_lock to synchronize with dev removing
and pm
- protect the ack with rtnl_lock
Changes from v5:
- notify the chain before acking the link annoucement
- ack the link announcement notification through control vq
Changes from v4:
- typos
- handle workqueue unconditionally
- move VIRTIO_NET_S_ANNOUNCE to bit 8 to separate rw bits from ro bits
Changes from v3:
- cancel the workqueue during freeze
Changes from v2:
- fix the race between unregister_dev() and workqueue
---
drivers/net/virtio_net.c | 64 +++++++++++++++++++++++++++++++++++++++++---
include/linux/virtio_net.h | 14 ++++++++++
2 files changed, 73 insertions(+), 5 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 4de2760..23403b6 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -66,12 +66,21 @@ struct virtnet_info {
/* Host will merge rx buffers for big packets (shake it! shake it!) */
bool mergeable_rx_bufs;
+ /* enable config space updates */
+ bool config_enable;
+
/* Active statistics */
struct virtnet_stats __percpu *stats;
/* Work struct for refilling if we run low on memory. */
struct delayed_work refill;
+ /* Work struct for config space updates */
+ struct work_struct config_work;
+
+ /* Lock for config space updates */
+ struct mutex config_lock;
+
/* Chain pages by the private ptr. */
struct page *pages;
@@ -781,6 +790,16 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
return status == VIRTIO_NET_OK;
}
+static void virtnet_ack_link_announce(struct virtnet_info *vi)
+{
+ rtnl_lock();
+ if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_ANNOUNCE,
+ VIRTIO_NET_CTRL_ANNOUNCE_ACK, NULL,
+ 0, 0))
+ dev_warn(&vi->dev->dev, "Failed to ack link announce.\n");
+ rtnl_unlock();
+}
+
static int virtnet_close(struct net_device *dev)
{
struct virtnet_info *vi = netdev_priv(dev);
@@ -952,20 +971,31 @@ static const struct net_device_ops virtnet_netdev = {
#endif
};
-static void virtnet_update_status(struct virtnet_info *vi)
+static void virtnet_config_changed_work(struct work_struct *work)
{
+ struct virtnet_info *vi =
+ container_of(work, struct virtnet_info, config_work);
u16 v;
+ mutex_lock(&vi->config_lock);
+ if (!vi->config_enable)
+ goto done;
+
if (virtio_config_val(vi->vdev, VIRTIO_NET_F_STATUS,
offsetof(struct virtio_net_config, status),
&v) < 0)
- return;
+ goto done;
+
+ if (v & VIRTIO_NET_S_ANNOUNCE) {
+ netif_notify_peers(vi->dev);
+ virtnet_ack_link_announce(vi);
+ }
/* Ignore unknown (future) status bits */
v &= VIRTIO_NET_S_LINK_UP;
if (vi->status == v)
- return;
+ goto done;
vi->status = v;
@@ -976,13 +1006,15 @@ static void virtnet_update_status(struct virtnet_info *vi)
netif_carrier_off(vi->dev);
netif_stop_queue(vi->dev);
}
+done:
+ mutex_unlock(&vi->config_lock);
}
static void virtnet_config_changed(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
- virtnet_update_status(vi);
+ queue_work(system_nrt_wq, &vi->config_work);
}
static int init_vqs(struct virtnet_info *vi)
@@ -1076,6 +1108,9 @@ static int virtnet_probe(struct virtio_device *vdev)
goto free;
INIT_DELAYED_WORK(&vi->refill, refill_work);
+ mutex_init(&vi->config_lock);
+ vi->config_enable = true;
+ INIT_WORK(&vi->config_work, virtnet_config_changed_work);
sg_init_table(vi->rx_sg, ARRAY_SIZE(vi->rx_sg));
sg_init_table(vi->tx_sg, ARRAY_SIZE(vi->tx_sg));
@@ -1111,7 +1146,7 @@ static int virtnet_probe(struct virtio_device *vdev)
otherwise get link status from config. */
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
netif_carrier_off(dev);
- virtnet_update_status(vi);
+ queue_work(system_nrt_wq, &vi->config_work);
} else {
vi->status = VIRTIO_NET_S_LINK_UP;
netif_carrier_on(dev);
@@ -1170,10 +1205,17 @@ static void __devexit virtnet_remove(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
+ /* Prevent config work handler from accessing the device. */
+ mutex_lock(&vi->config_lock);
+ vi->config_enable = false;
+ mutex_unlock(&vi->config_lock);
+
unregister_netdev(vi->dev);
remove_vq_common(vi);
+ flush_work(&vi->config_work);
+
free_percpu(vi->stats);
free_netdev(vi->dev);
}
@@ -1183,6 +1225,11 @@ static int virtnet_freeze(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
+ /* Prevent config work handler from accessing the device */
+ mutex_lock(&vi->config_lock);
+ vi->config_enable = false;
+ mutex_unlock(&vi->config_lock);
+
virtqueue_disable_cb(vi->rvq);
virtqueue_disable_cb(vi->svq);
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ))
@@ -1196,6 +1243,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
remove_vq_common(vi);
+ flush_work(&vi->config_work);
+
return 0;
}
@@ -1216,6 +1265,10 @@ static int virtnet_restore(struct virtio_device *vdev)
if (!try_fill_recv(vi, GFP_KERNEL))
queue_delayed_work(system_nrt_wq, &vi->refill, 0);
+ mutex_lock(&vi->config_lock);
+ vi->config_enable = true;
+ mutex_unlock(&vi->config_lock);
+
return 0;
}
#endif
@@ -1233,6 +1286,7 @@ static unsigned int features[] = {
VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO,
VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ,
VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN,
+ VIRTIO_NET_F_GUEST_ANNOUNCE,
};
static struct virtio_driver virtio_net_driver = {
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 970d5a2..2470f54 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -49,8 +49,11 @@
#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
+#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the
+ * network */
#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
+#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
struct virtio_net_config {
/* The config defining mac address (if VIRTIO_NET_F_MAC) */
@@ -152,4 +155,15 @@ struct virtio_net_ctrl_mac {
#define VIRTIO_NET_CTRL_VLAN_ADD 0
#define VIRTIO_NET_CTRL_VLAN_DEL 1
+/*
+ * Control link announce acknowledgement
+ *
+ * The command VIRTIO_NET_CTRL_ANNOUNCE_ACK is used to indicate that
+ * driver has recevied the notification; device would clear the
+ * VIRTIO_NET_S_ANNOUNCE bit in the status field after it receives
+ * this command.
+ */
+#define VIRTIO_NET_CTRL_ANNOUNCE 3
+ #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0
+
#endif /* _LINUX_VIRTIO_NET_H */
^ permalink raw reply related
* [PATCH 3/3] virtio_balloon: Bugfixes for PAGE_SIZE != 4k
From: David Gibson @ 2012-04-12 5:36 UTC (permalink / raw)
To: rusty, mst; +Cc: qemu-devel, David Gibson, paulus, linux-kernel, virtualization
In-Reply-To: <1334208995-29985-1-git-send-email-david@gibson.dropbear.id.au>
The virtio_balloon device is specced to always operate on 4k pages. The
virtio_balloon driver has a feeble attempt at reconciling this with a
lerge kernel page size, but it is (a) exactly wrong (it shifts the pfn in
the wrong direction) and (b) insufficient (it doesn't issue multiple 4k
balloon requests for each guest page, or correct other accounting values
for the different in page size).
This patch fixes the various problems. It has been tested with a powerpc
guest kernel configured for 64kB base page size, running under qemu.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
drivers/virtio/virtio_balloon.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 553cc1f..834b7f9 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -60,13 +60,20 @@ static struct virtio_device_id id_table[] = {
{ 0 },
};
-static u32 page_to_balloon_pfn(struct page *page)
+#define BALLOON_PAGE_ORDER (PAGE_SHIFT - VIRTIO_BALLOON_PFN_SHIFT)
+#define PAGES_PER_ARRAY(_a) (ARRAY_SIZE(_a) >> BALLOON_PAGE_ORDER)
+
+static void page_to_balloon_pfns(u32 pfns[], unsigned int n, struct page *page)
{
- unsigned long pfn = page_to_pfn(page);
+ unsigned long bpfn = page_to_pfn(page) << BALLOON_PAGE_ORDER;
+ u32 *p = &pfns[n << BALLOON_PAGE_ORDER];
+ int i;
BUILD_BUG_ON(PAGE_SHIFT < VIRTIO_BALLOON_PFN_SHIFT);
- /* Convert pfn from Linux page size to balloon page size. */
- return pfn >> (PAGE_SHIFT - VIRTIO_BALLOON_PFN_SHIFT);
+
+ /* Enter a balloon pfn for each 4k subpage of the Linux page */
+ for (i = 0; i < (1 << BALLOON_PAGE_ORDER); i++)
+ p[i] = bpfn + i;
}
static void balloon_ack(struct virtqueue *vq)
@@ -84,7 +91,8 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq,
{
struct scatterlist sg;
- sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * n);
+ sg_init_one(&sg, vb->pfns,
+ sizeof(vb->pfns[0]) * (n << BALLOON_PAGE_ORDER));
init_completion(&vb->acked);
@@ -102,7 +110,7 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
unsigned int n;
/* We can only do one array worth at a time. */
- num = min(num, ARRAY_SIZE(vb->pfns));
+ num = min(num, PAGES_PER_ARRAY(vb->pfns));
for (n = 0; n < num; n++) {
struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY |
@@ -116,7 +124,7 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
msleep(200);
break;
}
- vb->pfns[n] = page_to_balloon_pfn(page);
+ page_to_balloon_pfns(vb->pfns, n, page);
totalram_pages--;
vb->num_pages++;
list_add(&page->lru, &vb->pages);
@@ -134,7 +142,7 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
unsigned int i;
for (i = 0; i < num; i++) {
- __free_page(pfn_to_page(pfns[i]));
+ __free_page(pfn_to_page(pfns[i << BALLOON_PAGE_ORDER]));
totalram_pages++;
}
}
@@ -145,12 +153,12 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
unsigned int n;
/* We can only do one array worth at a time. */
- num = min(num, ARRAY_SIZE(vb->pfns));
+ num = min(num, PAGES_PER_ARRAY(vb->pfns));
for (n = 0; n < num; n++) {
page = list_first_entry(&vb->pages, struct page, lru);
list_del(&page->lru);
- vb->pfns[n] = page_to_balloon_pfn(page);
+ page_to_balloon_pfns(vb->pfns, n, page);
vb->num_pages--;
}
@@ -244,13 +252,13 @@ static inline s64 towards_target(struct virtio_balloon *vb)
vb->vdev->config->get(vb->vdev,
offsetof(struct virtio_balloon_config, num_pages),
&v, sizeof(v));
- target = le32_to_cpu(v);
+ target = le32_to_cpu(v) >> BALLOON_PAGE_ORDER;
return target - vb->num_pages;
}
static void update_balloon_size(struct virtio_balloon *vb)
{
- __le32 actual = cpu_to_le32(vb->num_pages);
+ __le32 actual = cpu_to_le32(vb->num_pages << BALLOON_PAGE_ORDER);
vb->vdev->config->set(vb->vdev,
offsetof(struct virtio_balloon_config, actual),
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/3] virtio_balloon: Fix endian bug
From: David Gibson @ 2012-04-12 5:36 UTC (permalink / raw)
To: rusty, mst; +Cc: qemu-devel, David Gibson, paulus, linux-kernel, virtualization
In-Reply-To: <1334208995-29985-1-git-send-email-david@gibson.dropbear.id.au>
Although virtio config space fields are usually in guest-native endian,
the spec for the virtio balloon device explicitly states that both fields
in its config space are little-endian.
However, the current virtio_balloon driver does not have a suitable endian
swap for the 'num_pages' field, although it does have one for the 'actual'
field. This patch corrects the bug, adding sparse annotation while we're
at it.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
drivers/virtio/virtio_balloon.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 6c07793..553cc1f 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -238,11 +238,14 @@ static void virtballoon_changed(struct virtio_device *vdev)
static inline s64 towards_target(struct virtio_balloon *vb)
{
- u32 v;
+ __le32 v;
+ s64 target;
+
vb->vdev->config->get(vb->vdev,
offsetof(struct virtio_balloon_config, num_pages),
&v, sizeof(v));
- return (s64)v - vb->num_pages;
+ target = le32_to_cpu(v);
+ return target - vb->num_pages;
}
static void update_balloon_size(struct virtio_balloon *vb)
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/3] virtio_balloon: Remove unnecessarily persistent state
From: David Gibson @ 2012-04-12 5:36 UTC (permalink / raw)
To: rusty, mst; +Cc: qemu-devel, David Gibson, paulus, linux-kernel, virtualization
In-Reply-To: <1334208995-29985-1-git-send-email-david@gibson.dropbear.id.au>
The main virtio_balloon state structure contains the fields num_pfns and
array 'pfns'. Although they are stored here persistently, the lifetime of
useful data in there is never more than one function - they're essentially
used as though they were local variables.
For the pfns buffer, used to communicate a batch of pfns this is useful to
avoid either transient kmalloc()s or putting too much data on the stack.
For num_pfns, there is no reason it should not be a local, though.
This patch cleans things up by making num_pfns a local in the functions it
is used in. The pfns array remains, but the comment is updated to clarify
that it contains no truly persistent data.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
drivers/virtio/virtio_balloon.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 05f0a80..6c07793 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -46,8 +46,8 @@ struct virtio_balloon
unsigned int num_pages;
struct list_head pages;
- /* The array of pfns we tell the Host about. */
- unsigned int num_pfns;
+ /* Temporary buffer of pfns to pass to the host */
+ /* Store this here to avoid a too-large local array */
u32 pfns[256];
/* Memory statistics */
@@ -79,11 +79,12 @@ static void balloon_ack(struct virtqueue *vq)
complete(&vb->acked);
}
-static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
+static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq,
+ unsigned int n)
{
struct scatterlist sg;
- sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns);
+ sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * n);
init_completion(&vb->acked);
@@ -98,10 +99,12 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
static void fill_balloon(struct virtio_balloon *vb, size_t num)
{
+ unsigned int n;
+
/* We can only do one array worth at a time. */
num = min(num, ARRAY_SIZE(vb->pfns));
- for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
+ for (n = 0; n < num; n++) {
struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY |
__GFP_NOMEMALLOC | __GFP_NOWARN);
if (!page) {
@@ -113,17 +116,17 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
msleep(200);
break;
}
- vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
+ vb->pfns[n] = page_to_balloon_pfn(page);
totalram_pages--;
vb->num_pages++;
list_add(&page->lru, &vb->pages);
}
/* Didn't get any? Oh well. */
- if (vb->num_pfns == 0)
+ if (n == 0)
return;
- tell_host(vb, vb->inflate_vq);
+ tell_host(vb, vb->inflate_vq, n);
}
static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
@@ -139,14 +142,15 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
static void leak_balloon(struct virtio_balloon *vb, size_t num)
{
struct page *page;
+ unsigned int n;
/* We can only do one array worth at a time. */
num = min(num, ARRAY_SIZE(vb->pfns));
- for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
+ for (n = 0; n < num; n++) {
page = list_first_entry(&vb->pages, struct page, lru);
list_del(&page->lru);
- vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
+ vb->pfns[n] = page_to_balloon_pfn(page);
vb->num_pages--;
}
@@ -155,8 +159,8 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
* virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST);
* is true, we *have* to do it in this order
*/
- tell_host(vb, vb->deflate_vq);
- release_pages_by_pfn(vb->pfns, vb->num_pfns);
+ tell_host(vb, vb->deflate_vq, n);
+ release_pages_by_pfn(vb->pfns, n);
}
static inline void update_stat(struct virtio_balloon *vb, int idx,
--
1.7.9.5
^ permalink raw reply related
* [PATCH 0/3] Bugfixes for virtio balloon driver
From: David Gibson @ 2012-04-12 5:36 UTC (permalink / raw)
To: rusty, mst; +Cc: qemu-devel, paulus, linux-kernel, virtualization
This series contains one cleanup and two bug fixes for the virtio
balloon driver.
^ permalink raw reply
* Re: [PATCH RFC V5 2/6] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks
From: Marcelo Tosatti @ 2012-04-12 0:29 UTC (permalink / raw)
To: Raghavendra K T
Cc: Jeremy Fitzhardinge, Greg Kroah-Hartman, KVM,
Konrad Rzeszutek Wilk, X86, linux-doc, LKML, Ingo Molnar,
Srivatsa Vaddagiri, Avi Kivity, H. Peter Anvin, Virtualization,
Xen, Stefano Stabellini, Sasha Levin
In-Reply-To: <20120412000629.GA32051@amt.cnet>
On Wed, Apr 11, 2012 at 09:06:29PM -0300, Marcelo Tosatti wrote:
> On Fri, Mar 23, 2012 at 01:37:04PM +0530, Raghavendra K T wrote:
> > From: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
> >
> > KVM_HC_KICK_CPU allows the calling vcpu to kick another vcpu out of halt state.
> >
> > The presence of these hypercalls is indicated to guest via
> > KVM_FEATURE_PV_UNHALT/KVM_CAP_PV_UNHALT.
> >
> > Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
> > Signed-off-by: Suzuki Poulose <suzuki@in.ibm.com>
> > Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
> > ---
> > diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
> > index 734c376..9234f13 100644
> > --- a/arch/x86/include/asm/kvm_para.h
> > +++ b/arch/x86/include/asm/kvm_para.h
> > @@ -16,12 +16,14 @@
> > #define KVM_FEATURE_CLOCKSOURCE 0
> > #define KVM_FEATURE_NOP_IO_DELAY 1
> > #define KVM_FEATURE_MMU_OP 2
> > +
> > /* This indicates that the new set of kvmclock msrs
> > * are available. The use of 0x11 and 0x12 is deprecated
> > */
> > #define KVM_FEATURE_CLOCKSOURCE2 3
> > #define KVM_FEATURE_ASYNC_PF 4
> > #define KVM_FEATURE_STEAL_TIME 5
> > +#define KVM_FEATURE_PV_UNHALT 6
> >
> > /* The last 8 bits are used to indicate how to interpret the flags field
> > * in pvclock structure. If no bits are set, all flags are ignored.
> > @@ -32,6 +34,7 @@
> > #define MSR_KVM_SYSTEM_TIME 0x12
> >
> > #define KVM_MSR_ENABLED 1
> > +
> > /* Custom MSRs falls in the range 0x4b564d00-0x4b564dff */
> > #define MSR_KVM_WALL_CLOCK_NEW 0x4b564d00
> > #define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01
> > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> > index 89b02bf..61388b9 100644
> > --- a/arch/x86/kvm/cpuid.c
> > +++ b/arch/x86/kvm/cpuid.c
> > @@ -408,7 +408,8 @@ static int do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> > (1 << KVM_FEATURE_NOP_IO_DELAY) |
> > (1 << KVM_FEATURE_CLOCKSOURCE2) |
> > (1 << KVM_FEATURE_ASYNC_PF) |
> > - (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT);
> > + (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT) |
> > + (1 << KVM_FEATURE_PV_UNHALT);
> >
> > if (sched_info_on())
> > entry->eax |= (1 << KVM_FEATURE_STEAL_TIME);
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index 9cbfc06..bd5ef91 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -2079,6 +2079,7 @@ int kvm_dev_ioctl_check_extension(long ext)
> > case KVM_CAP_XSAVE:
> > case KVM_CAP_ASYNC_PF:
> > case KVM_CAP_GET_TSC_KHZ:
> > + case KVM_CAP_PV_UNHALT:
> > r = 1;
> > break;
> > case KVM_CAP_COALESCED_MMIO:
> > @@ -4913,6 +4914,30 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
> > return 1;
> > }
> >
> > +/*
> > + * kvm_pv_kick_cpu_op: Kick a vcpu.
> > + *
> > + * @apicid - apicid of vcpu to be kicked.
> > + */
> > +static void kvm_pv_kick_cpu_op(struct kvm *kvm, int apicid)
> > +{
> > + struct kvm_vcpu *vcpu = NULL;
> > + int i;
> > +
> > + kvm_for_each_vcpu(i, vcpu, kvm) {
> > + if (!kvm_apic_present(vcpu))
> > + continue;
> > +
> > + if (kvm_apic_match_dest(vcpu, 0, 0, apicid, 0))
> > + break;
> > + }
> > + if (vcpu) {
> > + vcpu->pv_unhalted = 1;
> > + smp_mb();
> > + kvm_vcpu_kick(vcpu);
> > + }
> > +}
> > +
> > int kvm_emulate_hypercall(struct kvm_vcpu *vcpu)
> > {
> > unsigned long nr, a0, a1, a2, a3, ret;
> > @@ -4946,6 +4971,10 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu)
> > case KVM_HC_VAPIC_POLL_IRQ:
> > ret = 0;
> > break;
> > + case KVM_HC_KICK_CPU:
> > + kvm_pv_kick_cpu_op(vcpu->kvm, a0);
> > + ret = 0;
> > + break;
> > default:
> > ret = -KVM_ENOSYS;
> > break;
> > @@ -6174,6 +6203,7 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
> > !vcpu->arch.apf.halted)
> > || !list_empty_careful(&vcpu->async_pf.done)
> > || vcpu->arch.mp_state == KVM_MP_STATE_SIPI_RECEIVED
> > + || vcpu->pv_unhalted
> > || atomic_read(&vcpu->arch.nmi_queued) ||
> > (kvm_arch_interrupt_allowed(vcpu) &&
> > kvm_cpu_has_interrupt(vcpu));
> > diff --git a/include/linux/kvm.h b/include/linux/kvm.h
> > index 68e67e5..e822d96 100644
> > --- a/include/linux/kvm.h
> > +++ b/include/linux/kvm.h
> > @@ -558,6 +558,7 @@ struct kvm_ppc_pvinfo {
> > #define KVM_CAP_PPC_PAPR 68
> > #define KVM_CAP_S390_GMAP 71
> > #define KVM_CAP_TSC_DEADLINE_TIMER 72
> > +#define KVM_CAP_PV_UNHALT 73
> >
> > #ifdef KVM_CAP_IRQ_ROUTING
> >
> > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> > index 900c763..433ae97 100644
> > --- a/include/linux/kvm_host.h
> > +++ b/include/linux/kvm_host.h
> > @@ -158,6 +158,7 @@ struct kvm_vcpu {
> > #endif
> >
> > struct kvm_vcpu_arch arch;
> > + int pv_unhalted;
> > };
> >
> > static inline int kvm_vcpu_exiting_guest_mode(struct kvm_vcpu *vcpu)
> > diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
> > index ff476dd..38226e1 100644
> > --- a/include/linux/kvm_para.h
> > +++ b/include/linux/kvm_para.h
> > @@ -19,6 +19,7 @@
> > #define KVM_HC_MMU_OP 2
> > #define KVM_HC_FEATURES 3
> > #define KVM_HC_PPC_MAP_MAGIC_PAGE 4
> > +#define KVM_HC_KICK_CPU 5
> >
> > /*
> > * hypercalls use architecture specific
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index a91f980..d3b98b1 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -226,6 +226,7 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
> > vcpu->kvm = kvm;
> > vcpu->vcpu_id = id;
> > vcpu->pid = NULL;
> > + vcpu->pv_unhalted = 0;
> > init_waitqueue_head(&vcpu->wq);
> > kvm_async_pf_vcpu_init(vcpu);
> >
> > @@ -1567,6 +1568,9 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
> > prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE);
> >
> > if (kvm_arch_vcpu_runnable(vcpu)) {
> > + vcpu->pv_unhalted = 0;
> > + /* preventing reordering should be enough here */
> > + barrier();
>
> Is it always OK to erase the notification, even in case an unrelated
> event such as interrupt was the source of wakeup?
Note i am only asking whether it is OK to lose a notification, not
requesting a change to atomic test-and-clear.
It would be nice to have a comment explaining it.
>
> It would be easier to verify that notifications are not lost with atomic
> test_and_clear(pv_unhalted).
>
> Also x86 specific code should remain in arch/x86/kvm/
>
^ permalink raw reply
* Re: [PATCH RFC V5 0/6] kvm : Paravirt-spinlock support for KVM guests
From: Marcelo Tosatti @ 2012-04-12 0:26 UTC (permalink / raw)
To: Raghavendra K T
Cc: Jeremy Fitzhardinge, Greg Kroah-Hartman, KVM,
Konrad Rzeszutek Wilk, X86, linux-doc, LKML, Ingo Molnar,
Srivatsa Vaddagiri, Avi Kivity, H. Peter Anvin, Virtualization,
Xen, Stefano Stabellini, Sasha Levin
In-Reply-To: <4F73593D.5020305@linux.vnet.ibm.com>
On Thu, Mar 29, 2012 at 12:02:29AM +0530, Raghavendra K T wrote:
> On 03/23/2012 01:35 PM, Raghavendra K T wrote:
> >The 6-patch series to follow this email extends KVM-hypervisor and Linux guest
> >running on KVM-hypervisor to support pv-ticket spinlocks, based on Xen's
> >implementation.
> >
> >One hypercall is introduced in KVM hypervisor,that allows a vcpu to kick
> >another vcpu out of halt state.
> >The blocking of vcpu is done using halt() in (lock_spinning) slowpath.
> >one MSR is added to aid live migration.
> >
> >Changes in V5:
> >- rebased to 3.3-rc6
> >- added PV_UNHALT_MSR that would help in live migration (Avi)
> >- removed PV_LOCK_KICK vcpu request and pv_unhalt flag (re)added.
>
> Sorry for pinging
> I know it is busy time. But I hope to get response on these patches
> in your free time, so that I can target next merge window for this.
> (whether it has reached some good state or it is heading in reverse
> direction!). it would really boost my morale.
> especially MSR stuff and dropping vcpu request bit for PV unhalt.
>
> - Raghu
Looks good. Only the MSR appears an abuse, since there is no need
to expose the info to the guest.
^ permalink raw reply
* Re: [PATCH RFC V5 3/6] kvm : Add unhalt msr to aid (live) migration
From: Marcelo Tosatti @ 2012-04-12 0:15 UTC (permalink / raw)
To: Raghavendra K T
Cc: Jeremy Fitzhardinge, Greg Kroah-Hartman, KVM,
Konrad Rzeszutek Wilk, X86, linux-doc, LKML, Ingo Molnar,
Srivatsa Vaddagiri, Avi Kivity, H. Peter Anvin, Virtualization,
Xen, Stefano Stabellini, Sasha Levin
In-Reply-To: <20120323080723.14568.23068.sendpatchset@codeblue>
On Fri, Mar 23, 2012 at 01:37:26PM +0530, Raghavendra K T wrote:
> From: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
>
> Currently guest does not need to know pv_unhalt state and intended to be
> used via GET/SET_MSR ioctls during migration.
>
> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
> ---
> diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
> index 9234f13..46f9751 100644
> --- a/arch/x86/include/asm/kvm_para.h
> +++ b/arch/x86/include/asm/kvm_para.h
> @@ -40,6 +40,7 @@
> #define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01
> #define MSR_KVM_ASYNC_PF_EN 0x4b564d02
> #define MSR_KVM_STEAL_TIME 0x4b564d03
> +#define MSR_KVM_PV_UNHALT 0x4b564d04
>
> struct kvm_steal_time {
> __u64 steal;
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index bd5ef91..38e6c47 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -784,12 +784,13 @@ EXPORT_SYMBOL_GPL(kvm_rdpmc);
> * kvm-specific. Those are put in the beginning of the list.
> */
>
> -#define KVM_SAVE_MSRS_BEGIN 9
> +#define KVM_SAVE_MSRS_BEGIN 10
> static u32 msrs_to_save[] = {
> MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK,
> MSR_KVM_SYSTEM_TIME_NEW, MSR_KVM_WALL_CLOCK_NEW,
> HV_X64_MSR_GUEST_OS_ID, HV_X64_MSR_HYPERCALL,
> HV_X64_MSR_APIC_ASSIST_PAGE, MSR_KVM_ASYNC_PF_EN, MSR_KVM_STEAL_TIME,
> + MSR_KVM_PV_UNHALT,
> MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP,
> MSR_STAR,
> #ifdef CONFIG_X86_64
> @@ -1606,7 +1607,9 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
> kvm_make_request(KVM_REQ_STEAL_UPDATE, vcpu);
>
> break;
> -
> + case MSR_KVM_PV_UNHALT:
> + vcpu->pv_unhalted = (u32) data;
> + break;
> case MSR_IA32_MCG_CTL:
> case MSR_IA32_MCG_STATUS:
> case MSR_IA32_MC0_CTL ... MSR_IA32_MC0_CTL + 4 * KVM_MAX_MCE_BANKS - 1:
> @@ -1917,6 +1920,9 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
> case MSR_KVM_STEAL_TIME:
> data = vcpu->arch.st.msr_val;
> break;
> + case MSR_KVM_PV_UNHALT:
> + data = (u64)vcpu->pv_unhalted;
> + break;
> case MSR_IA32_P5_MC_ADDR:
> case MSR_IA32_P5_MC_TYPE:
> case MSR_IA32_MCG_CAP:
Unless there is a reason to use an MSR, should use a normal ioctl
such as KVM_{GET,SET}_MP_STATE.
^ permalink raw reply
* Re: [PATCH RFC V5 2/6] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks
From: Marcelo Tosatti @ 2012-04-12 0:06 UTC (permalink / raw)
To: Raghavendra K T
Cc: Jeremy Fitzhardinge, Greg Kroah-Hartman, KVM,
Konrad Rzeszutek Wilk, X86, linux-doc, LKML, Ingo Molnar,
Srivatsa Vaddagiri, Avi Kivity, H. Peter Anvin, Virtualization,
Xen, Stefano Stabellini, Sasha Levin
In-Reply-To: <20120323080701.14568.97779.sendpatchset@codeblue>
On Fri, Mar 23, 2012 at 01:37:04PM +0530, Raghavendra K T wrote:
> From: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
>
> KVM_HC_KICK_CPU allows the calling vcpu to kick another vcpu out of halt state.
>
> The presence of these hypercalls is indicated to guest via
> KVM_FEATURE_PV_UNHALT/KVM_CAP_PV_UNHALT.
>
> Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
> Signed-off-by: Suzuki Poulose <suzuki@in.ibm.com>
> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
> ---
> diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
> index 734c376..9234f13 100644
> --- a/arch/x86/include/asm/kvm_para.h
> +++ b/arch/x86/include/asm/kvm_para.h
> @@ -16,12 +16,14 @@
> #define KVM_FEATURE_CLOCKSOURCE 0
> #define KVM_FEATURE_NOP_IO_DELAY 1
> #define KVM_FEATURE_MMU_OP 2
> +
> /* This indicates that the new set of kvmclock msrs
> * are available. The use of 0x11 and 0x12 is deprecated
> */
> #define KVM_FEATURE_CLOCKSOURCE2 3
> #define KVM_FEATURE_ASYNC_PF 4
> #define KVM_FEATURE_STEAL_TIME 5
> +#define KVM_FEATURE_PV_UNHALT 6
>
> /* The last 8 bits are used to indicate how to interpret the flags field
> * in pvclock structure. If no bits are set, all flags are ignored.
> @@ -32,6 +34,7 @@
> #define MSR_KVM_SYSTEM_TIME 0x12
>
> #define KVM_MSR_ENABLED 1
> +
> /* Custom MSRs falls in the range 0x4b564d00-0x4b564dff */
> #define MSR_KVM_WALL_CLOCK_NEW 0x4b564d00
> #define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 89b02bf..61388b9 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -408,7 +408,8 @@ static int do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> (1 << KVM_FEATURE_NOP_IO_DELAY) |
> (1 << KVM_FEATURE_CLOCKSOURCE2) |
> (1 << KVM_FEATURE_ASYNC_PF) |
> - (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT);
> + (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT) |
> + (1 << KVM_FEATURE_PV_UNHALT);
>
> if (sched_info_on())
> entry->eax |= (1 << KVM_FEATURE_STEAL_TIME);
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 9cbfc06..bd5ef91 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -2079,6 +2079,7 @@ int kvm_dev_ioctl_check_extension(long ext)
> case KVM_CAP_XSAVE:
> case KVM_CAP_ASYNC_PF:
> case KVM_CAP_GET_TSC_KHZ:
> + case KVM_CAP_PV_UNHALT:
> r = 1;
> break;
> case KVM_CAP_COALESCED_MMIO:
> @@ -4913,6 +4914,30 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
> return 1;
> }
>
> +/*
> + * kvm_pv_kick_cpu_op: Kick a vcpu.
> + *
> + * @apicid - apicid of vcpu to be kicked.
> + */
> +static void kvm_pv_kick_cpu_op(struct kvm *kvm, int apicid)
> +{
> + struct kvm_vcpu *vcpu = NULL;
> + int i;
> +
> + kvm_for_each_vcpu(i, vcpu, kvm) {
> + if (!kvm_apic_present(vcpu))
> + continue;
> +
> + if (kvm_apic_match_dest(vcpu, 0, 0, apicid, 0))
> + break;
> + }
> + if (vcpu) {
> + vcpu->pv_unhalted = 1;
> + smp_mb();
> + kvm_vcpu_kick(vcpu);
> + }
> +}
> +
> int kvm_emulate_hypercall(struct kvm_vcpu *vcpu)
> {
> unsigned long nr, a0, a1, a2, a3, ret;
> @@ -4946,6 +4971,10 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu)
> case KVM_HC_VAPIC_POLL_IRQ:
> ret = 0;
> break;
> + case KVM_HC_KICK_CPU:
> + kvm_pv_kick_cpu_op(vcpu->kvm, a0);
> + ret = 0;
> + break;
> default:
> ret = -KVM_ENOSYS;
> break;
> @@ -6174,6 +6203,7 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
> !vcpu->arch.apf.halted)
> || !list_empty_careful(&vcpu->async_pf.done)
> || vcpu->arch.mp_state == KVM_MP_STATE_SIPI_RECEIVED
> + || vcpu->pv_unhalted
> || atomic_read(&vcpu->arch.nmi_queued) ||
> (kvm_arch_interrupt_allowed(vcpu) &&
> kvm_cpu_has_interrupt(vcpu));
> diff --git a/include/linux/kvm.h b/include/linux/kvm.h
> index 68e67e5..e822d96 100644
> --- a/include/linux/kvm.h
> +++ b/include/linux/kvm.h
> @@ -558,6 +558,7 @@ struct kvm_ppc_pvinfo {
> #define KVM_CAP_PPC_PAPR 68
> #define KVM_CAP_S390_GMAP 71
> #define KVM_CAP_TSC_DEADLINE_TIMER 72
> +#define KVM_CAP_PV_UNHALT 73
>
> #ifdef KVM_CAP_IRQ_ROUTING
>
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 900c763..433ae97 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -158,6 +158,7 @@ struct kvm_vcpu {
> #endif
>
> struct kvm_vcpu_arch arch;
> + int pv_unhalted;
> };
>
> static inline int kvm_vcpu_exiting_guest_mode(struct kvm_vcpu *vcpu)
> diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
> index ff476dd..38226e1 100644
> --- a/include/linux/kvm_para.h
> +++ b/include/linux/kvm_para.h
> @@ -19,6 +19,7 @@
> #define KVM_HC_MMU_OP 2
> #define KVM_HC_FEATURES 3
> #define KVM_HC_PPC_MAP_MAGIC_PAGE 4
> +#define KVM_HC_KICK_CPU 5
>
> /*
> * hypercalls use architecture specific
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index a91f980..d3b98b1 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -226,6 +226,7 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
> vcpu->kvm = kvm;
> vcpu->vcpu_id = id;
> vcpu->pid = NULL;
> + vcpu->pv_unhalted = 0;
> init_waitqueue_head(&vcpu->wq);
> kvm_async_pf_vcpu_init(vcpu);
>
> @@ -1567,6 +1568,9 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
> prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE);
>
> if (kvm_arch_vcpu_runnable(vcpu)) {
> + vcpu->pv_unhalted = 0;
> + /* preventing reordering should be enough here */
> + barrier();
Is it always OK to erase the notification, even in case an unrelated
event such as interrupt was the source of wakeup?
It would be easier to verify that notifications are not lost with atomic
test_and_clear(pv_unhalted).
Also x86 specific code should remain in arch/x86/kvm/
^ permalink raw reply
* CFP: 7th International Workshop on Feedback Computing
From: Ming Zhao @ 2012-04-11 11:12 UTC (permalink / raw)
To: virtualization
==================================================
Feedback Computing 2012
The 7th International Workshop on Feedback Computing
http://www.feedbackcomputing.org
In conjunction with ICAC 2012
http://icac2012.cs.fiu.edu
San Jose, California, USA
September 17, 2012
(Paper Submission Date: June 15, 2012)
===================================================
Following the success of the FeBID workshops over the past six years, we debut the Feedback Computing workshop: a unique forum built around the concepts and technologies of applying, analyzing, designing, and exploiting feedback in computing systems. The creation of this new workshop represents the growing use of feedback in a broader agenda and is a timely response to the following two trends: (1) Computing systems are growing larger, smarter, and more complex, and encompass new fields such as cyber-physical systems, social networks, and mobile applications. While much existing work focuses on individual components and systems, it is time to take a more systematic approach and address the dynamical complexity of interactions that arise system-wide with much large scale. (2) Many research disciplines such as machine learning, mathematical optimization, automatic control, cyber-physical systems, and autonomic computing rely on feedback to achieve goals such as autonomy, learni
ng, adaptation, stabilization, robustness, or performance optimization. However, much of existing work focuses on isolated disciplines. It is time to take a more holistic approach and address the foundations and use of feedback, broadly defined, in computing.
Feedback Computing calls for a holistic and systematic technology to study both feedback-based design patterns as well as theoretical foundations of feedback in computing. Aiming to raise community awareness and to promote the fusion of multiple disciplines and practices, this workshop might lay out the ground work for building a new generation of collaborative computing systems that are adaptive, resilient, and agile, while remaining stable and robust. Application topics include but are not limited to:
- Internet services
- Virtualized environments
- Cloud computing
- IaaS, PaaS, and SaaS environments
- Data center resource, power, and cooling management
- Mobile applications
- Sensor networks
- Cyber-physical systems
- Social networks
- Software performance engineering
- Data management systems
- High performance computing environments
The workshop seeks original contributions on foundations or applications of feedback in computing systems. We encourage both research paper submissions expressing new research directions with the promise of producing a pipeline of papers, and application paper submissions elaborating the challenges and experiences from real systems. In addition, the workshop will leverage extended coffee breaks and lunch break to arrange special meetings and to discuss collaborative research agenda built among the participants.
-----------------------------------------------------------------------
SUBMISSION INSTRUCTIONS
Authors are invited to submit both research papers and application papers to emphasize the bi-fold focuses of this workshop.
[Research Papers] Paper submissions must represent original, unpublished contributions. All submissions should be formatted according to the standard ACM two-column proceeding guidelines and not exceed 6 pages in length. Manuscript templates are available for download at http://www.acm.org/sigs/publications/proceedings-templates.
[Application Papers] Paper submissions must be based on real experience and working systems. All submissions should be formatted as annotated slides - a visual in the upper half of a page and the explanatory text in the lower half and not exceed 15 slides in length.
All papers are to be submitted through the workshop website (http://www.feedbackcomputing.org) in PDF files. There will be NO copyright-transferred formal proceedings for the workshop. Accepted papers will be available on the workshop website under authors permission.
One Best Paper Award and one Best Application Paper Award will be announced at the end of workshop to recognize the current best work in Feedback Computing.
-----------------------------------------------------------------------
IMPORTANT DATES
Paper submission: Jun 15, 2012
Author notification: Jul 27, 2012
Final paper due: Aug 24, 2012
Workshop: Sep 17, 2012
-----------------------------------------------------------------------
ORGANIZING COMMITTEE
General Chair
Tarek Abdelzaher (University of Illinois at Urbana Champaign)
Program Co-Chairs
Yixin Diao (IBM T.J. Watson Research Center)
Zhikui Wang (HP Labs)
Publicity Co-Chairs
Xiaoyun Zhu (VMWare)
Matina Maggio (Lund University)
Steering Committee
Tarek Abdelzaher (University of Illinois at Urbana Champaign)
Yixin Diao (IBM T.J. Watson Research Center)
Joseph L. Hellerstein (Google)
Chenyang Lu (Washington University in St. Louis)
Anders Robertsson (Lund University)
Xiaoyun Zhu (VMWare)
Program Committee
Sherif Abdelwahed (Mississippi State University)
Karl-Erik Arzen (Lund University)
Christos Cassandras (Boston University)
Anton Cervin (Lund University)
Chris Gill (Washington University in St. Louis)
Maria Kihl (Lund University)
Jeffrey Kephart (IBM Research)
Charles R Lefurgy (IBM Research)
Jie Liu (Microsoft Research)
Xue Liu (McGill University)
Ying Lu (University of Nebraska at Lincoln)
Arif Merchant (Google)
Pradeep Padala (VMWare)
Sharad Singhal (HP Labs)
Raj Rajkumar (Carnegie Mellon University)
Eric Rutten (INRIA Grenoble)
Mark Squillante (IBM Research)
Eduardo Tovar (Polytechnic Institute of Porto)
Qian Wang (Pennsylvania State University)
______________________________________________________________________
Feedback Computing 2012: The 7th International Workshop on Feedback Computing
17 September 2012, San Jose, California, USA
http://www.feedbackcomputing.org
^ permalink raw reply
* Re: [PATCH] virtio_blk: Add help function to format mass of disks
From: Michael S. Tsirkin @ 2012-04-11 8:43 UTC (permalink / raw)
To: Ren Mingxin
Cc: axboe, kvm, linux-scsi, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, tj
In-Reply-To: <1334042885-8330-1-git-send-email-renmx@cn.fujitsu.com>
On Tue, Apr 10, 2012 at 03:28:05PM +0800, Ren Mingxin wrote:
> The current virtio block's naming algorithm just supports 18278
> (26^3 + 26^2 + 26) disks. If there are mass of virtio blocks,
> there will be disks with the same name.
>
> Based on commit 3e1a7ff8a0a7b948f2684930166954f9e8e776fe, I add
> function "virtblk_name_format()" for virtio block to support mass
> of disks naming.
>
> Signed-off-by: Ren Mingxin <renmx@cn.fujitsu.com>
Applied, thanks everyone.
> ---
> drivers/block/virtio_blk.c | 38 ++++++++++++++++++++++++++------------
> 1 files changed, 26 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index c4a60ba..86516c8 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -374,6 +374,31 @@ static int init_vq(struct virtio_blk *vblk)
> return err;
> }
>
> +static int virtblk_name_format(char *prefix, int index, char *buf, int buflen)
> +{
> + const int base = 'z' - 'a' + 1;
> + char *begin = buf + strlen(prefix);
> + char *begin = buf + strlen(prefix);
> + char *end = buf + buflen;
> + char *p;
> + int unit;
> +
> + p = end - 1;
> + *p = '\0';
> + unit = base;
> + do {
> + if (p == begin)
> + return -EINVAL;
> + *--p = 'a' + (index % unit);
> + index = (index / unit) - 1;
> + } while (index >= 0);
> +
> + memmove(begin, p, end - p);
> + memcpy(buf, prefix, strlen(prefix));
> +
> + return 0;
> +}
> +
> static int __devinit virtblk_probe(struct virtio_device *vdev)
> {
> struct virtio_blk *vblk;
> @@ -442,18 +467,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
>
> q->queuedata = vblk;
>
> - if (index < 26) {
> - sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26);
> - } else if (index < (26 + 1) * 26) {
> - sprintf(vblk->disk->disk_name, "vd%c%c",
> - 'a' + index / 26 - 1, 'a' + index % 26);
> - } else {
> - const unsigned int m1 = (index / 26 - 1) / 26 - 1;
> - const unsigned int m2 = (index / 26 - 1) % 26;
> - const unsigned int m3 = index % 26;
> - sprintf(vblk->disk->disk_name, "vd%c%c%c",
> - 'a' + m1, 'a' + m2, 'a' + m3);
> - }
> + virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN);
>
> vblk->disk->major = major;
> vblk->disk->first_minor = index_to_minor(index);
> --
> 1.7.1
^ permalink raw reply
* [PATCH v2] virtio_blk: Add help function to format mass of disks
From: Ren Mingxin @ 2012-04-11 2:38 UTC (permalink / raw)
To: mst, rusty
Cc: axboe, kvm, linux-scsi, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, Ren Mingxin, avi, tj
The current virtio block's naming algorithm just supports 18278
(26^3 + 26^2 + 26) disks. If there are mass of virtio blocks,
there will be disks with the same name.
Based on commit 3e1a7ff8a0a7b948f2684930166954f9e8e776fe, I add
function "virtblk_name_format()" for virtio block to support mass
of disks naming.
Signed-off-by: Ren Mingxin <renmx@cn.fujitsu.com>
---
v1->v2: wipe off the duplicate line
---
drivers/block/virtio_blk.c | 37 +++++++++++++++++++++++++------------
1 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index c4a60ba..07b8bf9 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -374,6 +374,30 @@ static int init_vq(struct virtio_blk *vblk)
return err;
}
+static int virtblk_name_format(char *prefix, int index, char *buf, int buflen)
+{
+ const int base = 'z' - 'a' + 1;
+ char *begin = buf + strlen(prefix);
+ char *end = buf + buflen;
+ char *p;
+ int unit;
+
+ p = end - 1;
+ *p = '\0';
+ unit = base;
+ do {
+ if (p == begin)
+ return -EINVAL;
+ *--p = 'a' + (index % unit);
+ index = (index / unit) - 1;
+ } while (index >= 0);
+
+ memmove(begin, p, end - p);
+ memcpy(buf, prefix, strlen(prefix));
+
+ return 0;
+}
+
static int __devinit virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -442,18 +466,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
q->queuedata = vblk;
- if (index < 26) {
- sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26);
- } else if (index < (26 + 1) * 26) {
- sprintf(vblk->disk->disk_name, "vd%c%c",
- 'a' + index / 26 - 1, 'a' + index % 26);
- } else {
- const unsigned int m1 = (index / 26 - 1) / 26 - 1;
- const unsigned int m2 = (index / 26 - 1) % 26;
- const unsigned int m3 = index % 26;
- sprintf(vblk->disk->disk_name, "vd%c%c%c",
- 'a' + m1, 'a' + m2, 'a' + m3);
- }
+ virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN);
vblk->disk->major = major;
vblk->disk->first_minor = index_to_minor(index);
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] virtio_blk: Add help function to format mass of disks
From: Ren Mingxin @ 2012-04-11 1:31 UTC (permalink / raw)
To: Asias He, Michael S. Tsirkin
Cc: axboe, kvm, linux-scsi, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, Avi Kivity, Tejun Heo
In-Reply-To: <4F84DCA3.3000805@redhat.com>
On 04/11/2012 09:21 AM, Asias He wrote:
> On 04/10/2012 11:53 PM, Michael S. Tsirkin wrote:
>> On Tue, Apr 10, 2012 at 08:49:43AM -0700, Tejun Heo wrote:
>>> Hello, guys.
>>>
>>> On Tue, Apr 10, 2012 at 04:34:06PM +0300, Michael S. Tsirkin wrote:
>>>>> Why not use 'base' below? neither unit nor base change.
>>>>
>>>> Yes it's a bit strange, it was the same in Tejun's patch.
>>>> Tejun, any idea?
>>>
>>> It was years ago, so I don't recall much. I think I wanted to use a
>>> variable name which signifies its role - I worked out the rather
>>> convoluted base number logic on paper first and I probably wanted to
>>> keep the distinctions. I don't think it really matters at this point
>>> tho. Just make sure those functions are marked deprecated so that no
>>> one else copies them.
>>>
>>> Thanks.
>>
>> I guess I'll keep it same so it's easier to deduplicate
>> if someon wants to.
So, I'd keep this in the next version.
>
> Why not fix it both in sd_format_disk_name() and virtblk_name_format().
> Ren, mind to send v2 to drop the duplicate line?
>
I'll send v2 soon.
--
Thanks,
Ren
^ permalink raw reply
* Re: [PATCH RFC V6 0/11] Paravirtualized ticketlocks
From: Marcelo Tosatti @ 2012-04-11 1:29 UTC (permalink / raw)
To: Thomas Gleixner
Cc: the arch/x86 maintainers, KVM, Konrad Rzeszutek Wilk,
Peter Zijlstra, Stefano Stabellini, Raghavendra K T, LKML,
Virtualization, Andi Kleen, Srivatsa Vaddagiri, Avi Kivity,
Jeremy Fitzhardinge, H. Peter Anvin, Attilio Rao, Ingo Molnar,
Linus Torvalds, Xen Devel, Stephan Diestelhorst
In-Reply-To: <alpine.LFD.2.02.1203302333560.2542@ionos>
On Sat, Mar 31, 2012 at 12:07:58AM +0200, Thomas Gleixner wrote:
> On Fri, 30 Mar 2012, H. Peter Anvin wrote:
>
> > What is the current status of this patchset? I haven't looked at it too
> > closely because I have been focused on 3.4 up until now...
>
> The real question is whether these heuristics are the correct approach
> or not.
>
> If I look at it from the non virtualized kernel side then this is ass
> backwards. We know already that we are holding a spinlock which might
> cause other (v)cpus going into eternal spin. The non virtualized
> kernel solves this by disabling preemption and therefor getting out of
> the critical section as fast as possible,
>
> The virtualization problem reminds me a lot of the problem which RT
> kernels are observing where non raw spinlocks are turned into
> "sleeping spinlocks" and therefor can cause throughput issues for non
> RT workloads.
>
> Though the virtualized situation is even worse. Any preempted guest
> section which holds a spinlock is prone to cause unbound delays.
>
> The paravirt ticketlock solution can only mitigate the problem, but
> not solve it. With massive overcommit there is always a way to trigger
> worst case scenarious unless you are educating the scheduler to cope
> with that.
>
> So if we need to fiddle with the scheduler and frankly that's the only
> way to get a real gain (the numbers, which are achieved by this
> patches, are not that impressive) then the question arises whether we
> should turn the whole thing around.
>
> I know that Peter is going to go berserk on me, but if we are running
> a paravirt guest then it's simple to provide a mechanism which allows
> the host (aka hypervisor) to check that in the guest just by looking
> at some global state.
>
> So if a guest exits due to an external event it's easy to inspect the
> state of that guest and avoid to schedule away when it was interrupted
> in a spinlock held section. That guest/host shared state needs to be
> modified to indicate the guest to invoke an exit when the last nested
> lock has been released.
Remember that the host is scheduling other processes than vcpus of guests.
The case where a higher priority task (whatever that task is) interrupts
a vcpu which holds a spinlock should be frequent, in a overcommit
scenario. Whenever that is the case, other vcpus _must_ be able to stop
spinning.
Now extrapolate that to guests with large number of vcpus. There is no
replacement for sleep-in-hypervisor-instead-of-spin.
> Of course this needs to be time bound, so a rogue guest cannot
> monopolize the cpu forever, but that's the least to worry about
> problem simply because a guest which does not get out of a spinlocked
> region within a certain amount of time is borked and elegible to
> killing anyway.
>
> Thoughts ?
>
> Thanks,
>
> tglx
^ permalink raw reply
* Re: [PATCH] virtio_blk: Add help function to format mass of disks
From: Ren Mingxin @ 2012-04-11 1:28 UTC (permalink / raw)
To: Avi Kivity
Cc: axboe, kvm, linux-scsi, mst, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, tj
In-Reply-To: <4F84329A.60703@redhat.com>
On 04/10/2012 09:16 PM, Avi Kivity wrote:
> On 04/10/2012 10:28 AM, Ren Mingxin wrote:
>> The current virtio block's naming algorithm just supports 18278
>> (26^3 + 26^2 + 26) disks. If there are mass of virtio blocks,
>> there will be disks with the same name.
>>
>> Based on commit 3e1a7ff8a0a7b948f2684930166954f9e8e776fe, I add
>> function "virtblk_name_format()" for virtio block to support mass
>> of disks naming.
>>
>> Signed-off-by: Ren Mingxin<renmx@cn.fujitsu.com>
>> ---
>> drivers/block/virtio_blk.c | 38 ++++++++++++++++++++++++++------------
>> 1 files changed, 26 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
>> index c4a60ba..86516c8 100644
>> --- a/drivers/block/virtio_blk.c
>> +++ b/drivers/block/virtio_blk.c
>> @@ -374,6 +374,31 @@ static int init_vq(struct virtio_blk *vblk)
>> return err;
>> }
>>
>> +static int virtblk_name_format(char *prefix, int index, char *buf, int buflen)
>> +{
>> + const int base = 'z' - 'a' + 1;
>> + char *begin = buf + strlen(prefix);
>> + char *begin = buf + strlen(prefix);
> Duplicate line.
>
Oh, obvious missed :-(
--
Thanks,
Ren
^ permalink raw reply
* Re: [PATCH] virtio_blk: Add help function to format mass of disks
From: Asias He @ 2012-04-11 1:21 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: axboe, kvm, linux-scsi, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, Ren Mingxin, Avi Kivity,
Tejun Heo
In-Reply-To: <20120410155308.GB20551@redhat.com>
On 04/10/2012 11:53 PM, Michael S. Tsirkin wrote:
> On Tue, Apr 10, 2012 at 08:49:43AM -0700, Tejun Heo wrote:
>> Hello, guys.
>>
>> On Tue, Apr 10, 2012 at 04:34:06PM +0300, Michael S. Tsirkin wrote:
>>>> Why not use 'base' below? neither unit nor base change.
>>>
>>> Yes it's a bit strange, it was the same in Tejun's patch.
>>> Tejun, any idea?
>>
>> It was years ago, so I don't recall much. I think I wanted to use a
>> variable name which signifies its role - I worked out the rather
>> convoluted base number logic on paper first and I probably wanted to
>> keep the distinctions. I don't think it really matters at this point
>> tho. Just make sure those functions are marked deprecated so that no
>> one else copies them.
>>
>> Thanks.
>
> I guess I'll keep it same so it's easier to deduplicate
> if someon wants to.
Why not fix it both in sd_format_disk_name() and virtblk_name_format().
Ren, mind to send v2 to drop the duplicate line?
>
>> --
>> tejun
> _______________________________________________
> Virtualization mailing list
> Virtualization@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
--
Asias
^ permalink raw reply
* Re: [PATCH] virtio_blk: Add help function to format mass of disks
From: Michael S. Tsirkin @ 2012-04-10 15:53 UTC (permalink / raw)
To: Tejun Heo
Cc: axboe, kvm, linux-scsi, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, Ren Mingxin, Avi Kivity
In-Reply-To: <20120410154943.GB11614@dhcp-172-17-108-109.mtv.corp.google.com>
On Tue, Apr 10, 2012 at 08:49:43AM -0700, Tejun Heo wrote:
> Hello, guys.
>
> On Tue, Apr 10, 2012 at 04:34:06PM +0300, Michael S. Tsirkin wrote:
> > > Why not use 'base' below? neither unit nor base change.
> >
> > Yes it's a bit strange, it was the same in Tejun's patch.
> > Tejun, any idea?
>
> It was years ago, so I don't recall much. I think I wanted to use a
> variable name which signifies its role - I worked out the rather
> convoluted base number logic on paper first and I probably wanted to
> keep the distinctions. I don't think it really matters at this point
> tho. Just make sure those functions are marked deprecated so that no
> one else copies them.
>
> Thanks.
I guess I'll keep it same so it's easier to deduplicate
if someon wants to.
> --
> tejun
^ permalink raw reply
* Re: [PATCH] virtio_blk: Add help function to format mass of disks
From: Tejun Heo @ 2012-04-10 15:49 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: axboe, kvm, linux-scsi, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, Ren Mingxin, Avi Kivity
In-Reply-To: <20120410133406.GA18899@redhat.com>
Hello, guys.
On Tue, Apr 10, 2012 at 04:34:06PM +0300, Michael S. Tsirkin wrote:
> > Why not use 'base' below? neither unit nor base change.
>
> Yes it's a bit strange, it was the same in Tejun's patch.
> Tejun, any idea?
It was years ago, so I don't recall much. I think I wanted to use a
variable name which signifies its role - I worked out the rather
convoluted base number logic on paper first and I probably wanted to
keep the distinctions. I don't think it really matters at this point
tho. Just make sure those functions are marked deprecated so that no
one else copies them.
Thanks.
--
tejun
^ permalink raw reply
* RE: [PATCH RESEND 1/1] Drivers: scsi: storvsc: Properly handle errors from the host
From: KY Srinivasan @ 2012-04-10 15:13 UTC (permalink / raw)
To: KY Srinivasan, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
virtualization@lists.osdl.org, ohering@suse.com,
jbottomley@parallels.com, hch@infradead.org,
linux-scsi@vger.kernel.org, apw@canonical.com
In-Reply-To: <1333654012-23850-1-git-send-email-kys@microsoft.com>
> -----Original Message-----
> From: K. Y. Srinivasan [mailto:kys@microsoft.com]
> Sent: Thursday, April 05, 2012 3:27 PM
> To: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org; ohering@suse.com;
> jbottomley@parallels.com; hch@infradead.org; linux-scsi@vger.kernel.org;
> apw@canonical.com
> Cc: KY Srinivasan
> Subject: [PATCH RESEND 1/1] Drivers: scsi: storvsc: Properly handle errors from
> the host
>
> If the host returns error for pass through commands, deal with them
> appropriately. I would like to thank James for patiently helping
> me with this patch.
James,
Thank you for suggesting the fix here. I hope this is what you were looking for.
Regards,
K. Y
>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
> drivers/scsi/storvsc_drv.c | 20 +++++++++++++++-----
> 1 files changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 83a1972..528d52b 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -785,12 +785,22 @@ static void storvsc_command_completion(struct
> storvsc_cmd_request *cmd_request)
> /*
> * If there is an error; offline the device since all
> * error recovery strategies would have already been
> - * deployed on the host side.
> + * deployed on the host side. However, if the command
> + * were a pass-through command deal with it appropriately.
> */
> - if (vm_srb->srb_status == SRB_STATUS_ERROR)
> - scmnd->result = DID_TARGET_FAILURE << 16;
> - else
> - scmnd->result = vm_srb->scsi_status;
> + scmnd->result = vm_srb->scsi_status;
> +
> + if (vm_srb->srb_status == SRB_STATUS_ERROR) {
> + switch (scmnd->cmnd[0]) {
> + case ATA_16:
> + case ATA_12:
> + set_host_byte(scmnd, DID_PASSTHROUGH);
> + break;
> + default:
> + set_host_byte(scmnd, DID_TARGET_FAILURE);
> + }
> + }
> +
>
> /*
> * If the LUN is invalid; remove the device.
> --
> 1.7.4.1
>
>
>
^ permalink raw reply
* Re: [PATCH 0/2] adding tracepoints to vhost
From: Zhi Yong Wu @ 2012-04-10 14:58 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: virtualization, linux-kernel, kvm, netdev
In-Reply-To: <20120410134522.GC18899@redhat.com>
On Tue, Apr 10, 2012 at 9:45 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Tue, Apr 10, 2012 at 09:10:48PM +0800, Zhi Yong Wu wrote:
>> >> Perhaps this can replace the vhost log feature? I'm not sure if
>> >> tracepoints support the right data types but it seems like vhost
>> >> debugging could be done using tracing with less code.
>> >>
>> >> Stefan
>> >
>> > vhost log is not a debugging tool, it logs memory accesses for
>> > migration.
>> Great, it is very appreciated if there's some docs about this
>
> About what? vhost logging? See the comment near the
Yeah, thanks
> definition of VHOST_SET_LOG_BASE in vhost.h
>
>> > _______________________________________________
>> > Virtualization mailing list
>> > Virtualization@lists.linux-foundation.org
>> > https://lists.linuxfoundation.org/mailman/listinfo/virtualization
>>
>>
>>
>> --
>> Regards,
>>
>> Zhi Yong Wu
--
Regards,
Zhi Yong Wu
^ permalink raw reply
* Re: [PATCH 0/2] adding tracepoints to vhost
From: Michael S. Tsirkin @ 2012-04-10 13:45 UTC (permalink / raw)
To: Zhi Yong Wu; +Cc: virtualization, linux-kernel, kvm, netdev
In-Reply-To: <CAEH94Li0==w=AUKd5WCPMcqxLh=+N6bKttOwrE8y-xuOyPt_QA@mail.gmail.com>
On Tue, Apr 10, 2012 at 09:10:48PM +0800, Zhi Yong Wu wrote:
> >> Perhaps this can replace the vhost log feature? I'm not sure if
> >> tracepoints support the right data types but it seems like vhost
> >> debugging could be done using tracing with less code.
> >>
> >> Stefan
> >
> > vhost log is not a debugging tool, it logs memory accesses for
> > migration.
> Great, it is very appreciated if there's some docs about this
About what? vhost logging? See the comment near the
definition of VHOST_SET_LOG_BASE in vhost.h
> > _______________________________________________
> > Virtualization mailing list
> > Virtualization@lists.linux-foundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/virtualization
>
>
>
> --
> Regards,
>
> Zhi Yong Wu
^ permalink raw reply
* Re: [PATCH] virtio_blk: Add help function to format mass of disks
From: Michael S. Tsirkin @ 2012-04-10 13:34 UTC (permalink / raw)
To: Avi Kivity
Cc: axboe, kvm, linux-scsi, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, Ren Mingxin, tj
In-Reply-To: <4F84329A.60703@redhat.com>
On Tue, Apr 10, 2012 at 04:16:10PM +0300, Avi Kivity wrote:
> On 04/10/2012 10:28 AM, Ren Mingxin wrote:
> > The current virtio block's naming algorithm just supports 18278
> > (26^3 + 26^2 + 26) disks. If there are mass of virtio blocks,
> > there will be disks with the same name.
> >
> > Based on commit 3e1a7ff8a0a7b948f2684930166954f9e8e776fe, I add
> > function "virtblk_name_format()" for virtio block to support mass
> > of disks naming.
> >
> > Signed-off-by: Ren Mingxin <renmx@cn.fujitsu.com>
> > ---
> > drivers/block/virtio_blk.c | 38 ++++++++++++++++++++++++++------------
> > 1 files changed, 26 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> > index c4a60ba..86516c8 100644
> > --- a/drivers/block/virtio_blk.c
> > +++ b/drivers/block/virtio_blk.c
> > @@ -374,6 +374,31 @@ static int init_vq(struct virtio_blk *vblk)
> > return err;
> > }
> >
> > +static int virtblk_name_format(char *prefix, int index, char *buf, int buflen)
> > +{
> > + const int base = 'z' - 'a' + 1;
> > + char *begin = buf + strlen(prefix);
> > + char *begin = buf + strlen(prefix);
>
> Duplicate line.
>
> > + char *end = buf + buflen;
> > + char *p;
> > + int unit;
> > +
> > + p = end - 1;
> > + *p = '\0';
> > + unit = base;
>
> Why not use 'base' below? neither unit nor base change.
Yes it's a bit strange, it was the same in Tejun's patch.
Tejun, any idea?
> > + do {
> > + if (p == begin)
> > + return -EINVAL;
> > + *--p = 'a' + (index % unit);
> > + index = (index / unit) - 1;
> > + } while (index >= 0);
> > +
> > + memmove(begin, p, end - p);
> > + memcpy(buf, prefix, strlen(prefix));
> > +
> > + return 0;
> > +}
> > +
> >
>
> --
> error compiling committee.c: too many arguments to function
^ permalink raw reply
* Re: [PATCH] virtio_blk: Add help function to format mass of disks
From: Avi Kivity @ 2012-04-10 13:16 UTC (permalink / raw)
To: Ren Mingxin
Cc: axboe, kvm, linux-scsi, mst, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, tj
In-Reply-To: <1334042885-8330-1-git-send-email-renmx@cn.fujitsu.com>
On 04/10/2012 10:28 AM, Ren Mingxin wrote:
> The current virtio block's naming algorithm just supports 18278
> (26^3 + 26^2 + 26) disks. If there are mass of virtio blocks,
> there will be disks with the same name.
>
> Based on commit 3e1a7ff8a0a7b948f2684930166954f9e8e776fe, I add
> function "virtblk_name_format()" for virtio block to support mass
> of disks naming.
>
> Signed-off-by: Ren Mingxin <renmx@cn.fujitsu.com>
> ---
> drivers/block/virtio_blk.c | 38 ++++++++++++++++++++++++++------------
> 1 files changed, 26 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index c4a60ba..86516c8 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -374,6 +374,31 @@ static int init_vq(struct virtio_blk *vblk)
> return err;
> }
>
> +static int virtblk_name_format(char *prefix, int index, char *buf, int buflen)
> +{
> + const int base = 'z' - 'a' + 1;
> + char *begin = buf + strlen(prefix);
> + char *begin = buf + strlen(prefix);
Duplicate line.
> + char *end = buf + buflen;
> + char *p;
> + int unit;
> +
> + p = end - 1;
> + *p = '\0';
> + unit = base;
Why not use 'base' below? neither unit nor base change.
> + do {
> + if (p == begin)
> + return -EINVAL;
> + *--p = 'a' + (index % unit);
> + index = (index / unit) - 1;
> + } while (index >= 0);
> +
> + memmove(begin, p, end - p);
> + memcpy(buf, prefix, strlen(prefix));
> +
> + return 0;
> +}
> +
>
--
error compiling committee.c: too many arguments to function
^ permalink raw reply
* Re: [PATCH 0/2] adding tracepoints to vhost
From: Zhi Yong Wu @ 2012-04-10 13:10 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: virtualization, linux-kernel, kvm, netdev
In-Reply-To: <20120410124250.GB29808@redhat.com>
On Tue, Apr 10, 2012 at 8:42 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Tue, Apr 10, 2012 at 12:40:50PM +0100, Stefan Hajnoczi wrote:
>> On Tue, Apr 10, 2012 at 3:58 AM, Jason Wang <jasowang@redhat.com> wrote:
>> > To help in vhost analyzing, the following series adding basic tracepoints to
>> > vhost. Operations of both virtqueues and vhost works were traced in current
>> > implementation, net code were untouched. A top-like satistics displaying script
>> > were introduced to help the troubleshooting.
>> >
>> > TODO:
>> > - net specific tracepoints?
>> >
>> > ---
>> >
>> > Jason Wang (2):
>> > vhost: basic tracepoints
>> > tools: virtio: add a top-like utility for displaying vhost satistics
>> >
>> >
>> > drivers/vhost/trace.h | 153 ++++++++++++++++++++
>> > drivers/vhost/vhost.c | 17 ++
>> > tools/virtio/vhost_stat | 360 +++++++++++++++++++++++++++++++++++++++++++++++
>> > 3 files changed, 528 insertions(+), 2 deletions(-)
>> > create mode 100644 drivers/vhost/trace.h
>> > create mode 100755 tools/virtio/vhost_stat
>>
>> Perhaps this can replace the vhost log feature? I'm not sure if
>> tracepoints support the right data types but it seems like vhost
>> debugging could be done using tracing with less code.
>>
>> Stefan
>
> vhost log is not a debugging tool, it logs memory accesses for
> migration.
Great, it is very appreciated if there's some docs about this
> _______________________________________________
> Virtualization mailing list
> Virtualization@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
--
Regards,
Zhi Yong Wu
^ permalink raw reply
* Re: [PATCH] virtio_blk: Add help function to format mass of disks
From: Asias He @ 2012-04-10 13:08 UTC (permalink / raw)
To: Ren Mingxin
Cc: axboe, kvm, linux-scsi, mst, asamymuthupa, linux-kernel,
virtualization, James.Bottomley, tj
In-Reply-To: <1334042885-8330-1-git-send-email-renmx@cn.fujitsu.com>
On 04/10/2012 03:28 PM, Ren Mingxin wrote:
> The current virtio block's naming algorithm just supports 18278
> (26^3 + 26^2 + 26) disks. If there are mass of virtio blocks,
> there will be disks with the same name.
>
> Based on commit 3e1a7ff8a0a7b948f2684930166954f9e8e776fe, I add
> function "virtblk_name_format()" for virtio block to support mass
> of disks naming.
>
> Signed-off-by: Ren Mingxin<renmx@cn.fujitsu.com>
Make sense to me.
Acked-by: Asias He <asias@redhat.com>
> ---
> drivers/block/virtio_blk.c | 38 ++++++++++++++++++++++++++------------
> 1 files changed, 26 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index c4a60ba..86516c8 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -374,6 +374,31 @@ static int init_vq(struct virtio_blk *vblk)
> return err;
> }
>
> +static int virtblk_name_format(char *prefix, int index, char *buf, int buflen)
> +{
> + const int base = 'z' - 'a' + 1;
> + char *begin = buf + strlen(prefix);
> + char *begin = buf + strlen(prefix);
> + char *end = buf + buflen;
> + char *p;
> + int unit;
> +
> + p = end - 1;
> + *p = '\0';
> + unit = base;
> + do {
> + if (p == begin)
> + return -EINVAL;
> + *--p = 'a' + (index % unit);
> + index = (index / unit) - 1;
> + } while (index>= 0);
> +
> + memmove(begin, p, end - p);
> + memcpy(buf, prefix, strlen(prefix));
> +
> + return 0;
> +}
> +
> static int __devinit virtblk_probe(struct virtio_device *vdev)
> {
> struct virtio_blk *vblk;
> @@ -442,18 +467,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
>
> q->queuedata = vblk;
>
> - if (index< 26) {
> - sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26);
> - } else if (index< (26 + 1) * 26) {
> - sprintf(vblk->disk->disk_name, "vd%c%c",
> - 'a' + index / 26 - 1, 'a' + index % 26);
> - } else {
> - const unsigned int m1 = (index / 26 - 1) / 26 - 1;
> - const unsigned int m2 = (index / 26 - 1) % 26;
> - const unsigned int m3 = index % 26;
> - sprintf(vblk->disk->disk_name, "vd%c%c%c",
> - 'a' + m1, 'a' + m2, 'a' + m3);
> - }
> + virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN);
>
> vblk->disk->major = major;
> vblk->disk->first_minor = index_to_minor(index);
--
Asias
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox