[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5D301232.7080808@intel.com>
Date: Thu, 18 Jul 2019 14:31:14 +0800
From: Wei Wang <wei.w.wang@...el.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
CC: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, xdeguillard@...are.com, namit@...are.com,
akpm@...ux-foundation.org, pagupta@...hat.com, riel@...riel.com,
dave.hansen@...el.com, david@...hat.com, konrad.wilk@...cle.com,
yang.zhang.wz@...il.com, nitesh@...hat.com, lcapitulino@...hat.com,
aarcange@...hat.com, pbonzini@...hat.com,
alexander.h.duyck@...ux.intel.com, dan.j.williams@...el.com
Subject: Re: [PATCH v1] mm/balloon_compaction: avoid duplicate page removal
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 <wei.w.wang@...el.com>
> 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 <linux/export.h>
>> #include <linux/balloon_compaction.h>
>>
>> +/* 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
Powered by blists - more mailing lists