[PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive

2012-08-21 Thread Cong Meng
This patch adds some queue limit parameters into block drive. And inits them for sg block drive. Some interfaces are also added for accessing them. Signed-off-by: Cong Meng m...@linux.vnet.ibm.com --- block/raw-posix.c | 58 + block_int.h

[PATCH 2/2 v1] virtio-scsi: set per-LUN queue limits for sg devices

2012-08-21 Thread Cong Meng
Each virtio scsi HBA has global request queue limits. But the passthrough LUNs (scsi-generic) come from different host HBAs may have different request queue limits. If the guest sends commands that exceed the host limits, the commands will be rejected by host HAB. To address the issue, this

[PATCH v1] virtio-scsi: get and set the queue limits for sg device

2012-08-21 Thread Cong Meng
Each virtio scsi HBA has global request queue limits. But the passthrough LUNs (scsi-generic) come from different host HBAs may have different request queue limits. If the guest sends commands that exceed the host limits, the commands will be rejected by host HAB. This patch addresses this issue

Re: [PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive

2012-08-21 Thread Paolo Bonzini
Il 21/08/2012 10:23, Cong Meng ha scritto: +static void sg_get_queue_limits(BlockDriverState *bs, const char *filename) +{ +DIR *ffs; +struct dirent *d; +char path[MAXPATHLEN]; + +snprintf(path, MAXPATHLEN, + /sys/class/scsi_generic/sg%s/device/block/, +

Re: [PATCH v1] virtio-scsi: get and set the queue limits for sg device

2012-08-21 Thread Stefan Hajnoczi
On Tue, Aug 21, 2012 at 9:26 AM, Cong Meng m...@linux.vnet.ibm.com wrote: Each virtio scsi HBA has global request queue limits. But the passthrough LUNs (scsi-generic) come from different host HBAs may have different request queue limits. If the guest sends commands that exceed the host limits,

Re: [PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive

2012-08-21 Thread Cong Meng
On Tue 21 Aug 2012 04:48:17 PM CST, Paolo Bonzini wrote: Il 21/08/2012 10:23, Cong Meng ha scritto: +static void sg_get_queue_limits(BlockDriverState *bs, const char *filename) +{ +DIR *ffs; +struct dirent *d; +char path[MAXPATHLEN]; + +snprintf(path, MAXPATHLEN, +

Re: [PATCH v1] virtio-scsi: get and set the queue limits for sg device

2012-08-21 Thread Cong Meng
On Tue 21 Aug 2012 04:53:59 PM CST, Stefan Hajnoczi wrote: On Tue, Aug 21, 2012 at 9:26 AM, Cong Meng m...@linux.vnet.ibm.com wrote: Each virtio scsi HBA has global request queue limits. But the passthrough LUNs (scsi-generic) come from different host HBAs may have different request queue

Re: [PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive

2012-08-21 Thread Stefan Hajnoczi
On Tue, Aug 21, 2012 at 9:23 AM, Cong Meng m...@linux.vnet.ibm.com wrote: This patch adds some queue limit parameters into block drive. And inits them for sg block drive. Some interfaces are also added for accessing them. Signed-off-by: Cong Meng m...@linux.vnet.ibm.com ---

Re: [PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive

2012-08-21 Thread Stefan Hajnoczi
On Tue, Aug 21, 2012 at 10:41 AM, Cong Meng m...@linux.vnet.ibm.com wrote: On Tue 21 Aug 2012 04:48:17 PM CST, Paolo Bonzini wrote: Il 21/08/2012 10:23, Cong Meng ha scritto: +static void sg_get_queue_limits(BlockDriverState *bs, const char *filename) +{ +DIR *ffs; +struct

Re: [PATCH 2/2 v1] virtio-scsi: set per-LUN queue limits for sg devices

2012-08-21 Thread Stefan Hajnoczi
On Tue, Aug 21, 2012 at 9:23 AM, Cong Meng m...@linux.vnet.ibm.com wrote: @@ -557,6 +621,7 @@ static uint32_t virtio_scsi_get_features(VirtIODevice *vdev, { requested_features |= (1UL VIRTIO_SCSI_F_HOTPLUG); requested_features |= (1UL VIRTIO_SCSI_F_CHANGE); +

Re: [PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive

2012-08-21 Thread Paolo Bonzini
Il 21/08/2012 11:52, Stefan Hajnoczi ha scritto: Using /sys/dev/block or /sys/dev/char seems easier, and lets you retrieve the parameters for block devices too. what do you mean with block devices? Using /dev/sda instead of /dev/sg0? Yes. However, I'm worried of the consequences

Re: Re: [PATCH V2 0/6] virtio-trace: Support virtio-trace

2012-08-21 Thread Masami Hiramatsu
(2012/08/21 14:16), Amit Shah wrote: On (Thu) 09 Aug 2012 [21:30:29], Yoshihiro YUNOMAE wrote: Hi All, The following patch set provides a low-overhead system for collecting kernel tracing data of guests by a host in a virtualization environment. ACK this series. Thank you! I ran it

[PATCH v8 0/5] make balloon pages movable by compaction

2012-08-21 Thread Rafael Aquini
Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of transparent huge pages that could be used by the guest workload. This

[PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of transparent huge pages that could be used by the guest workload. This

[PATCH v8 3/5] virtio_balloon: introduce migration primitives to balloon pages

2012-08-21 Thread Rafael Aquini
Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of transparent huge pages that could be used by the guest workload. Besides

[PATCH v8 2/5] mm: introduce compaction and migration for ballooned pages

2012-08-21 Thread Rafael Aquini
Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of transparent huge pages that could be used by the guest workload. This

[PATCH v8 4/5] mm: introduce putback_movable_pages()

2012-08-21 Thread Rafael Aquini
The PATCH mm: introduce compaction and migration for virtio ballooned pages hacks around putback_lru_pages() in order to allow ballooned pages to be re-inserted on balloon page list as if a ballooned page was like a LRU page. As ballooned pages are not legitimate LRU pages, this patch introduces

[PATCH v8 5/5] mm: add vm event counters for balloon pages compaction

2012-08-21 Thread Rafael Aquini
This patch introduces a new set of vm event counters to keep track of ballooned pages compaction activity. Signed-off-by: Rafael Aquini aqu...@redhat.com --- drivers/virtio/virtio_balloon.c | 2 ++ include/linux/vm_event_item.h | 8 +++- mm/balloon_compaction.c | 6 --

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 09:47:44AM -0300, Rafael Aquini wrote: Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 04:52:23PM +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 09:47:44AM -0300, Rafael Aquini wrote: Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus

Re: [PATCH v8 3/5] virtio_balloon: introduce migration primitives to balloon pages

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 09:47:46AM -0300, Rafael Aquini wrote: Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of

Re: [PATCH v8 4/5] mm: introduce putback_movable_pages()

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 09:47:47AM -0300, Rafael Aquini wrote: The PATCH mm: introduce compaction and migration for virtio ballooned pages hacks around putback_lru_pages() in order to allow ballooned pages to be re-inserted on balloon page list as if a ballooned page was like a LRU page. As

Re: [PATCH v8 3/5] virtio_balloon: introduce migration primitives to balloon pages

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 09:47:46AM -0300, Rafael Aquini wrote: Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 05:16:06PM +0200, Peter Zijlstra wrote: On Tue, 2012-08-21 at 16:52 +0300, Michael S. Tsirkin wrote: + rcu_read_lock(); + mapping = rcu_dereference(page-mapping); + if (mapping_balloon(mapping)) + ret =

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Peter Zijlstra
On Tue, 2012-08-21 at 16:52 +0300, Michael S. Tsirkin wrote: + rcu_read_lock(); + mapping = rcu_dereference(page-mapping); + if (mapping_balloon(mapping)) + ret = true; + rcu_read_unlock(); This looks suspicious: you

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Peter Zijlstra
On Tue, 2012-08-21 at 09:47 -0300, Rafael Aquini wrote: + mapping = rcu_access_pointer(page-mapping); + if (mapping) + mapping = mapping-assoc_mapping; The comment near rcu_access_pointer() explicitly says: * Return the value of the specified RCU-protected pointer,

Re: [PATCH v8 3/5] virtio_balloon: introduce migration primitives to balloon pages

2012-08-21 Thread Peter Zijlstra
On Tue, 2012-08-21 at 17:40 +0300, Michael S. Tsirkin wrote: + spin_lock(vb-pages_lock); + page = list_first_or_null_rcu(vb-pages, struct page, lru); Why is list_first_or_null_rcu called outside RCU critical section here? It looks like vb-pages_lock is the

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Paul E. McKenney
On Tue, Aug 21, 2012 at 05:20:11PM +0200, Peter Zijlstra wrote: On Tue, 2012-08-21 at 09:47 -0300, Rafael Aquini wrote: + mapping = rcu_access_pointer(page-mapping); + if (mapping) + mapping = mapping-assoc_mapping; The comment near rcu_access_pointer()

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Tue, Aug 21, 2012 at 06:41:42PM +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 05:16:06PM +0200, Peter Zijlstra wrote: On Tue, 2012-08-21 at 16:52 +0300, Michael S. Tsirkin wrote: + rcu_read_lock(); + mapping = rcu_dereference(page-mapping); +

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Tue, Aug 21, 2012 at 04:52:23PM +0300, Michael S. Tsirkin wrote: + * address_space_operations utilized methods for ballooned pages: + * .migratepage- used to perform balloon's page migration (as is) + * .launder_page - used to isolate a page from balloon's page list + *

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Tue, Aug 21, 2012 at 09:24:32AM -0700, Paul E. McKenney wrote: On Tue, Aug 21, 2012 at 05:20:11PM +0200, Peter Zijlstra wrote: On Tue, 2012-08-21 at 09:47 -0300, Rafael Aquini wrote: + mapping = rcu_access_pointer(page-mapping); + if (mapping) + mapping =

Re: [Qemu-devel] [PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive

2012-08-21 Thread Blue Swirl
On Tue, Aug 21, 2012 at 8:23 AM, Cong Meng m...@linux.vnet.ibm.com wrote: This patch adds some queue limit parameters into block drive. And inits them for sg block drive. Some interfaces are also added for accessing them. Signed-off-by: Cong Meng m...@linux.vnet.ibm.com ---

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 02:28:20PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at 09:24:32AM -0700, Paul E. McKenney wrote: On Tue, Aug 21, 2012 at 05:20:11PM +0200, Peter Zijlstra wrote: On Tue, 2012-08-21 at 09:47 -0300, Rafael Aquini wrote: + mapping =

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 02:55:03PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at 04:52:23PM +0300, Michael S. Tsirkin wrote: + * address_space_operations utilized methods for ballooned pages: + * .migratepage- used to perform balloon's page migration (as is) + *

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Tue, Aug 21, 2012 at 10:13:30PM +0300, Michael S. Tsirkin wrote: I believe rcu_dereference_protected() is what I want/need here, since this code is always called for pages which we hold locked (PG_locked bit). It would only help if we locked the page while updating the mapping, as

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 02:42:52PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at 06:41:42PM +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 05:16:06PM +0200, Peter Zijlstra wrote: On Tue, 2012-08-21 at 16:52 +0300, Michael S. Tsirkin wrote: + rcu_read_lock();

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 04:23:58PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at 10:13:30PM +0300, Michael S. Tsirkin wrote: I believe rcu_dereference_protected() is what I want/need here, since this code is always called for pages which we hold locked (PG_locked bit). It

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Tue, Aug 21, 2012 at 10:16:12PM +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 02:55:03PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at 04:52:23PM +0300, Michael S. Tsirkin wrote: + * address_space_operations utilized methods for ballooned pages: + * .migratepage

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Tue, Aug 21, 2012 at 10:30:31PM +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 04:23:58PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at 10:13:30PM +0300, Michael S. Tsirkin wrote: I believe rcu_dereference_protected() is what I want/need here, since this code

[RFC-v3 0/5] vhost-scsi: Add support for host virtualized target

2012-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Hi folks, This is the third RFC for vhost-scsi patches against mainline QEMU v1.1 to support the upstream tcm_vhost host virtualized target driver now available in v3.6-rc kernel code. This series is based upon last week's commit 346fe0c4c0b, and is

[RFC-v3 1/5] monitor: Rename+move net_handle_fd_param - monitor_handle_fd_param

2012-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch renames+moves the net_handle_fd_param() caller used to obtain a file descriptor from either qemu_parse_fd() (the normal case) or from monitor_get_fd() (migration case) into a generically prefixed monitor_handle_fd_param() to be used by

[RFC-v3 2/5] vhost: Pass device path to vhost_dev_init()

2012-08-21 Thread Nicholas A. Bellinger
From: Stefan Hajnoczi stefa...@linux.vnet.ibm.com The path to /dev/vhost-net is currently hardcoded in vhost_dev_init(). This needs to be changed so that /dev/vhost-scsi can be used. Pass in the device path instead of hardcoding it. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com Cc:

[RFC-v3 3/5] vhost-scsi: add -vhost-scsi host device for use with tcm-vhost

2012-08-21 Thread Nicholas A. Bellinger
From: Stefan Hajnoczi stefa...@linux.vnet.ibm.com This patch adds a new type of host device that drives the vhost_scsi device. The syntax to add vhost-scsi is: qemu -vhost-scsi id=vhost-scsi0,wwpn=...,tpgt=123 The virtio-scsi emulated device will make use of vhost-scsi to process virtio-scsi

[RFC-v3 4/5] virtio-scsi: Add start/stop functionality for vhost-scsi

2012-08-21 Thread Nicholas A. Bellinger
From: Stefan Hajnoczi stefa...@linux.vnet.ibm.com This patch starts and stops vhost as the virtio device transitions through its status phases. Vhost can only be started once the guest reports its driver has successfully initialized, which means the virtqueues have been set up by the guest. v3:

[RFC-v3 5/5] virtio-scsi: Set max_target=0 during vhost-scsi operation

2012-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This QEMU patch sets VirtIOSCSIConfig-max_target=0 for vhost-scsi operation to restrict virtio-scsi LLD guest scanning to max_id=0 (a single target ID instance) when connected to individual tcm_vhost endpoints. This ensures that virtio-scsi LLD only

Re: [PATCH v7 2/4] virtio_balloon: introduce migration primitives to balloon pages

2012-08-21 Thread Rusty Russell
On Wed, 15 Aug 2012 14:28:51 +0300, Michael S. Tsirkin m...@redhat.com wrote: On Wed, Aug 15, 2012 at 12:16:51PM +0100, Mel Gorman wrote: I was thinking of exactly that page-mapping == balloon_mapping check. As I do not know how many active balloon drivers there might be I cannot guess in

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 04:34:39PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at 10:16:12PM +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 02:55:03PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at 04:52:23PM +0300, Michael S. Tsirkin wrote: + *

Re: [PATCH v7 2/4] virtio_balloon: introduce migration primitives to balloon pages

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 03:01:37PM +0930, Rusty Russell wrote: On Wed, 15 Aug 2012 14:28:51 +0300, Michael S. Tsirkin m...@redhat.com wrote: On Wed, Aug 15, 2012 at 12:16:51PM +0100, Mel Gorman wrote: I was thinking of exactly that page-mapping == balloon_mapping check. As I do not

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Wed, Aug 22, 2012 at 03:07:41AM +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 05:45:56PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at 10:30:31PM +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 04:23:58PM -0300, Rafael Aquini wrote: On Tue, Aug 21, 2012 at