Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Nov 2018 23:45:38 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340417 - head/sys/kern
Message-ID:  <201811132345.wADNjc8N089391@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Nov 13 23:45:38 2018
New Revision: 340417
URL: https://svnweb.freebsd.org/changeset/base/340417

Log:
  With epoch not inlined, there is no point in using _lite KPI. While here,
  remove some unnecessary casts.

Modified:
  head/sys/kern/genoffset.c
  head/sys/kern/subr_epoch.c

Modified: head/sys/kern/genoffset.c
==============================================================================
--- head/sys/kern/genoffset.c	Tue Nov 13 23:44:27 2018	(r340416)
+++ head/sys/kern/genoffset.c	Tue Nov 13 23:45:38 2018	(r340417)
@@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/assym.h>
 #include <sys/proc.h>
 
-OFFSYM(td_pre_epoch_prio, thread, u_char);
 OFFSYM(td_priority, thread, u_char);
 OFFSYM(td_epochnest, thread, u_char);
 OFFSYM(td_critnest, thread, u_int);

Modified: head/sys/kern/subr_epoch.c
==============================================================================
--- head/sys/kern/subr_epoch.c	Tue Nov 13 23:44:27 2018	(r340416)
+++ head/sys/kern/subr_epoch.c	Tue Nov 13 23:45:38 2018	(r340417)
@@ -240,7 +240,7 @@ void
 epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et)
 {
 	struct epoch_record *er;
-	struct thread_lite *td;
+	struct thread *td;
 
 	MPASS(cold || epoch != NULL);
 	INIT_CHECK(epoch);
@@ -249,11 +249,11 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et)
 	et->et_magic_pre = EPOCH_MAGIC0;
 	et->et_magic_post = EPOCH_MAGIC1;
 #endif
-	td = (struct thread_lite *)curthread;
-	et->et_td = (void*)td;
+	td = curthread;
+	et->et_td = td;
 	td->td_epochnest++;
 	critical_enter();
-	sched_pin_lite(td);
+	sched_pin();
 
 	td->td_pre_epoch_prio = td->td_priority;
 	er = epoch_currecord(epoch);
@@ -265,12 +265,12 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et)
 void
 epoch_enter(epoch_t epoch)
 {
-	struct thread_lite *td;
+	struct thread *td;
 	epoch_record_t er;
 
 	MPASS(cold || epoch != NULL);
 	INIT_CHECK(epoch);
-	td = (struct thread_lite *)curthread;
+	td = curthread;
 
 	td->td_epochnest++;
 	critical_enter();
@@ -282,18 +282,18 @@ void
 epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et)
 {
 	struct epoch_record *er;
-	struct thread_lite *td;
+	struct thread *td;
 
 	INIT_CHECK(epoch);
-	td = (struct thread_lite *)curthread;
+	td = curthread;
 	critical_enter();
-	sched_unpin_lite(td);
+	sched_unpin();
 	MPASS(td->td_epochnest);
 	td->td_epochnest--;
 	er = epoch_currecord(epoch);
 	MPASS(epoch->e_flags & EPOCH_PREEMPT);
 	MPASS(et != NULL);
-	MPASS(et->et_td == (struct thread *)td);
+	MPASS(et->et_td == td);
 #ifdef EPOCH_TRACKER_DEBUG
 	MPASS(et->et_magic_pre == EPOCH_MAGIC0);
 	MPASS(et->et_magic_post == EPOCH_MAGIC1);
@@ -307,18 +307,18 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et)
 	TAILQ_REMOVE(&er->er_tdlist, et, et_link);
 	er->er_gen++;
 	if (__predict_false(td->td_pre_epoch_prio != td->td_priority))
-		epoch_adjust_prio((struct thread *)td, td->td_pre_epoch_prio);
+		epoch_adjust_prio(td, td->td_pre_epoch_prio);
 	critical_exit();
 }
 
 void
 epoch_exit(epoch_t epoch)
 {
-	struct thread_lite *td;
+	struct thread *td;
 	epoch_record_t er;
 
 	INIT_CHECK(epoch);
-	td = (struct thread_lite *)curthread;
+	td = curthread;
 	MPASS(td->td_epochnest);
 	td->td_epochnest--;
 	er = epoch_currecord(epoch);



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