Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 May 2018 18:27:17 +0000 (UTC)
From:      Matt Macy <mmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333808 - head/sys/kern
Message-ID:  <201805181827.w4IIRHum023540@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmacy
Date: Fri May 18 18:27:17 2018
New Revision: 333808
URL: https://svnweb.freebsd.org/changeset/base/333808

Log:
  epoch(9): assert that epoch is allocated post-configure

Modified:
  head/sys/kern/subr_epoch.c

Modified: head/sys/kern/subr_epoch.c
==============================================================================
--- head/sys/kern/subr_epoch.c	Fri May 18 17:58:15 2018	(r333807)
+++ head/sys/kern/subr_epoch.c	Fri May 18 18:27:17 2018	(r333808)
@@ -267,8 +267,9 @@ epoch_enter_preempt_internal(epoch_t epoch, struct thr
 {
 	struct epoch_pcpu_state *eps;
 
-	MPASS(epoch->e_flags & EPOCH_PREEMPT);
+	MPASS(cold || epoch != NULL);
 	INIT_CHECK(epoch);
+	MPASS(epoch->e_flags & EPOCH_PREEMPT);
 	critical_enter();
 	td->td_pre_epoch_prio = td->td_priority;
 	eps = epoch->e_pcpu[curcpu];
@@ -300,6 +301,7 @@ epoch_enter(epoch_t epoch)
 	ck_epoch_section_t *section;
 	struct thread *td;
 
+	MPASS(cold || epoch != NULL);
 	section = NULL;
 	td = curthread;
 	critical_enter();
@@ -495,6 +497,8 @@ epoch_wait_preempt(epoch_t epoch)
 
 	locks = curthread->td_locks;
 #endif
+
+	MPASS(cold || epoch != NULL);
 	INIT_CHECK(epoch);
 
 	MPASS(epoch->e_flags & EPOCH_PREEMPT);
@@ -548,6 +552,8 @@ void
 epoch_wait(epoch_t epoch)
 {
 
+	MPASS(cold || epoch != NULL);
+	INIT_CHECK(epoch);
 	MPASS(epoch->e_flags == 0);
 	critical_enter();
 	ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler, NULL);



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