xfs
[Top] [All Lists]

Re: [PATCH] xfs: improve xfs_bitmap_empty()

To: Jeff Liu <jeff.liu@xxxxxxxxxx>
Subject: Re: [PATCH] xfs: improve xfs_bitmap_empty()
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Fri, 31 Jan 2014 10:28:02 -0600
Cc: Eric Sandeen <sandeen@xxxxxxxxxxx>, "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <52EBC67B.7020806@xxxxxxxxxx>
References: <52EBAF91.10608@xxxxxxxxxx> <52EBBC3D.5030507@xxxxxxxxxxx> <52EBC103.5050006@xxxxxxxxxx> <52EBC1AF.6020000@xxxxxxxxxxx> <52EBC67B.7020806@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 01/31/14 09:51, Jeff Liu wrote:

On 01/31 2014 23:30 PM, Eric Sandeen wrote:
On 1/31/14, 9:28 AM, Jeff Liu wrote:

On 01/31 2014 23:07 PM, Eric Sandeen wrote:
On 1/31/14, 8:13 AM, Jeff Liu wrote:
From: Jie Liu<jeff.liu@xxxxxxxxxx>

There is no need to travel through the whole bitmap items to verify
if the bitmap array is empty or not, instead, just return 0 directly
if an item is detected in bitmap array.

Signed-off-by: Jie Liu<jeff.liu@xxxxxxxxxx>

Makes sense (and the long loop was my fault, I guess, but it's
better than it was, see commit 24ad33f!)

Ah, you have killed a lots code there! :)
Reviewed-by: Eric Sandeen<sandeen@xxxxxxxxxx>

I wonder if something like:

return (find_first_set(map, size) == size);

would be faster (or if it'd be worth it)...?
Probably not.  :)


Well, when I looking through our bitmap source, I once thought if
we can replace the current code with the generic bitmap library.
However, our map is uint rather than unsigned long...

Technically the unsigned long (pointer) is just the bitmap address,
I think.

Yeah, so this might worth to try on long terms.


The blf_data_map[] is int aligned, not long aligned.
You could reflect the alignment difference in the offset or
change the alignment in the structure.

--Mark.

<Prev in Thread] Current Thread [Next in Thread>