From 4f0bfe0fb8dc608a94fe429c5ddb12e58997e1ce Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 30 Mar 2019 09:17:46 +0100 Subject: dtracy: avoid dmachlock() race between being commited to a machno and having acquired the lock, the scheduler could come in an schedule us on a different processor. the solution is to have dtmachlock() take a special -1 argument to mean "current mach" and return the actual mach number after the lock has been acquired and interrupts being disabled. --- sys/include/dtracy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/include') diff --git a/sys/include/dtracy.h b/sys/include/dtracy.h index 438a8d1e7..92f458657 100644 --- a/sys/include/dtracy.h +++ b/sys/include/dtracy.h @@ -241,7 +241,7 @@ void dtsync(void); DTProbe *dtpnew(char *, DTProvider *, void *aux); int dtpmatch(char *, DTProbe ***); int dtplist(DTProbe ***); -void dtptrigger(DTProbe *, int, DTTrigInfo *); +void dtptrigger(DTProbe *, DTTrigInfo *); /* expression functions */ int dteverify(DTExpr *); @@ -285,7 +285,7 @@ uvlong dttime(void); /* return current timestamp */ void *dtrealloc(void *, ulong); void dtfree(void *); void *dtmalloc(ulong); -void dtmachlock(int); /* lock the per-cpu lock */ +int dtmachlock(int); /* lock the per-cpu lock */ void dtmachunlock(int); /* unlock the per-cpu lock */ void dtcoherence(void); /* memory barrier */ uvlong dtgetvar(int); /* return the value of a variable */ -- cgit v1.2.3