Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1868959ybi; Wed, 17 Jul 2019 23:26:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzT2ly9O01BarfOrI7a4HMaIdrvbRPgn9ErOtr6w+Bbtv7OBo85cl78crhmU5lNGGwqXuC+ X-Received: by 2002:a63:1020:: with SMTP id f32mr15054851pgl.203.1563431213513; Wed, 17 Jul 2019 23:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563431213; cv=none; d=google.com; s=arc-20160816; b=ov7rP4Q9wcIhsViN0hLKBM4Qq629l7iXkixICLhpDyuO8L7rU1/jFudmE2zI2bjoJN rPQuAjG3NipWSnDt8ImgeeN5ibVcnvgmGe21JOQ48dU93cl2s7QWqAb25JooDj1/22ZK j5lCWWfuDyn8PHPEwIAgvqdbKXoTWtlukuVuNRSDXyZhfDhP6xbwWf2odiBkh7Cf0T9h dX8xV2w8gMMVmwJxdw9sXryjdLR49plQeeZNrR1Uybn26Bjou0poi2wSep3dJeUJxT3e j8f6Xhab7JQKLTP6uUM0o9Nc4xvie8TdW8W11RkNvdZxXV556SWcY9u8WexX15ONiRs8 Ydjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=W7fGW4+0kAy8IByT1Si76j62yb2bJq44j2advhe1ySg=; b=Go9ipSzqEd2qjEZMbItuNrTJVU+V11XM+S+NX1KByt4k1/KrkhNRdlCxFJ+4CMIr7N kkhn+HbkleJ5yLDy5eEhorUzqWysjlj3YgBvsLOfqqTbJnYBGBnoaPkdCJx/99XL7yOO q097zHqMc4O32HolFyP2WIp2jX6wZMWirsZ3dZEhe7Xuogwk9QiLeuVDSbLSP5jldIq9 3L2Qj4xF3SEQ+kNakExEoXR1579hlCIHss0A7qB5qMFF3yraTGD6UsspNlSIr34i3Fgm dAy0xfXHzojhthgAEPsvmMKHlTfFxluAwzitXAWh8ke7gD1csHL/qRY/RAFRWye3innh j5Jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si27966677pgb.245.2019.07.17.23.26.36; Wed, 17 Jul 2019 23:26:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387777AbfGRGZn (ORCPT + 99 others); Thu, 18 Jul 2019 02:25:43 -0400 Received: from mga09.intel.com ([134.134.136.24]:1706 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727496AbfGRGZn (ORCPT ); Thu, 18 Jul 2019 02:25:43 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 23:25:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,276,1559545200"; d="scan'208";a="191506532" Received: from unknown (HELO [10.239.13.7]) ([10.239.13.7]) by fmsmga004.fm.intel.com with ESMTP; 17 Jul 2019 23:25:39 -0700 Message-ID: <5D301232.7080808@intel.com> Date: Thu, 18 Jul 2019 14:31:14 +0800 From: Wei Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Michael S. Tsirkin" CC: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, xdeguillard@vmware.com, namit@vmware.com, akpm@linux-foundation.org, pagupta@redhat.com, riel@surriel.com, dave.hansen@intel.com, david@redhat.com, konrad.wilk@oracle.com, yang.zhang.wz@gmail.com, nitesh@redhat.com, lcapitulino@redhat.com, aarcange@redhat.com, pbonzini@redhat.com, alexander.h.duyck@linux.intel.com, dan.j.williams@intel.com Subject: Re: [PATCH v1] mm/balloon_compaction: avoid duplicate page removal References: <1563416610-11045-1-git-send-email-wei.w.wang@intel.com> <20190718001605-mutt-send-email-mst@kernel.org> In-Reply-To: <20190718001605-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/18/2019 12:31 PM, Michael S. Tsirkin wrote: > On Thu, Jul 18, 2019 at 10:23:30AM +0800, Wei Wang wrote: >> Fixes: 418a3ab1e778 (mm/balloon_compaction: List interfaces) >> >> A #GP is reported in the guest when requesting balloon inflation via >> virtio-balloon. The reason is that the virtio-balloon driver has >> removed the page from its internal page list (via balloon_page_pop), >> but balloon_page_enqueue_one also calls "list_del" to do the removal. > I would add here "this is necessary when it's used from > balloon_page_enqueue_list but not when it's called > from balloon_page_enqueue". > >> So remove the list_del in balloon_page_enqueue_one, and have the callers >> do the page removal from their own page lists. >> >> Signed-off-by: Wei Wang > Patch is good but comments need some work. > >> --- >> mm/balloon_compaction.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c >> index 83a7b61..1a5ddc4 100644 >> --- a/mm/balloon_compaction.c >> +++ b/mm/balloon_compaction.c >> @@ -11,6 +11,7 @@ >> #include >> #include >> >> +/* Callers ensure that @page has been removed from its original list. */ > This comment does not make sense. E.g. balloon_page_enqueue > does nothing to ensure this. And drivers are not supposed > to care how the page lists are managed. Pls drop. > > Instead please add the following to balloon_page_enqueue: > > > Note: drivers must not call balloon_page_list_enqueue on Probably, you meant balloon_page_enqueue here. The description for balloon_page_enqueue also seems incorrect: "allocates a new page and inserts it into the balloon page list." This function doesn't do any allocation itself. Plan to reword it: inserts a new page into the balloon page list." Best, Wei