Re: [Intel-gfx] [PATCH v5 2/7] linux/include: add non-atomic version of xchg
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Andrzej Hajda <andrzej.hajda@xxxxxxxxx>
- Subject: Re: [Intel-gfx] [PATCH v5 2/7] linux/include: add non-atomic version of xchg
- From: Andi Shyti <andi.shyti@xxxxxxxxxxxxxxx>
- Date: Mon, 27 Feb 2023 10:53:57 +0100
- Cc: linux-alpha@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, Mark Rutland <mark.rutland@xxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Boqun Feng <boqun.feng@xxxxxxxxx>, Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
- In-reply-to: <20230118154450.73842-2-andrzej.hajda@intel.com>
- References: <20230118153529.57695-1-andrzej.hajda@intel.com> <20230118154450.73842-1-andrzej.hajda@intel.com> <20230118154450.73842-2-andrzej.hajda@intel.com>
Hi Andrzej,
On Wed, Jan 18, 2023 at 04:44:45PM +0100, Andrzej Hajda wrote:
> The pattern of setting variable with new value and returning old
> one is very common in kernel. Usually atomicity of the operation
> is not required, so xchg seems to be suboptimal and confusing in
> such cases.
>
> Signed-off-by: Andrzej Hajda <andrzej.hajda@xxxxxxxxx>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxxxxxxx>
Thanks,
Andi
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]