From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752291AbbLDNiQ (ORCPT ); Fri, 4 Dec 2015 08:38:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:42750 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751328AbbLDNiP (ORCPT ); Fri, 4 Dec 2015 08:38:15 -0500 From: Petr Mladek To: Rusty Russell , "Michael S. Tsirkin" Cc: Jeff Epler , Tejun Heo , Jiri Kosina , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH v4 0/2] virtio_balloon: Fix restore and convert to workqueue Date: Fri, 4 Dec 2015 14:37:49 +0100 Message-Id: <1449236271-10133-1-git-send-email-pmladek@suse.com> X-Mailer: git-send-email 1.8.5.6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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