Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 May 2018 16:03:52 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333983 - head/sys/kern
Message-ID:  <201805211603.w4LG3qJb054461@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon May 21 16:03:51 2018
New Revision: 333983
URL: https://svnweb.freebsd.org/changeset/base/333983

Log:
  Don't pass a section cookie to CK for non-preemptible epoch sections.
  
  They're only useful when multiple threads may share an epoch record,
  and that can't happen with non-preemptible sections.
  
  Reviewed by:	mmacy
  Differential Revision:	https://reviews.freebsd.org/D15507

Modified:
  head/sys/kern/subr_epoch.c

Modified: head/sys/kern/subr_epoch.c
==============================================================================
--- head/sys/kern/subr_epoch.c	Mon May 21 15:06:19 2018	(r333982)
+++ head/sys/kern/subr_epoch.c	Mon May 21 16:03:51 2018	(r333983)
@@ -298,18 +298,15 @@ void
 epoch_enter(epoch_t epoch)
 {
 	ck_epoch_record_t *record;
-	ck_epoch_section_t *section;
 	struct thread *td;
 
 	MPASS(cold || epoch != NULL);
-	section = NULL;
 	td = curthread;
-	critical_enter();
-	if (__predict_true(td->td_epochnest++ == 0))
-		section = (ck_epoch_section_t*)&td->td_epoch_section;
 
+	critical_enter();
+	td->td_epochnest++;
 	record = &epoch->e_pcpu[curcpu]->eps_record.er_record;
-	ck_epoch_begin(record, section);
+	ck_epoch_begin(record, NULL);
 }
 
 void
@@ -339,16 +336,12 @@ void
 epoch_exit(epoch_t epoch)
 {
 	ck_epoch_record_t *record;
-	ck_epoch_section_t *section;
 	struct thread *td;
 
-	section = NULL;
 	td = curthread;
-	MPASS(td->td_critnest);
-	if (__predict_true(td->td_epochnest-- == 1))
-		section = (ck_epoch_section_t*)&td->td_epoch_section;
+	td->td_epochnest--;
 	record = &epoch->e_pcpu[curcpu]->eps_record.er_record;
-	ck_epoch_end(record, section);
+	ck_epoch_end(record, NULL);
 	critical_exit();
 }
 



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