<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/arch/csky/include/asm/cmpxchg.h, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-05-11T14:07:07Z</updated>
<entry>
<title>csky: Emulate one-byte cmpxchg</title>
<updated>2024-05-11T14:07:07Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@kernel.org</email>
</author>
<published>2024-03-27T22:14:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5800e77d88c0cd98bc10460df148631afa7b5e4d'/>
<id>urn:sha1:5800e77d88c0cd98bc10460df148631afa7b5e4d</id>
<content type='text'>
Use the new cmpxchg_emu_u8() to emulate one-byte cmpxchg() on csky.

[ paulmck: Apply kernel test robot feedback. ]
[ paulmck: Drop two-byte support per Arnd Bergmann feedback. ]

Co-developed-by: Yujie Liu &lt;yujie.liu@intel.com&gt;
Signed-off-by: Yujie Liu &lt;yujie.liu@intel.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Tested-by: Yujie Liu &lt;yujie.liu@intel.com&gt;
Reviewed-by: Guo Ren &lt;guoren@kernel.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: &lt;linux-csky@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>csky: cmpxchg: Coding convention for BUILD_BUG()</title>
<updated>2022-08-01T01:57:30Z</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2022-08-01T01:57:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f940dc0f225183ccdba044e87daeeb93398819ad'/>
<id>urn:sha1:f940dc0f225183ccdba044e87daeeb93398819ad</id>
<content type='text'>
Use BUILD_BUG() instead of the custom bad_xchg.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Signed-off-by: Guo Ren &lt;guoren@kernel.org&gt;
</content>
</entry>
<entry>
<title>csky: Add qspinlock support</title>
<updated>2022-07-31T09:24:42Z</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2022-07-24T01:32:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=45e15c1a375ea380d55880be2f8182cb737b60ed'/>
<id>urn:sha1:45e15c1a375ea380d55880be2f8182cb737b60ed</id>
<content type='text'>
Enable qspinlock by the requirements mentioned in a8ad07e5240c9
("asm-generic: qspinlock: Indicate the use of mixed-size atomics").

C-SKY only has "ldex/stex" for all atomic operations. So csky give a
strong forward guarantee for "ldex/stex." That means when ldex grabbed
the cache line into $L1, it would block other cores from snooping the
address with several cycles. The atomic_fetch_add &amp; xchg16 has the same
forward guarantee level in C-SKY.

Qspinlock has better code size and performance in a fast path.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Signed-off-by: Guo Ren &lt;guoren@kernel.org&gt;
</content>
</entry>
<entry>
<title>csky: atomic: Optimize cmpxchg with acquire &amp; release</title>
<updated>2022-04-25T05:51:42Z</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2022-04-06T12:30:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=186f69b64c80a594337211e8238e44a3863e9d94'/>
<id>urn:sha1:186f69b64c80a594337211e8238e44a3863e9d94</id>
<content type='text'>
Optimize cmpxchg with ASM acquire/release fence ASM instructions
instead of previous generic based. Prevent a fence when cmxchg's
first load != old.

Comments by Rutland:

8e86f0b409a4 ("arm64: atomics: fix use of acquire + release for
full barrier semantics")

Comments by Boqun:

FWIW, you probably need to make sure that a barrier instruction inside
an lr/sc loop is a good thing. IIUC, the execution time of a barrier
instruction is determined by the status of store buffers and invalidate
queues (and probably other stuffs), so it may increase the execution
time of the lr/sc loop, and make it unlikely to succeed. But this really
depends on how the arch executes these instructions.

Link: https://lore.kernel.org/linux-riscv/CAJF2gTSAxpAi=LbAdu7jntZRUa=-dJwL0VfmDfBV5MHB=rcZ-w@mail.gmail.com/T/#m27a0f1342995deae49ce1d0e1f2683f8a181d6c3
Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Signed-off-by: Guo Ren &lt;guoren@kernel.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
</content>
</entry>
<entry>
<title>locking/atomic: csky: move to ARCH_ATOMIC</title>
<updated>2021-05-26T11:20:51Z</updated>
<author>
<name>Mark Rutland</name>
<email>mark.rutland@arm.com</email>
</author>
<published>2021-05-25T14:02:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a5fb82d7e2695e667badeac202fb7d113a8ae9a9'/>
<id>urn:sha1:a5fb82d7e2695e667badeac202fb7d113a8ae9a9</id>
<content type='text'>
We'd like all architectures to convert to ARCH_ATOMIC, as once all
architectures are converted it will be possible to make significant
cleanups to the atomics headers, and this will make it much easier to
generically enable atomic functionality (e.g. debug logic in the
instrumented wrappers).

As a step towards that, this patch migrates csky to ARCH_ATOMIC. The
arch code provides arch_{atomic,atomic64,xchg,cmpxchg}*(), and common
code wraps these with optional instrumentation to provide the regular
functions.

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Acked-by: Guo Ren &lt;guoren@kernel.org&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/20210525140232.53872-17-mark.rutland@arm.com
</content>
</entry>
<entry>
<title>csky: Fixup asm/cmpxchg.h with correct ordering barrier</title>
<updated>2021-01-12T01:52:40Z</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-12-20T07:10:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c38425df20371ea977c38809cb1ebe8586171caf'/>
<id>urn:sha1:c38425df20371ea977c38809cb1ebe8586171caf</id>
<content type='text'>
Optimize the performance of cmpxchg by using more fine-grained
acquire/release barriers.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>csky: Atomic operations</title>
<updated>2018-10-25T16:54:23Z</updated>
<author>
<name>Guo Ren</name>
<email>ren_guo@c-sky.com</email>
</author>
<published>2018-09-05T06:25:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a0ae62806ff495b60235cc4f2fee3f3ab6a265c9'/>
<id>urn:sha1:a0ae62806ff495b60235cc4f2fee3f3ab6a265c9</id>
<content type='text'>
This patch adds atomic, cmpxchg, spinlock files.

Signed-off-by: Guo Ren &lt;ren_guo@c-sky.com&gt;
Cc: Andrea Parri &lt;andrea.parri@amarulasolutions.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
</content>
</entry>
</feed>
