From a28c28e6efa71519e61c7c270168f330e6370862 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 19 Nov 2020 02:50:48 +0000 Subject: [PATCH] Remove NO_EVENTTIMERS support The arm configs that required it have been removed from the tree. Removing this option makes the callout code easier to read and discourages developers from adding new configs without eventtimer drivers. Reviewed by: ian, imp, mav Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27270 --- sys/arm/arm/machdep.c | 21 --------------------- sys/arm/include/machdep.h | 1 - sys/conf/options | 1 - sys/conf/options.arm | 2 -- sys/kern/kern_et.c | 4 ---- sys/kern/kern_timeout.c | 22 +++------------------- 6 files changed, 3 insertions(+), 48 deletions(-) diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index 4a9822f9083..7b4974a839d 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -48,7 +48,6 @@ #include "opt_kstack_pages.h" #include "opt_platform.h" #include "opt_sched.h" -#include "opt_timer.h" #include __FBSDID("$FreeBSD$"); @@ -304,16 +303,12 @@ cpu_idle(int busy) CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); spinlock_enter(); -#ifndef NO_EVENTTIMERS if (!busy) cpu_idleclock(); -#endif if (!sched_runnable()) cpu_sleep(0); -#ifndef NO_EVENTTIMERS if (!busy) cpu_activeclock(); -#endif spinlock_exit(); CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); } @@ -325,21 +320,6 @@ cpu_idle_wakeup(int cpu) return (0); } -#ifdef NO_EVENTTIMERS -/* - * Most ARM platforms don't need to do anything special to init their clocks - * (they get intialized during normal device attachment), and by not defining a - * cpu_initclocks() function they get this generic one. Any platform that needs - * to do something special can just provide their own implementation, which will - * override this one due to the weak linkage. - */ -void -arm_generic_initclocks(void) -{ -} -__weak_reference(arm_generic_initclocks, cpu_initclocks); - -#else void cpu_initclocks(void) { @@ -353,7 +333,6 @@ cpu_initclocks(void) cpu_initclocks_bsp(); #endif } -#endif #ifdef PLATFORM void diff --git a/sys/arm/include/machdep.h b/sys/arm/include/machdep.h index ebaff1a48a0..d82b1363632 100644 --- a/sys/arm/include/machdep.h +++ b/sys/arm/include/machdep.h @@ -39,7 +39,6 @@ vm_offset_t parse_boot_param(struct arm_boot_params *abp); void arm_parse_fdt_bootargs(void); void arm_print_kenv(void); -void arm_generic_initclocks(void); int arm_get_vfpstate(struct thread *td, void *args); /* Board-specific attributes */ diff --git a/sys/conf/options b/sys/conf/options index 9df829867b6..c2773adee47 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -180,7 +180,6 @@ NEW_PCIB opt_global.h NO_ADAPTIVE_MUTEXES opt_adaptive_mutexes.h NO_ADAPTIVE_RWLOCKS NO_ADAPTIVE_SX -NO_EVENTTIMERS opt_timer.h NO_OBSOLETE_CODE opt_global.h NO_SYSCTL_DESCR opt_global.h NSWBUF_MIN opt_param.h diff --git a/sys/conf/options.arm b/sys/conf/options.arm index 0bf0a61ac43..9522c52350e 100644 --- a/sys/conf/options.arm +++ b/sys/conf/options.arm @@ -6,7 +6,6 @@ ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h ARM_MANY_BOARD opt_global.h ARM_WANT_TP_ADDRESS opt_global.h -COUNTS_PER_SEC opt_timer.h CPSW_ETHERSWITCH opt_cpsw.h CPU_ARM9E opt_global.h CPU_ARM1176 opt_global.h @@ -61,7 +60,6 @@ SOC_ROCKCHIP_RK3188 opt_global.h SOC_TI_AM335X opt_global.h SOC_TEGRA2 opt_global.h XSCALE_CACHE_READ_WRITE_ALLOCATE opt_global.h -XSACLE_DISABLE_CCNT opt_timer.h VERBOSE_INIT_ARM opt_global.h VM_MAXUSER_ADDRESS opt_global.h GFB_DEBUG opt_gfb.h diff --git a/sys/kern/kern_et.c b/sys/kern/kern_et.c index 7647773e28a..6b0052c07b4 100644 --- a/sys/kern/kern_et.c +++ b/sys/kern/kern_et.c @@ -37,8 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_timer.h" - SLIST_HEAD(et_eventtimers_list, eventtimer); static struct et_eventtimers_list eventtimers = SLIST_HEAD_INITIALIZER(et_eventtimers); @@ -130,9 +128,7 @@ void et_change_frequency(struct eventtimer *et, uint64_t newfreq) { -#ifndef NO_EVENTTIMERS cpu_et_frequency(et, newfreq); -#endif } /* diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index dae56ad2d53..f242c92adf1 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include "opt_callout_profiling.h" #include "opt_ddb.h" -#if defined(__arm__) -#include "opt_timer.h" -#endif #include "opt_rss.h" #include @@ -74,9 +71,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifndef NO_EVENTTIMERS DPCPU_DECLARE(sbintime_t, hardclocktime); -#endif SDT_PROVIDER_DEFINE(callout_execute); SDT_PROBE_DEFINE1(callout_execute, , , callout__start, "struct callout *"); @@ -527,9 +522,8 @@ callout_process(sbintime_t now) */ } while (((int)(firstb - lastb)) <= 0); cc->cc_firstevent = last; -#ifndef NO_EVENTTIMERS cpu_new_callout(curcpu, last, first); -#endif + #ifdef CALLOUT_PROFILING avg_depth_dir += (depth_dir * 1000 - avg_depth_dir) >> 8; avg_mpcalls_dir += (mpcalls_dir * 1000 - avg_mpcalls_dir) >> 8; @@ -594,7 +588,7 @@ callout_cc_add(struct callout *c, struct callout_cpu *cc, LIST_INSERT_HEAD(&cc->cc_callwheel[bucket], c, c_links.le); if (cc->cc_bucket == bucket) cc_exec_next(cc) = c; -#ifndef NO_EVENTTIMERS + /* * Inform the eventtimers(4) subsystem there's a new callout * that has been inserted, but only if really required. @@ -606,7 +600,6 @@ callout_cc_add(struct callout *c, struct callout_cpu *cc, cc->cc_firstevent = sbt; cpu_new_callout(cpu, sbt, c->c_time); } -#endif } static void @@ -851,15 +844,7 @@ callout_when(sbintime_t sbt, sbintime_t precision, int flags, } if ((flags & C_HARDCLOCK) != 0 && sbt < tick_sbt) sbt = tick_sbt; - if ((flags & C_HARDCLOCK) != 0 || -#ifdef NO_EVENTTIMERS - sbt >= sbt_timethreshold) { - to_sbt = getsbinuptime(); - - /* Add safety belt for the case of hz > 1000. */ - to_sbt += tc_tick_sbt - tick_sbt; -#else - sbt >= sbt_tickthreshold) { + if ((flags & C_HARDCLOCK) != 0 || sbt >= sbt_tickthreshold) { /* * Obtain the time of the last hardclock() call on * this CPU directly from the kern_clocksource.c. @@ -872,7 +857,6 @@ callout_when(sbintime_t sbt, sbintime_t precision, int flags, spinlock_enter(); to_sbt = DPCPU_GET(hardclocktime); spinlock_exit(); -#endif #endif if (cold && to_sbt == 0) to_sbt = sbinuptime(); -- 2.45.0