Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109368158
D39584.id120414.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D39584.id120414.diff
View Options
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -151,6 +151,26 @@
&umtx_max_rb, 0,
"Maximum number of robust mutexes allowed for each thread");
+static sbintime_t umtx_min_timeout;
+static int
+sysctl_umtx_min_timeout(SYSCTL_HANDLER_ARGS)
+{
+ int error, val;
+
+ val = sbttons(umtx_min_timeout);
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error != 0 || req->newptr == NULL)
+ return (error);
+ if (val < 0)
+ return (EINVAL);
+ umtx_min_timeout = nstosbt(val);
+ return (0);
+}
+SYSCTL_PROC(_kern_ipc, OID_AUTO, umtx_min_timeout,
+ CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, NULL, 0,
+ sysctl_umtx_min_timeout, "U",
+ "Minimal timeout for umtx in nanoseconds");
+
static uma_zone_t umtx_pi_zone;
static struct umtxq_chain umtxq_chains[2][UMTX_CHAINS];
static MALLOC_DEFINE(M_UMTX, "umtx", "UMTX queue memory");
@@ -759,6 +779,15 @@
*sbt += SBT_1S - rem;
break;
}
+ if (umtx_min_timeout != 0) {
+ struct bintime now;
+ sbintime_t when;
+
+ getbinuptime(&now);
+ when = bttosbt(now) + umtx_min_timeout;
+ if (*sbt < when)
+ *sbt = when;
+ }
*flags = C_ABSOLUTE;
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 3:54 AM (7 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16466555
Default Alt Text
D39584.id120414.diff (1 KB)
Attached To
Mode
D39584: umtx: allow to configure minimal timeout (in nanoseconds)
Attached
Detach File
Event Timeline
Log In to Comment