Date: Wed, 18 Dec 2019 09:30:33 +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: r355879 - in head/sys: compat/linuxkpi/common/src kern Message-ID: <201912180930.xBI9UXBn067572@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912180930.xBI9UXBn067572>