Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156716897
D17849.id50032.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D17849.id50032.diff
View Options
Index: sys/amd64/include/cpu.h
===================================================================
--- sys/amd64/include/cpu.h
+++ sys/amd64/include/cpu.h
@@ -50,6 +50,7 @@
#define cpu_getstack(td) ((td)->td_frame->tf_rsp)
#define cpu_setstack(td, ap) ((td)->td_frame->tf_rsp = (ap))
#define cpu_spinwait() ia32_pause()
+#define cpu_lock_delay() DELAY(1)
#define TRAPF_USERMODE(framep) \
(ISPL((framep)->tf_cs) == SEL_UPL)
Index: sys/arm/include/cpu.h
===================================================================
--- sys/arm/include/cpu.h
+++ sys/arm/include/cpu.h
@@ -61,6 +61,7 @@
#define cpu_getstack(td) ((td)->td_frame->tf_usr_sp)
#define cpu_setstack(td, sp) ((td)->td_frame->tf_usr_sp = (sp))
#define cpu_spinwait() /* nothing */
+#define cpu_lock_delay() DELAY(1)
#define ARM_NVEC 8
#define ARM_VEC_ALL 0xffffffff
Index: sys/arm64/include/cpu.h
===================================================================
--- sys/arm64/include/cpu.h
+++ sys/arm64/include/cpu.h
@@ -51,6 +51,7 @@
#define cpu_getstack(td) ((td)->td_frame->tf_sp)
#define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp))
#define cpu_spinwait() __asm __volatile("yield" ::: "memory")
+#define cpu_lock_delay() DELAY(1)
/* Extract CPU affinity levels 0-3 */
#define CPU_AFF0(mpidr) (u_int)(((mpidr) >> 0) & 0xff)
Index: sys/i386/include/cpu.h
===================================================================
--- sys/i386/include/cpu.h
+++ sys/i386/include/cpu.h
@@ -50,6 +50,7 @@
#define cpu_getstack(td) ((td)->td_frame->tf_esp)
#define cpu_setstack(td, ap) ((td)->td_frame->tf_esp = (ap))
#define cpu_spinwait() ia32_pause()
+#define cpu_lock_delay() DELAY(1)
#define TRAPF_USERMODE(framep) \
((ISPL((framep)->tf_cs) == SEL_UPL) || ((framep)->tf_eflags & PSL_VM))
Index: sys/kern/kern_mutex.c
===================================================================
--- sys/kern/kern_mutex.c
+++ sys/kern/kern_mutex.c
@@ -1206,7 +1206,7 @@
ldap->spin_cnt++;
if (ldap->spin_cnt < 60000000 || kdb_active || panicstr != NULL)
- DELAY(1);
+ cpu_lock_delay();
else {
td = mtx_owner(m);
Index: sys/mips/include/cpu.h
===================================================================
--- sys/mips/include/cpu.h
+++ sys/mips/include/cpu.h
@@ -71,6 +71,7 @@
#define cpu_getstack(td) ((td)->td_frame->sp)
#define cpu_setstack(td, nsp) ((td)->td_frame->sp = (nsp))
#define cpu_spinwait() /* nothing */
+#define cpu_lock_delay() DELAY(1)
/*
* A machine-independent interface to the CPU's counter.
Index: sys/powerpc/include/cpu.h
===================================================================
--- sys/powerpc/include/cpu.h
+++ sys/powerpc/include/cpu.h
@@ -128,6 +128,7 @@
#define cpu_getstack(td) ((td)->td_frame->fixreg[1])
#define cpu_spinwait() __asm __volatile("or 27,27,27") /* yield */
+#define cpu_lock_delay() DELAY(1)
extern char btext[];
extern char etext[];
Index: sys/riscv/include/cpu.h
===================================================================
--- sys/riscv/include/cpu.h
+++ sys/riscv/include/cpu.h
@@ -46,6 +46,7 @@
#define cpu_getstack(td) ((td)->td_frame->tf_sp)
#define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp))
#define cpu_spinwait() /* nothing */
+#define cpu_lock_delay() DELAY(1)
#ifdef _KERNEL
Index: sys/sparc64/include/cpu.h
===================================================================
--- sys/sparc64/include/cpu.h
+++ sys/sparc64/include/cpu.h
@@ -48,6 +48,7 @@
#define cpu_getstack(td) ((td)->td_frame->tf_sp)
#define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp))
#define cpu_spinwait() /* nothing */
+#define cpu_lock_delay() DELAY(1)
#ifdef _KERNEL
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 9:09 PM (14 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33153109
Default Alt Text
D17849.id50032.diff (3 KB)
Attached To
Mode
D17849: Add a KPI for the delay while spinning on a spin lock.
Attached
Detach File
Event Timeline
Log In to Comment