lkml.org 
[lkml]   [2022]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] virtio_balloon: high order allocation
From
Date
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

.

\
 
 \ /
  Last update: 2023-03-26 23:19    [W:0.080 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site