All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Shixin <liushixin2@huawei.com>
To: Soichiro Ueda <the.latticeheart@gmail.com>, <mst@redhat.com>,
	<david@redhat.com>, <jasowang@redhat.com>,
	<akpm@linux-foundation.org>
Cc: <virtualization@lists.linux-foundation.org>,
	<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
	<kalutes@google.com>, <mhiramat@kernel.org>, <cwd@google.com>
Subject: Re: [PATCH] virtio_balloon: high order allocation
Date: Sat, 24 Dec 2022 11:26:27 +0800	[thread overview]
Message-ID: <3fabf076-0fd8-2ad2-52e7-3c2913308156@huawei.com> (raw)
In-Reply-To: <20221223093527.12424-1-the.latticeheart@gmail.com>

Hi, Soichiro:

I'm interested with your patch. I'm looking at it and found some possible issues.


On 2022/12/23 17:35, Soichiro Ueda wrote:
> +			for (i = 0; i < num_pfns; i++) {
> +				set_page_pfns(vb, vb->pfns + vb->num_pfns + i,
> +					      nth_page(page, i));
> +			}
Since the interval of vb->num_pfns is VIRTIO_BALLOON_PAGES_PER_PAGE,
it seems that the pfns[] should be vb->pfns + vb->num_pfns + i * VIRTIO_BALLOON_PAGES_PER_PAGE.
> +			vb->num_pages +=
> +				num_pfns * VIRTIO_BALLOON_PAGES_PER_PAGE;
> +			if (!virtio_has_feature(
> +				    vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM))
> +				adjust_managed_page_count(page, -num_pfns);
num_pfns is of the unsigned int type so need be to converted to long manually.

root@syzkaller:~# free -m
              total        used        free      shared  buff/cache   available
Mem:           1975          78        1822           2          74        1869
Swap:             0           0           0
root@syzkaller:~# QEMU 7.2.0 monitor - type 'help' for more information
(qemu) info balloon
balloon: actual=2048
(qemu) balloon 2046
(qemu)

root@syzkaller:~# free -m
              total        used        free      shared  buff/cache   available
Mem:       33556405    33554510        1819           2          74        1867
Swap:             0           0           0
> +
> +		num_pfns = (1 << order);
> +		for (i = 0; i < num_pfns; i++)
> +			set_page_pfns(vb, vb->pfns + vb->num_pfns + i, nth_page(page, i));
The same problem mentioned above.


thanks,

Liu Shixin

.

  parent reply	other threads:[~2022-12-24  3:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-23  9:35 [PATCH] virtio_balloon: high order allocation Soichiro Ueda
2022-12-23  9:40 ` David Hildenbrand
2022-12-23  9:40   ` David Hildenbrand
2022-12-29  5:31   ` Soichiro Ueda
2023-01-02 11:55     ` David Hildenbrand
2023-01-02 11:55       ` David Hildenbrand
2022-12-24  3:26 ` Liu Shixin [this message]
2022-12-29  6:27   ` Soichiro Ueda
2022-12-23 21:04 kernel test robot

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=3fabf076-0fd8-2ad2-52e7-3c2913308156@huawei.com \
    --to=liushixin2@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=cwd@google.com \
    --cc=david@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kalutes@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhiramat@kernel.org \
    --cc=mst@redhat.com \
    --cc=the.latticeheart@gmail.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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.