From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] xen-blkfront: use bitmap_set() and bitmap_clear() Date: Fri, 20 Jan 2012 11:09:38 -0500 Message-ID: <20120120160938.GC3959@phenom.dumpdata.com> References: <1327072528-8479-1-git-send-email-akinobu.mita@gmail.com> <1327072528-8479-4-git-send-email-akinobu.mita@gmail.com> <20120120152819.GA3959@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Akinobu Mita Cc: akpm@linux-foundation.org, xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org, Jeremy Fitzhardinge Jeremy Fitzhardinge , virtualization@lists.linux-foundation.org List-Id: virtualization@lists.linuxfoundation.org On Sat, Jan 21, 2012 at 12:41:56AM +0900, Akinobu Mita wrote: > 2012/1/21 Konrad Rzeszutek Wilk : > > On Sat, Jan 21, 2012 at 12:15:26AM +0900, Akinobu Mita wrote: > >> Use bitmap_set and bitmap_clear rather than modifying individual bits > >> in a memory region. > >> > >> Signed-off-by: Akinobu Mita > >> Cc: Jeremy Fitzhardinge > >> Cc: Konrad Rzeszutek Wilk > >> Cc: xen-devel@lists.xensource.com > >> Cc: virtualization@lists.linux-foundation.org > >> --- > >> =A0drivers/block/xen-blkfront.c | =A0 =A07 +++---- > >> =A01 files changed, 3 insertions(+), 4 deletions(-) > >> > >> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront= .c > >> index 2f22874..619868d 100644 > >> --- a/drivers/block/xen-blkfront.c > >> +++ b/drivers/block/xen-blkfront.c > >> @@ -43,6 +43,7 @@ > >> =A0#include > >> =A0#include > >> =A0#include > >> +#include > >> > >> =A0#include > >> =A0#include > >> @@ -177,8 +178,7 @@ static int xlbd_reserve_minors(unsigned int minor,= unsigned int nr) > >> > >> =A0 =A0 =A0 spin_lock(&minor_lock); > >> =A0 =A0 =A0 if (find_next_bit(minors, end, minor) >=3D end) { > >> - =A0 =A0 =A0 =A0 =A0 =A0 for (; minor < end; ++minor) > >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __set_bit(minor, minors); > >> + =A0 =A0 =A0 =A0 =A0 =A0 bitmap_set(minors, minor, nr); > > > > Hm, I would have thought the last argument should have been 'end'? > = > 'end' is the index of the last bit to clear. But the last argument of > bitmap_clear() is the number of bits to clear. So I think 'nr' is correc= t. Ah, I see it. > = > > Did you test this patch with a large amount of minors? > = > Sorry I didn't do runtime test. Please do.