Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754851AbdLTMZ5 (ORCPT ); Wed, 20 Dec 2017 07:25:57 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:37217 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753868AbdLTMZy (ORCPT ); Wed, 20 Dec 2017 07:25:54 -0500 Date: Wed, 20 Dec 2017 04:25:47 -0800 From: Matthew Wilcox To: Wei Wang Cc: Tetsuo Handa , virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, linux-mm@kvack.org, mst@redhat.com, mhocko@kernel.org, akpm@linux-foundation.org, mawilcox@microsoft.com, david@redhat.com, cornelia.huck@de.ibm.com, mgorman@techsingularity.net, aarcange@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, liliang.opensource@gmail.com, yang.zhang.wz@gmail.com, quan.xu0@gmail.com, nilal@redhat.com, riel@redhat.com Subject: Re: [PATCH v20 0/7] Virtio-balloon Enhancement Message-ID: <20171220122547.GA1654@bombadil.infradead.org> References: <1513685879-21823-1-git-send-email-wei.w.wang@intel.com> <201712192305.AAE21882.MtQHJOFFSFVOLO@I-love.SAKURA.ne.jp> <5A3A3CBC.4030202@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5A3A3CBC.4030202@intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 642 Lines: 17 On Wed, Dec 20, 2017 at 06:34:36PM +0800, Wei Wang wrote: > On 12/19/2017 10:05 PM, Tetsuo Handa wrote: > > I think xb_find_set() has a bug in !node path. > > I think we can probably remove the "!node" path for now. It would be good to > get the fundamental part in first, and leave optimization to come as > separate patches with corresponding test cases in the future. You can't remove the !node path. You'll see !node when the highest set bit is less than 1024. So do something like this: unsigned long bit; xb_preload(GFP_KERNEL); xb_set_bit(xb, 700); xb_preload_end(); bit = xb_find_set(xb, ULONG_MAX, 0); assert(bit == 700);