Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-04-02 Thread Michael S. Tsirkin
On Thu, Apr 02, 2020 at 04:00:05PM +0800, teawater wrote: > > > > 2020年3月31日 22:07,Michael S. Tsirkin 写道: > > > > On Tue, Mar 31, 2020 at 04:03:18PM +0200, David Hildenbrand wrote: > >> On 31.03.20 15:37, Michael S. Tsirkin wrote: > >>> On Tue, Mar 31, 2020 at 03:32:05PM +0200, David

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-04-01 Thread David Hildenbrand
On 31.03.20 18:27, Nadav Amit wrote: >> On Mar 31, 2020, at 6:32 AM, David Hildenbrand wrote: >> >> On 31.03.20 15:24, Michael S. Tsirkin wrote: >>> On Tue, Mar 31, 2020 at 12:35:24PM +0200, David Hildenbrand wrote: On 26.03.20 10:49, Michael S. Tsirkin wrote: > On Thu, Mar 26, 2020 at

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-04-01 Thread David Hildenbrand
On 31.03.20 18:37, Nadav Amit wrote: >> On Mar 31, 2020, at 7:09 AM, David Hildenbrand wrote: >> >> On 31.03.20 16:07, Michael S. Tsirkin wrote: >>> On Tue, Mar 31, 2020 at 04:03:18PM +0200, David Hildenbrand wrote: On 31.03.20 15:37, Michael S. Tsirkin wrote: > On Tue, Mar 31, 2020 at

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread Nadav Amit via Virtualization
> On Mar 31, 2020, at 7:09 AM, David Hildenbrand wrote: > > On 31.03.20 16:07, Michael S. Tsirkin wrote: >> On Tue, Mar 31, 2020 at 04:03:18PM +0200, David Hildenbrand wrote: >>> On 31.03.20 15:37, Michael S. Tsirkin wrote: On Tue, Mar 31, 2020 at 03:32:05PM +0200, David Hildenbrand wrote:

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread Nadav Amit via Virtualization
> On Mar 31, 2020, at 6:32 AM, David Hildenbrand wrote: > > On 31.03.20 15:24, Michael S. Tsirkin wrote: >> On Tue, Mar 31, 2020 at 12:35:24PM +0200, David Hildenbrand wrote: >>> On 26.03.20 10:49, Michael S. Tsirkin wrote: On Thu, Mar 26, 2020 at 08:54:04AM +0100, David Hildenbrand wrote:

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread Michael S. Tsirkin
On Tue, Mar 31, 2020 at 04:34:48PM +0200, David Hildenbrand wrote: > On 31.03.20 16:29, David Hildenbrand wrote: > > On 31.03.20 16:18, Michael S. Tsirkin wrote: > >> On Tue, Mar 31, 2020 at 04:09:59PM +0200, David Hildenbrand wrote: > >> > >> ... > >> > >> So if we want to address

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread David Hildenbrand
On 31.03.20 16:29, David Hildenbrand wrote: > On 31.03.20 16:18, Michael S. Tsirkin wrote: >> On Tue, Mar 31, 2020 at 04:09:59PM +0200, David Hildenbrand wrote: >> >> ... >> >> So if we want to address this, IMHO this calls for a new API. >> Along the lines of

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread David Hildenbrand
On 31.03.20 16:18, Michael S. Tsirkin wrote: > On Tue, Mar 31, 2020 at 04:09:59PM +0200, David Hildenbrand wrote: > > ... > > So if we want to address this, IMHO this calls for a new API. > Along the lines of > >struct page

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread Michael S. Tsirkin
On Tue, Mar 31, 2020 at 04:09:59PM +0200, David Hildenbrand wrote: ... > >>> So if we want to address this, IMHO this calls for a new API. > >>> Along the lines of > >>> > >>>struct page *alloc_page_range(gfp_t gfp, unsigned int > >>> min_order, >

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread David Hildenbrand
On 31.03.20 16:07, Michael S. Tsirkin wrote: > On Tue, Mar 31, 2020 at 04:03:18PM +0200, David Hildenbrand wrote: >> On 31.03.20 15:37, Michael S. Tsirkin wrote: >>> On Tue, Mar 31, 2020 at 03:32:05PM +0200, David Hildenbrand wrote: On 31.03.20 15:24, Michael S. Tsirkin wrote: > On Tue,

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread Michael S. Tsirkin
On Tue, Mar 31, 2020 at 04:03:18PM +0200, David Hildenbrand wrote: > On 31.03.20 15:37, Michael S. Tsirkin wrote: > > On Tue, Mar 31, 2020 at 03:32:05PM +0200, David Hildenbrand wrote: > >> On 31.03.20 15:24, Michael S. Tsirkin wrote: > >>> On Tue, Mar 31, 2020 at 12:35:24PM +0200, David

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread David Hildenbrand
On 31.03.20 15:37, Michael S. Tsirkin wrote: > On Tue, Mar 31, 2020 at 03:32:05PM +0200, David Hildenbrand wrote: >> On 31.03.20 15:24, Michael S. Tsirkin wrote: >>> On Tue, Mar 31, 2020 at 12:35:24PM +0200, David Hildenbrand wrote: On 26.03.20 10:49, Michael S. Tsirkin wrote: > On Thu,

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread Michael S. Tsirkin
On Tue, Mar 31, 2020 at 03:32:05PM +0200, David Hildenbrand wrote: > On 31.03.20 15:24, Michael S. Tsirkin wrote: > > On Tue, Mar 31, 2020 at 12:35:24PM +0200, David Hildenbrand wrote: > >> On 26.03.20 10:49, Michael S. Tsirkin wrote: > >>> On Thu, Mar 26, 2020 at 08:54:04AM +0100, David

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread David Hildenbrand
On 31.03.20 15:24, Michael S. Tsirkin wrote: > On Tue, Mar 31, 2020 at 12:35:24PM +0200, David Hildenbrand wrote: >> On 26.03.20 10:49, Michael S. Tsirkin wrote: >>> On Thu, Mar 26, 2020 at 08:54:04AM +0100, David Hildenbrand wrote: > Am 26.03.2020 um 08:21 schrieb Michael S. Tsirkin

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread Michael S. Tsirkin
On Tue, Mar 31, 2020 at 12:35:24PM +0200, David Hildenbrand wrote: > On 26.03.20 10:49, Michael S. Tsirkin wrote: > > On Thu, Mar 26, 2020 at 08:54:04AM +0100, David Hildenbrand wrote: > >> > >> > >>> Am 26.03.2020 um 08:21 schrieb Michael S. Tsirkin : > >>> > >>> On Thu, Mar 12, 2020 at

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-31 Thread David Hildenbrand
On 26.03.20 10:49, Michael S. Tsirkin wrote: > On Thu, Mar 26, 2020 at 08:54:04AM +0100, David Hildenbrand wrote: >> >> >>> Am 26.03.2020 um 08:21 schrieb Michael S. Tsirkin : >>> >>> On Thu, Mar 12, 2020 at 09:51:25AM +0100, David Hildenbrand wrote: > On 12.03.20 09:47, Michael S. Tsirkin

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-26 Thread Michael S. Tsirkin
On Thu, Mar 26, 2020 at 08:54:04AM +0100, David Hildenbrand wrote: > > > > Am 26.03.2020 um 08:21 schrieb Michael S. Tsirkin : > > > > On Thu, Mar 12, 2020 at 09:51:25AM +0100, David Hildenbrand wrote: > >>> On 12.03.20 09:47, Michael S. Tsirkin wrote: > >>> On Thu, Mar 12, 2020 at 09:37:32AM

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-26 Thread David Hildenbrand
> Am 26.03.2020 um 08:21 schrieb Michael S. Tsirkin : > > On Thu, Mar 12, 2020 at 09:51:25AM +0100, David Hildenbrand wrote: >>> On 12.03.20 09:47, Michael S. Tsirkin wrote: >>> On Thu, Mar 12, 2020 at 09:37:32AM +0100, David Hildenbrand wrote: 2. You are essentially stealing THPs in the

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-26 Thread Michael S. Tsirkin
On Thu, Mar 12, 2020 at 09:51:25AM +0100, David Hildenbrand wrote: > On 12.03.20 09:47, Michael S. Tsirkin wrote: > > On Thu, Mar 12, 2020 at 09:37:32AM +0100, David Hildenbrand wrote: > >> 2. You are essentially stealing THPs in the guest. So the fastest > >> mapping (THP in guest and host) is

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-26 Thread Michael S. Tsirkin
On Thu, Mar 12, 2020 at 09:51:25AM +0100, David Hildenbrand wrote: > On 12.03.20 09:47, Michael S. Tsirkin wrote: > > On Thu, Mar 12, 2020 at 09:37:32AM +0100, David Hildenbrand wrote: > >> 2. You are essentially stealing THPs in the guest. So the fastest > >> mapping (THP in guest and host) is

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-12 Thread David Hildenbrand
On 12.03.20 09:47, Michael S. Tsirkin wrote: > On Thu, Mar 12, 2020 at 09:37:32AM +0100, David Hildenbrand wrote: >> 2. You are essentially stealing THPs in the guest. So the fastest >> mapping (THP in guest and host) is gone. The guest won't be able to make >> use of THP where it previously was

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-12 Thread Michael S. Tsirkin
On Thu, Mar 12, 2020 at 09:37:32AM +0100, David Hildenbrand wrote: > 2. You are essentially stealing THPs in the guest. So the fastest > mapping (THP in guest and host) is gone. The guest won't be able to make > use of THP where it previously was able to. I can imagine this implies a > performance

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-12 Thread David Hildenbrand
On 12.03.20 08:49, Hui Zhu wrote: > If the guest kernel has many fragmentation pages, use virtio_balloon > will split THP of QEMU when it calls MADV_DONTNEED madvise to release > the balloon pages. > This is an example in a VM with 1G memory 1CPU: > cat /proc/meminfo | grep AnonHugePages: >

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-12 Thread Michael S. Tsirkin
On Thu, Mar 12, 2020 at 03:49:54PM +0800, Hui Zhu wrote: > If the guest kernel has many fragmentation pages, use virtio_balloon > will split THP of QEMU when it calls MADV_DONTNEED madvise to release > the balloon pages. > This is an example in a VM with 1G memory 1CPU: > cat /proc/meminfo | grep