Date: Tue, 11 Aug 2020 14:46:18 +0200 From: Emmanuel Vadot <manu@bidouilliste.com> To: Hans Petter Selasky <hselasky@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364110 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <20200811144618.38021590f1a2b5eb3fa963c9@bidouilliste.com> In-Reply-To: <202008111241.07BCfeC9064365@repo.freebsd.org> References: <202008111241.07BCfeC9064365@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 11 Aug 2020 12:41:40 +0000 (UTC) Hans Petter Selasky <hselasky@FreeBSD.org> wrote: > Author: hselasky > Date: Tue Aug 11 12:41:40 2020 > New Revision: 364110 > URL: https://svnweb.freebsd.org/changeset/base/364110 > > Log: > Use atomic_clear_rel_long() to implement clear_bit_unlock() in the LinuxKPI > after r363842. > > Suggested by: alc@ > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/compat/linuxkpi/common/include/linux/bitops.h Thanks Hans, I was doing a last build but you beat me to it. And thanks to Alan for suggesting using atomic_clear_rel_long directly. Note that clear_bit_unlock isn't used by any code at the moment so it wasn't a big deal. > Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 11 12:17:46 2020 (r364109) > +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 11 12:41:40 2020 (r364110) > @@ -272,15 +272,11 @@ find_next_zero_bit(const unsigned long *addr, unsigned > #define clear_bit(i, a) \ > atomic_clear_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) > > +#define clear_bit_unlock(i, a) \ > + atomic_clear_rel_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) > + > #define test_bit(i, a) \ > !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) > - > -static inline void > -clear_bit_unlock(long bit, volatile unsigned long *var) > -{ > - clear_bit(bit, var); > - wmb(); > -} > > static inline int > test_and_clear_bit(long bit, volatile unsigned long *var) -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200811144618.38021590f1a2b5eb3fa963c9>
