Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Jul 2017 13:15:00 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320774 - head/sys/compat/linuxkpi/common/src
Message-ID:  <201707071315.v67DF0lG012116@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Jul  7 13:15:00 2017
New Revision: 320774
URL: https://svnweb.freebsd.org/changeset/base/320774

Log:
  Fix a bug in synchronize RCU when the calling thread is bound to a CPU.
  
  Set "td_pinned" to zero after "sched_unbind()" to prevent "td_pinned"
  from temporarily becoming negative during "sched_bind()". This can
  happen if "sched_bind()" uses "sched_pin()" and "sched_unpin()".
  
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/src/linux_rcu.c

Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_rcu.c	Fri Jul  7 12:03:58 2017	(r320773)
+++ head/sys/compat/linuxkpi/common/src/linux_rcu.c	Fri Jul  7 13:15:00 2017	(r320774)
@@ -299,8 +299,9 @@ linux_synchronize_rcu(void)
 	old_cpu = PCPU_GET(cpuid);
 	old_pinned = td->td_pinned;
 	old_prio = td->td_priority;
-	td->td_pinned = 0;
 	was_bound = sched_is_bound(td);
+	sched_unbind(td);
+	td->td_pinned = 0;
 	sched_bind(td, old_cpu);
 
 	ck_epoch_synchronize_wait(&linux_epoch,



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