Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452535

Re: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process

From Dave Hansen <dave.hansen@intel.com>
Newsgroups linux.kernel
Subject Re: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
Date 2016-07-29 21:50 +0200
Message-ID <s0lXc-B0-13@gated-at.bofh.it> (permalink)
References (2 earlier) <rZzzb-1Cb-7@gated-at.bofh.it> <rZI9r-7qH-3@gated-at.bofh.it> <rZICt-7AT-1@gated-at.bofh.it> <rZN98-2nM-15@gated-at.bofh.it> <s01vs-3Eo-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 07/28/2016 02:51 PM, Michael S. Tsirkin wrote:
>> > If 1MB is too big, how about 512K, or 256K?  32K seems too small.
>> > 
> It's only small because it makes you rescan the free list.
> So maybe you should do something else.
> I looked at it a bit. Instead of scanning the free list, how about
> scanning actual page structures? If page is unused, pass it to host.
> Solves the problem of rescanning multiple times, does it not?

FWIW, I think the new data structure needs some work.

Before, we had a potentially very long list of 4k areas.  Now, we've
just got a very large bitmap.  The bitmap might not even be very dense
if we are ballooning relatively few things.

Can I suggest an alternate scheme?  I think you actually need a hybrid
scheme that has bitmaps but also allows more flexibility in the pfn
ranges.  The payload could be a number of records each containing 3 things:

	pfn, page order, length of bitmap (maybe in powers of 2)

Each record is followed by the bitmap.  Or, if the bitmap length is 0,
immediately followed by another record.  A bitmap length of 0 implies a
bitmap with the least significant bit set.  Page order specifies how
many pages each bit represents.

This scheme could easily encode the new data structure you are proposing
by just setting pfn=0, order=0, and a very long bitmap length.  But, it
could handle sparse bitmaps much better *and* represent large pages much
more efficiently.

There's plenty of space to fit a whole record in 64 bits.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process Liang Li <liang.z.li@intel.com> - 2016-07-27 03:40 +0200
  Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process Dave Hansen <dave.hansen@intel.com> - 2016-07-27 18:10 +0200
    Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Michael S. Tsirkin" <mst@redhat.com> - 2016-07-27 23:40 +0200
      RE: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Li, Liang Z" <liang.z.li@intel.com> - 2016-07-28 05:40 +0200
        Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Michael S. Tsirkin" <mst@redhat.com> - 2016-07-29 00:20 +0200
          RE: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up  inflate/deflate process "Li, Liang Z" <liang.z.li@intel.com> - 2016-07-29 03:10 +0200
    RE: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Li, Liang Z" <liang.z.li@intel.com> - 2016-07-28 03:20 +0200
      Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Michael S. Tsirkin" <mst@redhat.com> - 2016-07-28 03:50 +0200
        RE: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up  inflate/deflate process "Li, Liang Z" <liang.z.li@intel.com> - 2016-07-28 08:40 +0200
          Re: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up  inflate/deflate process "Michael S. Tsirkin" <mst@redhat.com> - 2016-07-29 00:00 +0200
            RE: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up  inflate/deflate process "Li, Liang Z" <liang.z.li@intel.com> - 2016-07-29 02:50 +0200
            Re: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up  inflate/deflate process Dave Hansen <dave.hansen@intel.com> - 2016-07-29 21:50 +0200
              RE: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up  inflate/deflate process "Li, Liang Z" <liang.z.li@intel.com> - 2016-08-02 02:40 +0200
  Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Michael S. Tsirkin" <mst@redhat.com> - 2016-07-27 23:40 +0200
    RE: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Li, Liang Z" <liang.z.li@intel.com> - 2016-07-28 05:10 +0200
      Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Michael S. Tsirkin" <mst@redhat.com> - 2016-07-29 00:20 +0200
        RE: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Li, Liang Z" <liang.z.li@intel.com> - 2016-07-29 02:40 +0200
  Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Michael S. Tsirkin" <mst@redhat.com> - 2016-07-28 00:10 +0200
    RE: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate  process "Li, Liang Z" <liang.z.li@intel.com> - 2016-07-28 05:50 +0200

csiph-web