From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E25D4C43387 for ; Fri, 4 Jan 2019 11:02:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9B5F206C0 for ; Fri, 4 Jan 2019 11:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727496AbfADLC6 (ORCPT ); Fri, 4 Jan 2019 06:02:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42446 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbfADLC6 (ORCPT ); Fri, 4 Jan 2019 06:02:58 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E3F5BC0669D2; Fri, 4 Jan 2019 11:02:57 +0000 (UTC) Received: from gondolin (dhcp-192-187.str.redhat.com [10.33.192.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 112E918503; Fri, 4 Jan 2019 11:02:53 +0000 (UTC) Date: Fri, 4 Jan 2019 12:02:51 +0100 From: Cornelia Huck To: Wei Wang Cc: virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, mst@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, pbonzini@redhat.com, dgilbert@redhat.com Subject: Re: [PATCH v2 1/2] virtio-balloon: tweak config_changed implementation Message-ID: <20190104120251.2a6c0ac1.cohuck@redhat.com> In-Reply-To: <1546585913-34804-2-git-send-email-wei.w.wang@intel.com> References: <1546585913-34804-1-git-send-email-wei.w.wang@intel.com> <1546585913-34804-2-git-send-email-wei.w.wang@intel.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 04 Jan 2019 11:02:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 4 Jan 2019 15:11:52 +0800 Wei Wang wrote: > virtio-ccw has deadlock issues with reading the config space inside the > interrupt context, so we tweak the virtballoon_changed implementation > by moving the config read operations into the related workqueue contexts. > The config_read_bitmap is used as a flag to the workqueue callbacks > about the related config fields that need to be read. > > Reported-by: Christian Borntraeger > Signed-off-by: Wei Wang > --- > drivers/virtio/virtio_balloon.c | 81 +++++++++++++++++++++++++++-------------- > 1 file changed, 53 insertions(+), 28 deletions(-) > (...) > @@ -77,6 +81,8 @@ struct virtio_balloon { > /* Prevent updating balloon when it is being canceled. */ > spinlock_t stop_update_lock; > bool stop_update; > + /* Bitmap to indicate if reading the related config fields are needed */ s/are/is/ > + unsigned long config_read_bitmap; > > /* The list of allocated free pages, waiting to be given back to mm */ > struct list_head free_page_list; (...) Bitmap handling looks sane to me. Reviewed-by: Cornelia Huck