Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita82a5ee

Browse files
committed
Use ISB as a spin-delay instruction on ARM64.
This seems beneficial on high-core-count machines, and not harmfulon lesser hardware. However, older ARM32 gear doesn't have thisinstruction, so restrict the patch to ARM64.Geoffrey BlakeDiscussion:https://postgr.es/m/78338F29-9D7F-4DC8-BD71-E9674CE71425@amazon.com
1 parent8ea7963 commita82a5ee

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎src/include/storage/s_lock.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,23 @@ tas(volatile slock_t *lock)
337337

338338
#defineS_UNLOCK(lock) __sync_lock_release(lock)
339339

340+
/*
341+
* Using an ISB instruction to delay in spinlock loops appears beneficial on
342+
* high-core-count ARM64 processors. It seems mostly a wash for smaller gear,
343+
* and ISB doesn't exist at all on pre-v7 ARM chips.
344+
*/
345+
#if defined(__aarch64__)|| defined(__aarch64)
346+
347+
#defineSPIN_DELAY() spin_delay()
348+
349+
static __inline__void
350+
spin_delay(void)
351+
{
352+
__asm__ __volatile__(
353+
" isb;\n");
354+
}
355+
356+
#endif/* __aarch64__ || __aarch64 */
340357
#endif/* HAVE_GCC__SYNC_INT32_TAS */
341358
#endif/* __arm__ || __arm || __aarch64__ || __aarch64 */
342359

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp