Re: [PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING

2015-03-09 Thread Rusty Russell
Thomas Huth writes: > On Wed, 25 Feb 2015 16:11:27 +0100 > Cornelia Huck wrote: > >> On Wed, 25 Feb 2015 15:36:02 +0100 >> "Michael S. Tsirkin" wrote: >> >> > virtio balloon has this code: >> > wait_event_interruptible(vb->config_change, >> > (diff = tow

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-09 Thread Rusty Russell
t you unlearn that fact. >> > >> The fix for this is in two parts: >> > >> >> > >> 1) Annotate using sched_annotate_sleep() and add a comment: we may spin >> > >>a few times in low memory situations, but this isn't a high >> > >

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-06 Thread Cornelia Huck
hed_annotate_sleep() and add a comment: we may spin > > >>a few times in low memory situations, but this isn't a high > > >>performance path. > > >> > > >> 2) Handle get_config (and other) failure in some more elegant way. > > >>

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-06 Thread Cornelia Huck
On Mon, 2 Mar 2015 21:44:10 +0100 "Michael S. Tsirkin" wrote: > > > Normally, hotunplug requires guest cooperation. > > > IOW unplug request should send guest interrupt, > > > then block until guest confirms it's not using the > > > device anymore. > > > virtio pci already handles that fine, can

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-04 Thread Michael S. Tsirkin
in some more elegant way. > >> > >> Cheers, > >> Rusty. > > > > I agree, but I'd like to point out that even without kmalloc, > > on s390 get_config is blocking - it's waiting > > for a hardware interrupt. > > > > And it makes

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-04 Thread Rusty Russell
h >>performance path. >> >> 2) Handle get_config (and other) failure in some more elegant way. >> >> Cheers, >> Rusty. > > I agree, but I'd like to point out that even without kmalloc, > on s390 get_config is blocking - it's waiting > f

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Michael S. Tsirkin
On Mon, Mar 02, 2015 at 01:35:05PM +0100, Cornelia Huck wrote: > On Mon, 2 Mar 2015 13:19:43 +0100 > "Michael S. Tsirkin" wrote: > > > On Mon, Mar 02, 2015 at 01:11:02PM +0100, Cornelia Huck wrote: > > > On Mon, 2 Mar 2015 12:46:57 +0100 > > > "Michael S. Tsirkin" wrote: > > > > > > > On Mon, M

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Michael S. Tsirkin
On Mon, Mar 02, 2015 at 01:11:02PM +0100, Cornelia Huck wrote: > On Mon, 2 Mar 2015 12:46:57 +0100 > "Michael S. Tsirkin" wrote: > > > On Mon, Mar 02, 2015 at 12:31:06PM +0100, Cornelia Huck wrote: > > > On Mon, 2 Mar 2015 12:13:58 +0100 > > > "Michael S. Tsirkin" wrote: > > > > > > > On Mon, M

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Cornelia Huck
On Mon, 2 Mar 2015 13:19:43 +0100 "Michael S. Tsirkin" wrote: > On Mon, Mar 02, 2015 at 01:11:02PM +0100, Cornelia Huck wrote: > > On Mon, 2 Mar 2015 12:46:57 +0100 > > "Michael S. Tsirkin" wrote: > > > > > On Mon, Mar 02, 2015 at 12:31:06PM +0100, Cornelia Huck wrote: > > > > On Mon, 2 Mar 201

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Michael S. Tsirkin
On Mon, Mar 02, 2015 at 01:11:02PM +0100, Cornelia Huck wrote: > On Mon, 2 Mar 2015 12:46:57 +0100 > "Michael S. Tsirkin" wrote: > > > On Mon, Mar 02, 2015 at 12:31:06PM +0100, Cornelia Huck wrote: > > > On Mon, 2 Mar 2015 12:13:58 +0100 > > > "Michael S. Tsirkin" wrote: > > > > > > > On Mon, M

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Cornelia Huck
On Mon, 2 Mar 2015 12:46:57 +0100 "Michael S. Tsirkin" wrote: > On Mon, Mar 02, 2015 at 12:31:06PM +0100, Cornelia Huck wrote: > > On Mon, 2 Mar 2015 12:13:58 +0100 > > "Michael S. Tsirkin" wrote: > > > > > On Mon, Mar 02, 2015 at 10:37:26AM +1030, Rusty Russell wrote: > > > > Thomas Huth writ

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Michael S. Tsirkin
kmalloc on get_config. Why is it doing these allocs? What's wrong with using vcdev->config directly? > > > > > > Cheers, > > > Rusty. > > > > I agree, but I'd like to point out that even without kmalloc, > > on s390 get_config is blocking

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Cornelia Huck
? I agree with that. > > > > Cheers, > > Rusty. > > I agree, but I'd like to point out that even without kmalloc, > on s390 get_config is blocking - it's waiting > for a hardware interrupt. > > And it makes sense: config is not data path, I don'

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Michael S. Tsirkin
I agree, but I'd like to point out that even without kmalloc, on s390 get_config is blocking - it's waiting for a hardware interrupt. And it makes sense: config is not data path, I don't think we should spin there. So I think besides these two parts, we still need my two patches: v

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Rusty Russell
Thomas Huth writes: > On Thu, 26 Feb 2015 11:50:42 +1030 > Rusty Russell wrote: > >> Thomas Huth writes: >> > Hi all, >> > >> > with the recent kernel 3.19, I get a kernel warning when I start my >> > KVM guest on s390 with virtio balloon enabled: >> >> The deeper problem is that virtio_ccw_ge

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-26 Thread Michael S. Tsirkin
fer > > > solution for 4.0/3.19, no? > > > > I've no idea what your patch was since I'm not subscribed to any of the > > lists this discussion is had on. > > Oh, sorry about that. > Here it is, below: > > ----- Forwarded message from "M

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-26 Thread Michael S. Tsirkin
ow: - Forwarded message from "Michael S. Tsirkin" - Date: Wed, 25 Feb 2015 15:36:02 +0100 From: "Michael S. Tsirkin" To: linux-ker...@vger.kernel.org Cc: sta...@vger.kernel.org, Thomas Huth , Rusty Russell , virtualizat...@lists.linux-fo

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-26 Thread Peter Zijlstra
On Thu, Feb 26, 2015 at 09:30:31AM +0100, Michael S. Tsirkin wrote: > On Thu, Feb 26, 2015 at 11:50:42AM +1030, Rusty Russell wrote: > > Thomas Huth writes: > > > Hi all, > > > > > > with the recent kernel 3.19, I get a kernel warning when I start my > > > KVM guest on s390 with virtio balloon en

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-26 Thread Cornelia Huck
On Thu, 26 Feb 2015 09:45:29 +0100 "Michael S. Tsirkin" wrote: > On Thu, Feb 26, 2015 at 11:50:42AM +1030, Rusty Russell wrote: > > Thomas Huth writes: > > > Hi all, > > > > > > with the recent kernel 3.19, I get a kernel warning when I start my > > > KVM guest on s390 with virtio balloon enabl

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-26 Thread Cornelia Huck
On Thu, 26 Feb 2015 11:50:42 +1030 Rusty Russell wrote: > Thomas Huth writes: > > Hi all, > > > > with the recent kernel 3.19, I get a kernel warning when I start my > > KVM guest on s390 with virtio balloon enabled: > > The deeper problem is that virtio_ccw_get_config just silently fails on >

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-26 Thread Michael S. Tsirkin
On Thu, Feb 26, 2015 at 11:50:42AM +1030, Rusty Russell wrote: > Thomas Huth writes: > > Hi all, > > > > with the recent kernel 3.19, I get a kernel warning when I start my > > KVM guest on s390 with virtio balloon enabled: > > The deeper problem is that virtio_ccw_get_config just silently fails

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-26 Thread Michael S. Tsirkin
On Thu, Feb 26, 2015 at 11:50:42AM +1030, Rusty Russell wrote: > Thomas Huth writes: > > Hi all, > > > > with the recent kernel 3.19, I get a kernel warning when I start my > > KVM guest on s390 with virtio balloon enabled: > > The deeper problem is that virtio_ccw_get_config just silently fails

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Thomas Huth
On Thu, 26 Feb 2015 11:50:42 +1030 Rusty Russell wrote: > Thomas Huth writes: > > Hi all, > > > > with the recent kernel 3.19, I get a kernel warning when I start my > > KVM guest on s390 with virtio balloon enabled: > > The deeper problem is that virtio_ccw_get_config just silently fails on >

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Rusty Russell
Thomas Huth writes: > Hi all, > > with the recent kernel 3.19, I get a kernel warning when I start my > KVM guest on s390 with virtio balloon enabled: The deeper problem is that virtio_ccw_get_config just silently fails on OOM. Neither get_config nor set_config are expected to fail. Cornelia,

Re: [PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Thomas Huth
On Wed, 25 Feb 2015 16:11:27 +0100 Cornelia Huck wrote: > On Wed, 25 Feb 2015 15:36:02 +0100 > "Michael S. Tsirkin" wrote: > > > virtio balloon has this code: > > wait_event_interruptible(vb->config_change, > > (diff = towards_target(vb)) != 0 > >

Re: [PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Cornelia Huck
On Wed, 25 Feb 2015 15:36:02 +0100 "Michael S. Tsirkin" wrote: > virtio balloon has this code: > wait_event_interruptible(vb->config_change, > (diff = towards_target(vb)) != 0 > || vb->need_stats_update >

[PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Michael S. Tsirkin
virtio balloon has this code: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() ||

Re: [PATCH] virtio-balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Michael S. Tsirkin
On Wed, Feb 25, 2015 at 03:32:08PM +0100, Cornelia Huck wrote: > On Wed, 25 Feb 2015 15:14:36 +0100 > "Michael S. Tsirkin" wrote: > > > virtio balloon has this code: > > wait_event_interruptible(vb->config_change, > > (diff = towards_target(vb)) != 0 > >

Re: [PATCH] virtio-balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Cornelia Huck
On Wed, 25 Feb 2015 15:14:36 +0100 "Michael S. Tsirkin" wrote: > virtio balloon has this code: > wait_event_interruptible(vb->config_change, > (diff = towards_target(vb)) != 0 > || vb->need_stats_update >

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Michael S. Tsirkin
On Wed, Feb 25, 2015 at 11:13:18AM +0100, Thomas Huth wrote: > > Hi all, > > with the recent kernel 3.19, I get a kernel warning when I start my > KVM guest on s390 with virtio balloon enabled: > > [0.839687] do not call blocking ops when !TASK_RUNNING; state=1 set at >[<000

[PATCH] virtio-balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Michael S. Tsirkin
virtio balloon has this code: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() ||

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Cornelia Huck
On Wed, 25 Feb 2015 11:13:18 +0100 Thomas Huth wrote: > > Hi all, > > with the recent kernel 3.19, I get a kernel warning when I start my > KVM guest on s390 with virtio balloon enabled: > > [0.839687] do not call blocking ops when !TASK_RUNNING; state=1 set at >[<

virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Thomas Huth
Hi all, with the recent kernel 3.19, I get a kernel warning when I start my KVM guest on s390 with virtio balloon enabled: [0.839687] do not call blocking ops when !TASK_RUNNING; state=1 set at [<00174a1e>] prepare_to_wait_event+0x7e/0x108 [0.839694] [