> --- a/drivers/net/ethernet/mellanox/mlx4/alloc.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c
> @@ -124,7 +124,6 @@ void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, 
> u32 obj, int cnt)
>
>        spin_lock(&bitmap->lock);
>        bitmap_clear(bitmap->table, obj, cnt);
> -       bitmap->last = min(bitmap->last, obj);
>        bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top)
>                        & bitmap->mask;
>        bitmap->avail += cnt;

I think this mostly makes sense, although the explanation doesn't quite
make sense.

However I think it would also make sense to get rid of changing the
bitmap->top value here when freeing.  Then we would really go
round-robin, and only bump bitmap->top each time we wrap around
during allocation.

Does that make sense to you?

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to