From: "Michael S. Tsirkin" <mst@redhat.com>
To: Wei Wang <wei.w.wang@intel.com>
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
Date: Thu, 18 Jul 2019 02:51:51 -0400 [thread overview]
Message-ID: <20190718024822-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <5D301232.7080808@intel.com>
On Thu, Jul 18, 2019 at 02:31:14PM +0800, Wei Wang wrote:
> 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@intel.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.
yes
> 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."
And maybe
" Page must have been allocated with balloon_page_alloc.".
Also
* Driver must call it to properly enqueue a balloon pages before definitively
should be
* Driver must call it to properly enqueue balloon pages before definitively
>
> Best,
> Wei
prev parent reply other threads:[~2019-07-18 6:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 2:23 [PATCH v1] mm/balloon_compaction: avoid duplicate page removal Wei Wang
2019-07-18 4:31 ` Michael S. Tsirkin
2019-07-18 6:31 ` Wei Wang
2019-07-18 6:51 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190718024822-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@intel.com \
--cc=david@redhat.com \
--cc=konrad.wilk@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=lcapitulino@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=namit@vmware.com \
--cc=nitesh@redhat.com \
--cc=pagupta@redhat.com \
--cc=pbonzini@redhat.com \
--cc=riel@surriel.com \
--cc=wei.w.wang@intel.com \
--cc=xdeguillard@vmware.com \
--cc=yang.zhang.wz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.