[PATCH v4 0/2] virtio_balloon: Fix restore and convert to workqueue

From: Petr Mladek
Date: Fri Dec 04 2015 - 08:38:18 EST


It has been long since I have sent v3 of the balloon conversion from
a kthread to a workqueue. I have gained some more experience with
the APIs in the meantime. I hope that you would like the outcome.

I have added one more patch that fixes a separate problem with
restoring the balloon after the system freeze. I have found this
when testing the conversion.

Changes against v3:

+ rebased on 4.4-rc3

+ call cancel_work_synch() when removing the balloon

+ do not queue the work from fill_balloon() and leak_balloon()
because they are called also independently from the workqueue,
e.g. remove_common(), virtballoon_oom_notify(). Re-queue
the work from the work function when necessary.


Changes against v2:

+ Use system_freezable_wq instead of an allocated one
and move INIT_WORK() higher in virtballoon_probe().

+ Fix typos in the commit message.


Changes against v1:

+ More elegant detection of the pending work in fill_balloon() and
leak_balloon(). It still needs to keep the original requested number
of pages but it does not add any extra boolean variable.

+ Remove WQ_MEM_RECLAIM workqueue parameter. If I get it correctly,
this is possible because the code manipulates memory but it is not
used in the memory reclaim path.

+ initialize the work item before allocation the workqueue

JFYI, the discussion about the previous version can be found at
http://thread.gmane.org/gmane.linux.kernel.virtualization/23701

Petr Mladek (2):
virtio_balloon: Restore the entire balloon after the system freeze
virtio_balloon: Use a workqueue instead of "vballoon" kthread

drivers/virtio/virtio_balloon.c | 93 ++++++++++++++++-------------------------
1 file changed, 35 insertions(+), 58 deletions(-)

--
1.8.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/