Ted Unangst wrote:
> Martin Pieuchot wrote:
> > I'd like to improve the fairness of the scheduler, with the goal of
> > mitigating userland starvations. For that the kernel needs to have
> > a better understanding of the amount of executed time per task.
> >
> > The smallest interval currently usable on all our architectures for
> > such accounting is a tick. With the current HZ value of 100, this
> > smallest interval is 10ms. I'd like to bump this value to 1000.
>
> Maybe we want this too, for sh? This looks like accidental netbsd copying. Or
> are we intentionally resetting hz on sh for some reason?
apparently yes because the clock only works at 64hz. is the conf file a better
place for that, instead of having two separate ifndef initializers with
different values? that troubles me, even if it seems to work.
just define HZ=64 in the right place.
Index: arch/landisk/conf/GENERIC
===================================================================
RCS file: /cvs/src/sys/arch/landisk/conf/GENERIC,v
retrieving revision 1.51
diff -u -p -r1.51 GENERIC
--- arch/landisk/conf/GENERIC 28 Jun 2016 04:41:37 -0000 1.51
+++ arch/landisk/conf/GENERIC 14 Aug 2017 20:56:29 -0000
@@ -21,6 +21,8 @@ option PCLOCK=33333333 # 33.33MHz clo
option DONT_INIT_BSC
#option DONT_INIT_PCIBSC
+option HZ=64
+
option PCIVERBOSE
option USER_PCICONF # user-space PCI configuration
option USBVERBOSE
>
>
> Index: arch/sh/sh/clock.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/sh/sh/clock.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 clock.c
> --- arch/sh/sh/clock.c 5 Mar 2016 17:16:33 -0000 1.9
> +++ arch/sh/sh/clock.c 14 Aug 2017 20:49:31 -0000
> @@ -47,9 +47,6 @@
>
> #define NWDOG 0
>
> -#ifndef HZ
> -#define HZ 64
> -#endif
> #define MINYEAR 2002 /* "today" */
> #define SH_RTC_CLOCK 16384 /* Hz */
>
> @@ -231,10 +228,6 @@ cpu_initclocks(void)
> {
> if (sh_clock.pclock == 0)
> panic("No PCLOCK information.");
> -
> - /* Set global variables. */
> - hz = HZ;
> - tick = 1000000 / hz;
>
> /*
> * Use TMU channel 0 as hard clock
>