parlib: Fix assertion in cpu_relax_vc()
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 2 Mar 2017 17:45:47 +0000 (12:45 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 2 Mar 2017 18:01:29 +0000 (13:01 -0500)
It's okay for a uthread to do this, but they must have notifications
disabled, such that the rest of the system (kernel and user code on other
cores) thinks this vcore is running in vcore context.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/parlib/vcore.c

index 1f8c59a..0bc444a 100644 (file)
@@ -463,7 +463,7 @@ void ensure_vcore_runs(uint32_t vcoreid)
 void cpu_relax_vc(uint32_t vcoreid)
 {
        static __thread unsigned int __vc_relax_spun = 0;
-       assert(in_vcore_context());
+       assert(!notif_is_enabled(vcore_id()));
        if (__vc_relax_spun++ >= NR_RELAX_SPINS) {
                /* if vcoreid == vcore_id(), this might be expensive */
                ensure_vcore_runs(vcoreid);