Re: Periodic rant about SCHED_ULE

From: Rozhuk Ivan <rozhuk.im_at_gmail.com>
Date: Thu, 08 Jul 2021 07:19:07 UTC
On Wed, 7 Jul 2021 13:47:47 -0400
George Mitchell <george+freebsd@m5p.com> wrote:

> CPU: AMD Ryzen 5 2600X Six-Core Processor (3600.10-MHz K8-class CPU)
> (12 threads).
> 
> FreeBSD 12.2-RELEASE-p7 r369865 GENERIC  amd64 (SCHED_ULE) vs
> FreeBSD 12.2-RELEASE-p7 r369865 M5P  amd64 (SCHED_4BSD).
> 
> Comparing "make buildworld" time with misc/dnetc running vs not
> running. (misc/dnetc is your basic 100% compute-bound task, running
> at nice 20.)
> 
> Three out of the four combinations build in roughly four hours, but
> SCHED_ULE with dnetc running takes close to twelve!  (And that was
> overnight with basically nothing else running.)  This is an even
> worse disparity than I have seen in previous releases.

I do not use dnetc, but shed_ule on 2700 compile wold faster than 4 hours.
With ccache it takes ~10 minutes: world+kernel build and install and update loaders.


# Make an SMP-capable kernel by default
options		SMP			#b Symmetric MultiProcessor Kernel
options 	NUMA			#o Non-Uniform Memory Architecture support
options		EARLY_AP_STARTUP	#o 

device		cpufreq			#m for non-ACPI CPU frequency control
device		cpuctl			#m Provides access to MSRs, CPUID info and microcode update feature.


# Kernel base
options		SCHED_ULE		#b 4BSD/ULE scheduler
options		_KPOSIX_PRIORITY_SCHEDULING #b POSIX P1003_1B real-time extensions
options		PREEMPTION		#b Enable kernel thread preemption


and sysctl tunings on desktop only:
# SCHEDULER
kern.sched.steal_thresh=1		# Minimum load on remote CPU before we'll steal // workaround for freezes
kern.sched.balance=0			# Enables the long-term load balancer
kern.sched.balance_interval=1000	# Average period in stathz ticks to run the long-term balancer
kern.sched.affinity=10000		# Number of hz ticks to keep thread affinity for