# Re: \[PATCH RFC 1/2\] arch: Introduce ARCH\_HAS\_HW\_XCHG\_SMALL

- From: Peter Zijlstra \<peterz@infradead.org\>
- Date: 2021-07-27 11:08:00 
- List: linux-arch
- Page: https://ratatoskr.run/linux-arch/2021/07/13337157
- Thread: https://ratatoskr.run/linux-arch/2021/07/13337119/t.md

```text
On Tue, Jul 27, 2021 at 10:29:59AM +0800, Boqun Feng wrote:

> > "How to implement xchg_tail" shouldn't force with _Q_PENDING_BITS, but
> > the arch could choose.
> 
> I actually agree with this part, but this patchset failed to provide
> enough evidences on why we should choose xchg_tail() implementation
> based on whether hardware has xchg16, more precisely, for an archtecture
> which doesn't have a hardware xchg16, why cmpxchg emulated xchg16() is
> worse than a "load+cmpxchg) implemeneted xchg_tail()? If it's a
> performance reason, please show some numbers.

Right. Their problem is their broken xchg16() implementation.
```
