Re: [PATCH 1/1] IB: rxe: replace read/write locks with atomic bitops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 18, 2018 at 12:03:34AM -0500, Zhu Yanjun wrote:
> In rxe_pool.c, pool state is protected by some read/write locks.
> Now these read/write locks are replaced with atomic bitops. This can
> make source code compact.
> 
> Signed-off-by: Zhu Yanjun <yanjun.zhu@xxxxxxxxxx>
>  drivers/infiniband/sw/rxe/rxe_pool.c | 22 +++++++---------------
>  drivers/infiniband/sw/rxe/rxe_pool.h |  2 +-
>  2 files changed, 8 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_pool.c b/drivers/infiniband/sw/rxe/rxe_pool.c
> index 36b53fb94a49..1a7efe0e3bb1 100644
> +++ b/drivers/infiniband/sw/rxe/rxe_pool.c
> @@ -222,7 +222,7 @@ int rxe_pool_init(
>  		pool->key_size = rxe_type_info[type].key_size;
>  	}
>  
> -	pool->state = RXE_POOL_STATE_VALID;
> +	set_bit(RXE_POOL_STATE_VALID, &pool->state);
>  
>  out:
>  	return err;
> @@ -232,7 +232,7 @@ static void rxe_pool_release(struct kref *kref)
>  {
>  	struct rxe_pool *pool = container_of(kref, struct rxe_pool, ref_cnt);
>  
> -	pool->state = RXE_POOL_STATE_INVALID;
> +	set_bit(RXE_POOL_STATE_INVALID, &pool->state);

A bit called valid and a bit called invalid at the same time?? What is
wrong with set_bit/clear_bit ???

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux