svn commit: r355879 - in head/sys: compat/linuxkpi/common/src kern

Hans Petter Selasky hselasky at FreeBSD.org
Wed Dec 18 09:30:33 UTC 2019


Author: hselasky
Date: Wed Dec 18 09:30:32 2019
New Revision: 355879
URL: https://svnweb.freebsd.org/changeset/base/355879

Log:
  Restore important comment in RCU/EPOCH support in FreeBSD after r355784.
  
  Sponsored by:	Mellanox Technologies

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

Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_rcu.c	Wed Dec 18 08:39:24 2019	(r355878)
+++ head/sys/compat/linuxkpi/common/src/linux_rcu.c	Wed Dec 18 09:30:32 2019	(r355879)
@@ -259,6 +259,15 @@ linux_synchronize_rcu_cb(ck_epoch_t *epoch __unused, c
 			sched_prio(td, prio);
 			/* task switch */
 			mi_switch(SW_VOL | SWT_RELINQUISH);
+			/*
+			 * It is important the thread lock is dropped
+			 * while yielding to allow other threads to
+			 * acquire the lock pointed to by
+			 * TDQ_LOCKPTR(td). Currently mi_switch() will
+			 * unlock the thread lock before
+			 * returning. Else a deadlock like situation
+			 * might happen.
+			 */
 			thread_lock(td);
 		}
 	} else {

Modified: head/sys/kern/subr_epoch.c
==============================================================================
--- head/sys/kern/subr_epoch.c	Wed Dec 18 08:39:24 2019	(r355878)
+++ head/sys/kern/subr_epoch.c	Wed Dec 18 09:30:32 2019	(r355879)
@@ -578,6 +578,13 @@ epoch_block_handler_preempt(struct ck_epoch *global __
 	 */
 	counter_u64_add(switch_count, 1);
 	mi_switch(SW_VOL | SWT_RELINQUISH);
+	/*
+	 * It is important the thread lock is dropped while yielding
+	 * to allow other threads to acquire the lock pointed to by
+	 * TDQ_LOCKPTR(td). Currently mi_switch() will unlock the
+	 * thread lock before returning. Else a deadlock like
+	 * situation might happen.
+	 */
 	thread_lock(td);
 }
 


More information about the svn-src-head mailing list