Re: [PATCH for-next] RDMA/cma: Replace RMW with atomic bit-ops

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

 



On Wed, Jun 16, 2021 at 04:35:53PM +0200, Håkon Bugge wrote:
> +#define BIT_ACCESS_FUNCTIONS(b)							\
> +	static inline void set_##b(unsigned long flags)				\
> +	{									\
> +		/* set_bit() does not imply a memory barrier */			\
> +		smp_mb__before_atomic();					\
> +		set_bit(b, &flags);						\
> +		/* set_bit() does not imply a memory barrier */			\
> +		smp_mb__after_atomic();						\
> +	}

This isn't needed, set_bit/test_bit are already atomic with
themselves, we should not need to introduce release semantics.

Please split this to one patch per variable

Every variable should be evalulated to decide if we should hold the
spinlock instead of relying on atomics.

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