[PATCH v3 21/21] Drivers: hv: utils: unify driver registration reporting

2015-04-09 Thread Vitaly Kuznetsov
... and move it to debug level as normally daemons write to syslog themselves and these kernel messages are useless. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c| 3 +-- drivers/hv/hv_kvp.c | 3 ++- drivers/hv/hv_snapshot.c | 2 +- 3 files changed, 4

[PATCH v3 15/21] Drivers: hv: fcopy: convert to hv_utils_transport

2015-04-09 Thread Vitaly Kuznetsov
Unify the code with the recently introduced hv_utils_transport. Netlink communication is disabled for fcopy. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 194 -- 1 file changed, 46 insertions(+), 148 deletions

[PATCH v3 02/21] Drivers: hv: kvp: reset kvp_context

2015-04-09 Thread Vitaly Kuznetsov
issues as: 1) Host is supposed to serialize transactions as well 2) If no message is pending vmbus_recvpacket() will return 0 recvlen. This is just a cleanup. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_kvp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hv

[PATCH v3 13/21] Drivers: hv: util: introduce hv_utils_transport abstraction

2015-04-09 Thread Vitaly Kuznetsov
the switch from netlink to chardev operational mode is supported. Every hv_util daemon is supposed to register 2 callbacks: 1) on_msg() to get notified when the userspace daemon sent a message; 2) on_reset() to get notified when the userspace daemon drops the connection. Signed-off-by: Vitaly Kuznetsov

[PATCH v3 16/21] Drivers: hv: kvp: convert to hv_utils_transport

2015-04-09 Thread Vitaly Kuznetsov
... to support both netlink and /dev/vmbus/hv_kvp communication methods. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_kvp.c | 91 + 1 file changed, 42 insertions(+), 49 deletions(-) diff --git a/drivers/hv/hv_kvp.c b

[PATCH v3 11/21] Drivers: hv: fcopy: switch to using the hvutil_device_state state machine

2015-04-09 Thread Vitaly Kuznetsov
the userspace daemon is disconnected, otherwise we can make the host think we don't support FCOPY and disable the service completely. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 70 ++- 1 file changed, 30 insertions

[PATCH v3 12/21] Drivers: hv: fcopy: set .owner reference for file operations

2015-04-09 Thread Vitaly Kuznetsov
... otherwise a crash is observed when hv_utils module is being unloaded while fcopy daemon is still running. .owner gives us an additional reference when someone holds a descriptor for the device. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 6 ++ 1 file

[PATCH v3 08/21] Drivers: hv: util: introduce state machine for util drivers

2015-04-09 Thread Vitaly Kuznetsov
drivers. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hyperv_vmbus.h | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 2f30456..138d663 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h

[PATCH v3 00/21] Drivers: hv: utils: re-implement the kernel/userspace communication layer

2015-04-09 Thread Vitaly Kuznetsov
host side. Racy daemon startup is also a problem. - When the userspace daemon restarts/dies kernel part doesn't receive a notification. - Netlink communication is not stable under heavy load. - ... Vitaly Kuznetsov (21): Drivers: hv: util: move kvp/vss function declarations to hyperv_vmbus.h

[PATCH v3 05/21] Drivers: hv: vss: process deferred messages when we complete the transaction

2015-04-09 Thread Vitaly Kuznetsov
support only the former. Add support for the later, use hv_poll_channel() to do the job. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_snapshot.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv

[PATCH 2/2] hv_netvsc: try linearizing big SKBs before dropping them

2015-04-08 Thread Vitaly Kuznetsov
sender to try resending it but in most cases it will try resending the same packet which will also get dropped, this will cause the particular connection to stick. To solve the issue we can try linearizing skb. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/net/hyperv/netvsc_drv.c

[PATCH 0/2] hv_netvsc: linearize SKBs bigger than MAX_PAGE_BUFFER_COUNT-2 pages

2015-04-08 Thread Vitaly Kuznetsov
as all retries fail as well. It should also be possible to trigger the issue from userspace, I expect e.g. NFS under heavy load to get stuck sometimes. Vitaly Kuznetsov (2): hv_netvsc: use single existing drop path in netvsc_start_xmit hv_netvsc: try linearizing big SKBs before dropping them

[PATCH 1/2] hv_netvsc: use single existing drop path in netvsc_start_xmit

2015-04-08 Thread Vitaly Kuznetsov
... which validly uses dev_kfree_skb_any() instead of dev_kfree_skb(). Setting ret to -EFAULT and -ENOMEM have no real meaning here (we need to set it to anything but -EAGAIN) as we drop the packet and return NETDEV_TX_OK anyway. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers

[PATCH 1/2] Drivers: hv: hv_balloon: correctly handle val.freeramnum_pages case

2015-03-27 Thread Vitaly Kuznetsov
to balloon more than val.freeram but in case he have a memory hog started after we post the last pressure report we can get into troubles. Suggested-by: Laszlo Ersek ler...@redhat.com Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_balloon.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 2/2] Drivers: hv: hv_balloon: correctly handle num_pagesINT_MAX case

2015-03-27 Thread Vitaly Kuznetsov
. Change num_pages type to unsigned int. In real life ballooning request come with num_pages in [512, 32768] range so this is more a future-proof/cleanup. Reported-by: Laszlo Ersek ler...@redhat.com Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_balloon.c | 13

[PATCH 0/2] Drivers: hv: hv_balloon: two additional corner cases in balloon_up()

2015-03-27 Thread Vitaly Kuznetsov
on top of previously sent 'Drivers: hv: hv_balloon: survive ballooning request with num_pages=0'. Both issues were found by Laszlo Ersek during code review. Vitaly Kuznetsov (2): Drivers: hv: hv_balloon: correctly handle val.freeramnum_pages case Drivers: hv: hv_balloon: correctly handle

Re: [PATCH 0/1] Drivers: hv: hv_balloon: do not online pages in offline blocks

2015-03-26 Thread Vitaly Kuznetsov
KY Srinivasan k...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Wednesday, March 25, 2015 11:02 AM To: KY Srinivasan Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux- ker...@vger.kernel.org; Dexuan Cui Subject: [PATCH 0/1

[PATCH] Drivers: hv: hv_balloon: eliminate jumps in piecewiese linear floor function

2015-03-26 Thread Vitaly Kuznetsov
to make an adjustment at 8192 boundary: 232 + 8192/16 = 744 512 + 8192/32 = 768 (so the right value is 488) Suggested-by: Laszlo Ersek ler...@redhat.com Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_balloon.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH] Drivers: hv: hv_balloon: survive ballooning request with num_pages=0

2015-03-26 Thread Vitaly Kuznetsov
to allocate a single page. Suggested-by: Laszlo Ersek ler...@redhat.com Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_balloon.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 16d52da

[PATCH 0/1] Drivers: hv: hv_balloon: do not online pages in offline blocks

2015-03-25 Thread Vitaly Kuznetsov
() and hv_online_page() will go away, ha_region_mutex won't probably be required,... Please let me know if you think I should follow this way. Vitaly Kuznetsov (1): Drivers: hv: hv_balloon: do not online pages in offline blocks drivers/hv/hv_balloon.c | 12 +++- 1 file changed, 11 insertions

[PATCH 1/1] Drivers: hv: hv_balloon: do not online pages in offline blocks

2015-03-25 Thread Vitaly Kuznetsov
notifications (and hv_balloon is not the only receiver of them),... And, first of all, nobody asked as to online these pages. Solve the issue by checking if the last previously backed page was onlined and onlining the tail only in case it was. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com

Re: [PATCH RESEND 1/5] staging: sm750fb: Use memset_io instead of memset

2015-03-18 Thread Vitaly Kuznetsov
Lorenzo Stoakes lstoa...@gmail.com writes: This patch uses memset_io instead of memset when using memset on __iomem qualified pointers. This fixes the following sparse warnings:- drivers/staging/sm750fb/sm750.c:489:17: warning: incorrect type in argument 1 (different address spaces)

[PATCH RFCv2 18/21] Tools: hv: vss: use misc char device to communicate with kernel

2015-03-12 Thread Vitaly Kuznetsov
Use /dev/vmbus/hv_vss instead of netlink. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- tools/hv/hv_vss_daemon.c | 139 +-- 1 file changed, 25 insertions(+), 114 deletions(-) diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c

[PATCH RFCv2 21/21] Drivers: hv: utils: unify driver registration reporting

2015-03-12 Thread Vitaly Kuznetsov
... and move it to debug level as normally daemons write to syslog themselves and these kernel messages are useless. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c| 3 +-- drivers/hv/hv_kvp.c | 3 ++- drivers/hv/hv_snapshot.c | 2 +- 3 files changed, 4

Re: [PATCH 2/6] Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure

2015-03-12 Thread Vitaly Kuznetsov
Olaf Hering o...@aepfle.de writes: On Wed, Mar 11, K. Y. Srinivasan wrote: +++ b/drivers/hv/hv_balloon.c @@ -652,6 +652,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, } has-ha_end_pfn -= HA_CHUNK;

[PATCH RFCv2 07/21] Drivers: hv: fcopy: rename fcopy_work - fcopy_timeout_work

2015-03-11 Thread Vitaly Kuznetsov
'fcopy_work' (and fcopy_work_func) is a misnomer as it sounds like we expect this useful work to happen and in reality it is just an emergency escape when timeout happens. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 14 +++--- 1 file changed, 7

[PATCH RFCv2 16/21] Drivers: hv: kvp: convert to hv_utils_transport

2015-03-11 Thread Vitaly Kuznetsov
... to support both netlink and /dev/vmbus/hv_kvp communication methods. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_kvp.c | 91 + 1 file changed, 42 insertions(+), 49 deletions(-) diff --git a/drivers/hv/hv_kvp.c b

[PATCH RFCv2 15/21] Drivers: hv: fcopy: convert to hv_utils_transport

2015-03-11 Thread Vitaly Kuznetsov
Unify the code with the recently introduced hv_utils_transport. Netlink communication is disabled for fcopy. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 194 -- 1 file changed, 46 insertions(+), 148 deletions

[PATCH RFCv2 17/21] Tools: hv: kvp: use misc char device to communicate with kernel

2015-03-11 Thread Vitaly Kuznetsov
Use /dev/vmbus/hv_kvp instead of netlink. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- tools/hv/hv_kvp_daemon.c | 166 +-- 1 file changed, 31 insertions(+), 135 deletions(-) diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c

[PATCH RFCv2 04/21] Drivers: hv: fcopy: process deferred messages when we complete the transaction

2015-03-11 Thread Vitaly Kuznetsov
support only the former. Add support for the later, use hv_poll_channel() to do the job. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c index

[PATCH RFCv2 05/21] Drivers: hv: vss: process deferred messages when we complete the transaction

2015-03-11 Thread Vitaly Kuznetsov
support only the former. Add support for the later, use hv_poll_channel() to do the job. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_snapshot.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv

[PATCH RFCv2 06/21] Drivers: hv: kvp: rename kvp_work - kvp_timeout_work

2015-03-11 Thread Vitaly Kuznetsov
'kvp_work' (and kvp_work_func) is a misnomer as it sounds like we expect this useful work to happen and in reality it is just an emergency escape when timeout happens. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_kvp.c | 16 1 file changed, 8 insertions

[PATCH RFCv2 01/21] Drivers: hv: util: move kvp/vss function declarations to hyperv_vmbus.h

2015-03-11 Thread Vitaly Kuznetsov
These declarations are internal to hv_util module and hv_fcopy_* declarations already reside there. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_kvp.c | 1 + drivers/hv/hv_snapshot.c | 2 ++ drivers/hv/hyperv_vmbus.h | 8 include/linux/hyperv.h| 8

[PATCH RFCv2 11/21] Drivers: hv: fcopy: switch to using the hvutil_device_state state machine

2015-03-11 Thread Vitaly Kuznetsov
the userspace daemon is disconnected, otherwise we can make the host think we don't support FCOPY and disable the service completely. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 70 ++- 1 file changed, 30 insertions

[PATCH RFCv2 00/21] Drivers: hv: utils: re-implement the kernel/userspace communication layer

2015-03-11 Thread Vitaly Kuznetsov
or not and this fact can change as there is a way to enable/disable the service from host side. Racy daemon startup is also a problem. - When the userspace daemon restarts/dies kernel part doesn't receive a notification. - Netlink communication is not stable under heavy load. - ... Vitaly Kuznetsov (21

[PATCH RFCv2 02/21] Drivers: hv: kvp: reset kvp_context

2015-03-11 Thread Vitaly Kuznetsov
issues as: 1) Host is supposed to serialize transactions as well 2) If no message is pending vmbus_recvpacket() will return 0 recvlen. This is just a cleanup. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_kvp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hv

[PATCH RFCv2 19/21] Drivers: hv: vss: full handshake support

2015-03-11 Thread Vitaly Kuznetsov
Introduce VSS_OP_REGISTER1 to support kernel replying to the negotiation message with its own version. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_snapshot.c| 49 ++--- include/uapi/linux/hyperv.h | 5 + tools/hv

[PATCH RFCv2 20/21] Drivers: hv: fcopy: full handshake support

2015-03-11 Thread Vitaly Kuznetsov
Introduce FCOPY_VERSION_1 to support kernel replying to the negotiation message with its own version. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 16 +++- include/uapi/linux/hyperv.h | 3 ++- tools/hv/hv_fcopy_daemon.c | 15

[PATCH RFCv2 03/21] Drivers: hv: kvp: move poll_channel() to hyperv_vmbus.h

2015-03-11 Thread Vitaly Kuznetsov
..., make it inline and rename it to hv_poll_channel() so it can be reused in other hv_util modules. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_kvp.c | 17 +++-- drivers/hv/hyperv_vmbus.h | 12 2 files changed, 15 insertions(+), 14

[PATCH RFCv2 13/21] Drivers: hv: util: introduce hv_utils_transport abstraction

2015-03-11 Thread Vitaly Kuznetsov
the switch from netlink to chardev operational mode is supported. Every hv_util daemon is supposed to register 2 callbacks: 1) on_msg() to get notified when the userspace daemon sent a message; 2) on_reset() to get notified when the userspace daemon drops the connection. Signed-off-by: Vitaly Kuznetsov

[PATCH RFCv2 08/21] Drivers: hv: util: introduce state machine for util drivers

2015-03-11 Thread Vitaly Kuznetsov
drivers. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hyperv_vmbus.h | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 177dbec..62efcce 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h

[PATCH RFCv2 12/21] Drivers: hv: fcopy: set .owner reference for file operations

2015-03-11 Thread Vitaly Kuznetsov
... otherwise a crash is observed when hv_utils module is being unloaded while fcopy daemon is still running. .owner gives us an additional reference when someone holds a descriptor for the device. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 6 ++ 1 file

Re: [PATCH RESEND 0/3] memory_hotplug: hyperv: fix deadlock between memory adding and onlining

2015-03-09 Thread Vitaly Kuznetsov
, David's alternative fix is already in -mm: https://lkml.org/lkml/2015/2/12/655 On Thu 12-02-15 11:23:51, Vitaly Kuznetsov wrote: RESEND (with no changes) because Rafael J. Wysocki was missing in recepients. If newly added memory is brought online with e.g. udev rule: SUBSYSTEM==memory, ACTION

Re: Drivers: hv: hv_balloon: eliminate the trylock path in acquire/release_region_mutex

2015-03-05 Thread Vitaly Kuznetsov
Dan Carpenter dan.carpen...@oracle.com writes: Hello Vitaly Kuznetsov, The patch b05d8d9ef5ef: Drivers: hv: hv_balloon: eliminate the trylock path in acquire/release_region_mutex from Feb 28, 2015, leads to the following static checker warning: drivers/hv/hv_balloon.c:669

[PATCH] Drivers: hv: hv_balloon: don't lose memory when onlining order is not natural

2015-03-04 Thread Vitaly Kuznetsov
-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_balloon.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index c5bb872..614347e 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c

Re: [PATCH RFC 1/3] Drivers: hv: kvp: convert userspace/kernel communication to using char device

2015-03-03 Thread Vitaly Kuznetsov
Radim Krčmář rkrc...@redhat.com writes: 2015-02-27 17:14+0100, Vitaly Kuznetsov: Re-implement the communication using misc char device. Use ioctl to do kernel/userspace version negotiation (doesn't make much sense at this moment as we're breaking backwards compatibility but can be used

Re: [PATCH] Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure

2015-03-02 Thread Vitaly Kuznetsov
Vitaly Kuznetsov vkuzn...@redhat.com writes: When add_memory() fails the following BUG is observed: [ 743.646107] hv_balloon: hot_add memory failed error is -17 [ 743.679973] [ 743.680930] = [ 743.680930] [ BUG: bad unlock balance detected

Re: [PATCH RFC 0/3] Drivers: hv: utils: re-implement the kernel/userspace communication layer

2015-03-02 Thread Vitaly Kuznetsov
Radim Krčmář rkrc...@redhat.com writes: 2015-02-27 17:14+0100, Vitaly Kuznetsov: This series converts kvp/vss daemons to use misc char devices instead of netlink for userspace/kernel communication and then updates fcopy to be consistent with kvp/vss. Userspace/kernel communication via

Re: [PATCH RFC 0/3] Drivers: hv: utils: re-implement the kernel/userspace communication layer

2015-03-02 Thread Vitaly Kuznetsov
KY Srinivasan k...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Friday, February 27, 2015 8:14 AM To: KY Srinivasan; de...@linuxdriverproject.org Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui; Radim Krčmář; Greg

[PATCH RFC 2/3] Drivers: hv: vss: convert userspace/kernel communication to using char device

2015-02-27 Thread Vitaly Kuznetsov
backwards compatibility but can be used in future). Read from the device returns struct hv_vss_msg and userspace is supposed to reply with __u32. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_snapshot.c| 335 include/uapi/linux

[PATCH RFC 3/3] Drivers: hv: fcopy: make it consistent with vss/kvp

2015-02-27 Thread Vitaly Kuznetsov
icmsg_hdr.status. - Other minor changes to make drivers code look alike. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_fcopy.c | 395 ++-- include/uapi/linux/hyperv.h | 1 + tools/hv/hv_fcopy_daemon.c | 48 -- 3 files changed

[PATCH RFC 0/3] Drivers: hv: utils: re-implement the kernel/userspace communication layer

2015-02-27 Thread Vitaly Kuznetsov
. - ... RFC: I'm a bit puzzled on how to split commits 1 and 2 avoiding breakages. Commit 3 can definitely be split, however, it is consistent with commits 1 and 2 at this moment and I'm not sure such split will simplify the review. Vitaly Kuznetsov (3): Drivers: hv: kvp: convert userspace/kernel

[PATCH RFC 1/3] Drivers: hv: kvp: convert userspace/kernel communication to using char device

2015-02-27 Thread Vitaly Kuznetsov
backwards compatibility but can be used in future). Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_kvp.c | 396 +++- include/uapi/linux/hyperv.h | 8 + tools/hv/hv_kvp_daemon.c| 187 - 3 files changed, 287

Re: [PATCH 1/2] Drivers: hv: hv_balloon: report offline pages as being used

2015-02-25 Thread Vitaly Kuznetsov
KY Srinivasan k...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Thursday, February 19, 2015 8:27 AM To: KY Srinivasan; de...@linuxdriverproject.org Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui Subject: [PATCH 1/2

[PATCH] Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure

2015-02-20 Thread Vitaly Kuznetsov
and hot_add_req() expects us to as it does unconditional mutex_unlock(). Acquire the lock on the error path. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- This patch is dependent on the previously posted 'Drivers: hv: hv_balloon: eliminate the trylock path in acquire/release_region_mutex

[PATCH 0/2] Drivers: hv: hv_balloon: avoid OOM killer on the ballooning path

2015-02-19 Thread Vitaly Kuznetsov
; - Avoid ballooning below the 'floor'. Vitaly Kuznetsov (2): Drivers: hv: hv_balloon: report offline pages as being used Drivers: hv: hv_balloon: refuse to balloon below the floor drivers/hv/hv_balloon.c | 44 +++- 1 file changed, 35 insertions(+), 9

[PATCH 2/2] Drivers: hv: hv_balloon: refuse to balloon below the floor

2015-02-19 Thread Vitaly Kuznetsov
When host asks us to balloon up we need to be sure we're not committing suicide by overballooning. Use already existent 'floor' metric as our lowest possible value for free ram. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_balloon.c | 11 +++ 1 file changed, 11

[PATCH 1/2] Drivers: hv: hv_balloon: report offline pages as being used

2015-02-19 Thread Vitaly Kuznetsov
track of all online/offline operations and report all currently offline pages as being used so host won't try to balloon them out. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_balloon.c | 33 - 1 file changed, 24 insertions(+), 9 deletions

[PATCH v2] Drivers: hv: hv_balloon: eliminate the trylock path in acquire/release_region_mutex

2015-02-18 Thread Vitaly Kuznetsov
see this issue often because we have 5sec onlining timeout in hv_mem_hot_add() and usually all udev events arrive in this time frame. Get rid of the trylock path, waiting on the mutex is supposed to provide the required serialization. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- Changes

[PATCH] Drivers: hv: hv_balloon: eliminate the trylock path in acquire/release_region_mutex

2015-02-17 Thread Vitaly Kuznetsov
see this issue often because we have 5sec onlining timeout in hv_mem_hot_add() and usually all udev events arrive in this time frame. Get rid of the trylock path, waiting on the mutex is supposed to provide the required serialization. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers

Re: [PATCH 0/3] memory_hotplug: hyperv: fix deadlock between memory adding and onlining

2015-02-12 Thread Vitaly Kuznetsov
David Rientjes rient...@google.com writes: On Wed, 11 Feb 2015, Vitaly Kuznetsov wrote: If newly added memory is brought online with e.g. udev rule: SUBSYSTEM==memory, ACTION==add, ATTR{state}=online the following deadlock is observed (and easily reproducable): First participant, worker

Re: [PATCH 1/3] driver core: export lock_device_hotplug/unlock_device_hotplug

2015-02-12 Thread Vitaly Kuznetsov
Rafael J. Wysocki r...@rjwysocki.net writes: On Wednesday, February 11, 2015 12:39:47 PM Andrew Morton wrote: On Wed, 11 Feb 2015 16:44:20 +0100 Vitaly Kuznetsov vkuzn...@redhat.com wrote: add_memory() is supposed to be run with device_hotplug_lock grabbed, otherwise it can race

[PATCH RESEND 0/3] memory_hotplug: hyperv: fix deadlock between memory adding and onlining

2015-02-12 Thread Vitaly Kuznetsov
the change we need to export lock_device_hotplug/ unlock_device_hotplug. This approach can be completely wrong though. Vitaly Kuznetsov (3): driver core: export lock_device_hotplug/unlock_device_hotplug memory_hotplug: add note about holding device_hotplug_lock and add_memory() Drivers: hv

[PATCH RESEND 2/3] memory_hotplug: add note about holding device_hotplug_lock and add_memory()

2015-02-12 Thread Vitaly Kuznetsov
add_memory() is supposed to be run with device_hotplug_lock grabbed, otherwise it can race with e.g. device_online(). ACPI memory hotplug does that already but e.g. Hyper-V ballooning driver doesn't. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- mm/memory_hotplug.c | 6 +- 1 file

[PATCH RESEND 1/3] driver core: export lock_device_hotplug/unlock_device_hotplug

2015-02-12 Thread Vitaly Kuznetsov
add_memory() is supposed to be run with device_hotplug_lock grabbed, otherwise it can race with e.g. device_online(). Allow external modules (hv_balloon for now) to lock device hotplug. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/base/core.c | 2 ++ 1 file changed, 2

[PATCH RESEND 3/3] Drivers: hv: balloon: fix deadlock between memory adding and onlining

2015-02-12 Thread Vitaly Kuznetsov
will eventually succeed. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_balloon.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index b958ded..0af1aa2 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv

Re: [PATCH 0/3] memory_hotplug: hyperv: fix deadlock between memory adding and onlining

2015-02-12 Thread Vitaly Kuznetsov
David Rientjes rient...@google.com writes: On Wed, 11 Feb 2015, David Rientjes wrote: If newly added memory is brought online with e.g. udev rule: SUBSYSTEM==memory, ACTION==add, ATTR{state}=online the following deadlock is observed (and easily reproducable): First participant,

Re: [PATCH RESEND 0/3] memory_hotplug: hyperv: fix deadlock between memory adding and onlining

2015-02-12 Thread Vitaly Kuznetsov
KY Srinivasan k...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Thursday, February 12, 2015 2:24 AM To: linux-ker...@vger.kernel.org Cc: Greg Kroah-Hartman; KY Srinivasan; Haiyang Zhang; Andrew Morton; Yasuaki Ishimatsu; Tang

[PATCH 2/3] memory_hotplug: add note about holding device_hotplug_lock and add_memory()

2015-02-11 Thread Vitaly Kuznetsov
add_memory() is supposed to be run with device_hotplug_lock grabbed, otherwise it can race with e.g. device_online(). ACPI memory hotplug does that already but e.g. Hyper-V ballooning driver doesn't. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- mm/memory_hotplug.c | 6 +- 1 file

[PATCH 3/3] Drivers: hv: balloon: fix deadlock between memory adding and onlining

2015-02-11 Thread Vitaly Kuznetsov
will eventually succeed. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_balloon.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index b958ded..0af1aa2 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv

[PATCH 1/3] driver core: export lock_device_hotplug/unlock_device_hotplug

2015-02-11 Thread Vitaly Kuznetsov
add_memory() is supposed to be run with device_hotplug_lock grabbed, otherwise it can race with e.g. device_online(). Allow external modules (hv_balloon for now) to lock device hotplug. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/base/core.c | 2 ++ 1 file changed, 2

Re: [PATCH v2 1/1] drivers:hv:vmbus drivers:hv:vmbus Allow for more than one MMIO range for children

2015-02-06 Thread Vitaly Kuznetsov
that contains all those ranges. Without this change, only some of the memory-mapped I/O space will be available for child devices, and only in some virtual BIOS configurations (Generation 2 VMs). This patch has been updated with feedback from Vitaly Kuznetsov. Cleanup is now driven by the acpi remove

Re: [PATCH 0/4] Drivers: hv: Further protection for the rescind path

2015-02-05 Thread Vitaly Kuznetsov
KY Srinivasan k...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Tuesday, February 3, 2015 9:01 AM To: KY Srinivasan; de...@linuxdriverproject.org Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui; Jason Wang Subject

Re: [PATCH net-next v2] hyper-v: allow access to vmbus from userspace driver

2015-02-05 Thread Vitaly Kuznetsov
Stephen Hemminger step...@networkplumber.org writes: This is enables the hyper-v driver for DPDK d...@dpdk.org. The hv_uio driver needs to access the shared vmbus monitor pages. Why can't we just make vmbus_connection struct public? I would also like to put hv_uio in upstream kernel like

Re: [PATCH 1/4] Drivers: hv: vmbus: implement get/put usage workflow for vmbus channels

2015-02-04 Thread Vitaly Kuznetsov
Jason Wang jasow...@redhat.com writes: On Wed, Feb 4, 2015 at 1:00 AM, Vitaly Kuznetsov vkuzn...@redhat.com wrote: free_channel() function frees the channel unconditionally so we need to make sure nobody has any link to it. This is not trivial and there are several examples of races we

Re: [PATCH 1/4] Drivers: hv: vmbus: implement get/put usage workflow for vmbus channels

2015-02-04 Thread Vitaly Kuznetsov
Dexuan Cui de...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Wednesday, February 4, 2015 1:01 AM To: KY Srinivasan; de...@linuxdriverproject.org Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui; Jason Wang Subject

[PATCH 2/4] Drivers: hv: vmbus: do not lose rescind offer on failure in vmbus_process_offer()

2015-02-03 Thread Vitaly Kuznetsov
list_del in vmbus_process_rescind_offer() hitting an uninitialized list. Reported-by: Dexuan Cui de...@microsoft.com Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/channel_mgmt.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 1/4] Drivers: hv: vmbus: implement get/put usage workflow for vmbus channels

2015-02-03 Thread Vitaly Kuznetsov
of free_channel(). Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/channel_mgmt.c | 45 ++--- drivers/hv/connection.c | 7 +-- drivers/hv/hyperv_vmbus.h | 4 include/linux/hyperv.h| 13 + 4 files changed, 60

[PATCH 3/4] Drivers: hv: vmbus: protect vmbus_get_outgoing_channel() against channel removal

2015-02-03 Thread Vitaly Kuznetsov
vmbus_get_outgoing_channel() search holding primary-lock as child channels are not being freed unless they're removed from parent's list. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/channel_mgmt.c | 10 +++--- drivers/scsi/storvsc_drv.c | 2 ++ 2 files changed, 9 insertions

[PATCH 4/4] hyperv: netvsc: improve protection against rescind offer

2015-02-03 Thread Vitaly Kuznetsov
jasow...@redhat.com Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/net/hyperv/netvsc.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 9f49c01..d9b13a1 100644 --- a/drivers/net/hyperv

[PATCH 0/4] Drivers: hv: Further protection for the rescind path

2015-02-03 Thread Vitaly Kuznetsov
., Haiyang, I'm not sending this series to netdev@ and linux-scsi@ as it is supposed to be applied as a whole, please resend these patches with your sign-offs when (and if) we're done with reviews. Thanks! Vitaly Kuznetsov (4): Drivers: hv: vmbus: implement get/put usage workflow for vmbus channels

Re: [PATCH 2/3] hv: vmbus_post_msg: retry the hypercall on HV_STATUS_INVALID_CONNECTION_ID

2015-01-30 Thread Vitaly Kuznetsov
Dexuan Cui de...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Thursday, January 29, 2015 21:31 PM To: Dexuan Cui Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; driverdev- de...@linuxdriverproject.org; o

Re: [PATCH 2/3 v3] hyperv: hyperv_fb.c: match wait_for_completion_timeout return type

2015-01-29 Thread Vitaly Kuznetsov
-by: Vitaly Kuznetsov vkuzn...@redhat.com --- v2: fixed subject line v3: fixed patch description as recommended by Dan Carpenter dan.carpen...@oracle.com Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y CONFIG_HYPERV=m, CONFIG_FB_HYPERV=m Patch is against 3.19.0

Re: [PATCH 2/3] hv: vmbus_post_msg: retry the hypercall on HV_STATUS_INVALID_CONNECTION_ID

2015-01-29 Thread Vitaly Kuznetsov
Dexuan Cui de...@microsoft.com writes: I got the hypercall error code on Hyper-V 2008 R2 when keeping running rmmod hv_netvsc; modprobe hv_netvsc; rmmod hv_utils; modprobe hv_utils in a Linux guest. Without the patch, the driver can occasionally fail to load. CC: K. Y. Srinivasan

Re: [PATCH 1/3] hv: hv_util: move vmbus_open() to a later place

2015-01-29 Thread Vitaly Kuznetsov
...@microsoft.com Signed-off-by: Dexuan Cui de...@microsoft.com It is not said in the description but moving hv_set_drvdata() before vmbus_open() make sense in case probe and remove can collide (can they?). Reviewed-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv_util.c | 11

Re: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind offer

2015-01-28 Thread Vitaly Kuznetsov
Dexuan Cui de...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Tuesday, January 20, 2015 23:45 PM To: KY Srinivasan; de...@linuxdriverproject.org Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui; Jason Wang; Radim

Re: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind offer

2015-01-28 Thread Vitaly Kuznetsov
Dexuan Cui de...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Wednesday, January 28, 2015 20:09 PM To: Dexuan Cui Cc: KY Srinivasan; de...@linuxdriverproject.org; Haiyang Zhang; linux- ker...@vger.kernel.org; Jason Wang; Radim

[PATCH v2 4/5] clockevents: export clockevents_unbind_device instead of clockevents_unbind

2015-01-27 Thread Vitaly Kuznetsov
. This is going to be used to teardown Hyper-V clockevent devices on module unload. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- kernel/time/clockevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 5544990

[PATCH v2 3/5] drivers: hv: Teardown synthetic interrupt controllers on module unload

2015-01-27 Thread Vitaly Kuznetsov
the following: - call hv_synic_cleanup() on each cpu from vmbus_exit(); - write global disable bit through MSR; - use hv_synic_free_cpu() to avoid memory leask and code duplication. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/hv.c| 9 +++-- drivers/hv/vmbus_drv.c | 4

[PATCH v2 0/5] Drivers: hv: vmbus: fix crashes on hv_vmbus load/unload path

2015-01-27 Thread Vitaly Kuznetsov
] Rebooting in 30 seconds.. [ 204.846675] ACPI MEMORY or I/O RESET_REG. Vitaly Kuznetsov (5): Drivers: hv: vmbus: avoid double kfree for device_obj Drivers: hv: vmbus: teardown hv_vmbus_con workqueue and vmbus_connection pages on shutdown drivers: hv: Teardown synthetic interrupt controllers

[PATCH v2 1/5] Drivers: hv: vmbus: avoid double kfree for device_obj

2015-01-27 Thread Vitaly Kuznetsov
to load hv_vmbus again. Remove kfree from vmbus_free_channels() as freeing it from vmbus_device_release() seems right. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/channel_mgmt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv

Re: [PATCH 0/3] Drivers: hv: vmbus: fix crashes on hv_vmbus load/unload path

2015-01-26 Thread Vitaly Kuznetsov
Vitaly Kuznetsov vkuzn...@redhat.com writes: It is possible (since 93e5bd06a953: Drivers: hv: Make the vmbus driver unloadable) to unload hv_vmbus driver if no other devices are connected. 1aec169673d7: x86: Hyperv: Cleanup the irq mess fixed doulble interrupt gate setup. However, if we try

Re: [PATCH RESEND 1/5] Tools: hv: add mising fcopyd to the Makefile

2015-01-26 Thread Vitaly Kuznetsov
Greg KH gre...@linuxfoundation.org writes: On Fri, Jan 09, 2015 at 10:18:51PM -0800, K. Y. Srinivasan wrote: From: Vitaly Kuznetsov vkuzn...@redhat.com fcopyd in missing in the Makefile, add it there. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com Signed-off-by: K. Y. Srinivasan k

Re: [PATCH v3] Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors

2015-01-26 Thread Vitaly Kuznetsov
Greg Kroah-Hartman gre...@linuxfoundation.org writes: On Mon, Jan 12, 2015 at 05:50:11PM +0100, Vitaly Kuznetsov wrote: When an SMP Hyper-V guest is running on top of 2012R2 Server and secondary cpus are sent offline (with echo 0 /sys/devices/system/cpu/cpu$cpu/online) the system freeze

Re: [PATCH 2/3] Drivers: hv: vmbus: introduce vmbus_acpi_remove

2015-01-23 Thread Vitaly Kuznetsov
KY Srinivasan k...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Wednesday, January 21, 2015 11:02 AM To: KY Srinivasan; de...@linuxdriverproject.org Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui Subject: [PATCH 2/3

Re: [PATCH 1/1] drivers:hv:vmbus Allow for more than one MMIO range for children.

2015-01-23 Thread Vitaly Kuznetsov
Jake Oshins ja...@microsoft.com writes: Signed-off-by: Jake Oshins ja...@microsoft.com --- drivers/hv/vmbus_drv.c | 85 + drivers/video/fbdev/hyperv_fb.c | 2 +- include/linux/hyperv.h | 2 +- 3 files changed, 72 insertions(+),

[PATCH] Drivers: hv: vmbus: rename channel work queues

2015-01-22 Thread Vitaly Kuznetsov
-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/channel_mgmt.c | 5 - drivers/hv/vmbus_drv.c| 6 ++ include/linux/hyperv.h| 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 0141a3d..b7be96f

[PATCH 0/3] Drivers: hv: vmbus: fix crashes on hv_vmbus load/unload path

2015-01-21 Thread Vitaly Kuznetsov
) [ 204.846675] Rebooting in 30 seconds.. [ 204.846675] ACPI MEMORY or I/O RESET_REG. Vitaly Kuznetsov (3): Drivers: hv: vmbus: avoid double kfree for device_obj Drivers: hv: vmbus: introduce vmbus_acpi_remove Drivers: hv: vmbus: teardown hv_vmbus_con workqueue and vmbus_connection pages on shutdown

[PATCH 1/3] Drivers: hv: vmbus: avoid double kfree for device_obj

2015-01-21 Thread Vitaly Kuznetsov
to load hv_vmbus again. Remove kfree from vmbus_free_channels() as freeing it from vmbus_device_release() seems right. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/channel_mgmt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv

[PATCH 2/3] Drivers: hv: vmbus: introduce vmbus_acpi_remove

2015-01-21 Thread Vitaly Kuznetsov
] [8107dc5f] __request_resource+0x2f/0x50 [ 38.166315] RSP: 0018:88003f60fb58 EFLAGS: 00010286 ... Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- drivers/hv/vmbus_drv.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index

<    4   5   6   7   8   9   10   >