[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171216050536.GA18920@bombadil.infradead.org>
Date: Fri, 15 Dec 2017 21:05:36 -0800
From: Matthew Wilcox <willy@...radead.org>
To: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc: mst@...hat.com, wei.w.wang@...el.com,
virtio-dev@...ts.oasis-open.org, linux-kernel@...r.kernel.org,
qemu-devel@...gnu.org, virtualization@...ts.linux-foundation.org,
kvm@...r.kernel.org, linux-mm@...ck.org, mhocko@...nel.org,
akpm@...ux-foundation.org, mawilcox@...rosoft.com,
david@...hat.com, cornelia.huck@...ibm.com,
mgorman@...hsingularity.net, aarcange@...hat.com,
amit.shah@...hat.com, pbonzini@...hat.com,
liliang.opensource@...il.com, yang.zhang.wz@...il.com,
quan.xu@...yun.com, nilal@...hat.com, riel@...hat.com
Subject: Re: [PATCH v19 3/7] xbitmap: add more operations
On Sat, Dec 16, 2017 at 01:31:24PM +0900, Tetsuo Handa wrote:
> Michael S. Tsirkin wrote:
> > On Sat, Dec 16, 2017 at 01:21:52AM +0900, Tetsuo Handa wrote:
> > > My understanding is that virtio-balloon wants to handle sparsely spreaded
> > > unsigned long values (which is PATCH 4/7) and wants to find all chunks of
> > > consecutive "1" bits efficiently. Therefore, I guess that holding the values
> > > in ascending order at store time is faster than sorting the values at read
> > > time.
What makes you think that the radix tree (also xbitmap, also idr) doesn't
sort the values at store time?
> I'm asking whether we really need to invent a new library module (i.e.
> PATCH 1/7 + PATCH 2/7 + PATCH 3/7) for virtio-balloon compared to mine.
>
> What virtio-balloon needs is ability to
>
> (1) record any integer value in [0, ULONG_MAX] range
>
> (2) fetch all recorded values, with consecutive values combined in
> min,max (or start,count) form for efficiently
>
> and I wonder whether we need to invent complete API set which
> Matthew Wilcox and Wei Wang are planning for generic purpose.
The xbitmap absolutely has that ability. And making it generic code
means more people see it, use it, debug it, optimise it. I originally
wrote the implementation for bcache, when Kent was complaining we didn't
have such a thing. His needs weren't as complex as Wei's, which is why
I hadn't implemented everything that Wei needed.
Powered by blists - more mailing lists