Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 May 2015 23:40:25 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282571 - head/sys/amd64/include
Message-ID:  <201505062340.t46NePe1014377@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: neel
Date: Wed May  6 23:40:24 2015
New Revision: 282571
URL: https://svnweb.freebsd.org/changeset/base/282571

Log:
  Check 'td_owepreempt' and yield the vcpu thread if it is set.
  
  This is done explicitly because a vcpu thread can be in a critical section
  for the entire time slice alloted to it. This in turn can delay the handling
  of the 'td_owepreempt'.
  
  Reviewed by:	jhb
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D2430

Modified:
  head/sys/amd64/include/vmm.h

Modified: head/sys/amd64/include/vmm.h
==============================================================================
--- head/sys/amd64/include/vmm.h	Wed May  6 23:26:51 2015	(r282570)
+++ head/sys/amd64/include/vmm.h	Wed May  6 23:40:24 2015	(r282571)
@@ -276,7 +276,13 @@ vcpu_is_running(struct vm *vm, int vcpu,
 static int __inline
 vcpu_should_yield(struct vm *vm, int vcpu)
 {
-	return (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED));
+
+	if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED))
+		return (1);
+	else if (curthread->td_owepreempt)
+		return (1);
+	else
+		return (0);
 }
 #endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505062340.t46NePe1014377>