Compare commits
40 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
35a7d9ab50 | ||
|
77002f1406 | ||
|
83660b78a6 | ||
|
9f55fbf7f5 | ||
|
d03c960e18 | ||
|
c94b9cca51 | ||
|
dfd8a7f877 | ||
|
18aabc9f62 | ||
|
ce12bdcc7f | ||
|
f131173680 | ||
|
b8835ca202 | ||
|
de5400ddde | ||
|
d4bace1676 | ||
|
b108b3a8d2 | ||
|
9949ffb1d0 | ||
|
0b7c5dfa72 | ||
|
75ea27821f | ||
|
f5cd3ea3b3 | ||
|
81c14e1950 | ||
|
081d3097a0 | ||
|
be8c8e8230 | ||
|
86d2ec1f79 | ||
|
eb2be11b19 | ||
|
aaa7b3d556 | ||
|
aa69546f01 | ||
|
accb6d07f4 | ||
|
f79f7ddb8e | ||
|
4201196110 | ||
|
8b0d439206 | ||
|
8316a6970a | ||
|
c171d77094 | ||
|
16c81fb013 | ||
|
1882fa3bd9 | ||
|
c4ceba207d | ||
|
a380d532bc | ||
|
b82abcf5f6 | ||
|
1084ad5ba1 | ||
|
1e4b8fb627 | ||
|
02132367d6 | ||
|
1c4fece830 |
5
PKGBUILD
5
PKGBUILD
@@ -31,7 +31,6 @@ _distro="Arch"
|
||||
declare -p -x > current_env
|
||||
|
||||
source "$_where"/customization.cfg # load default configuration from file
|
||||
source "$_where"/linux-tkg-config/prepare
|
||||
|
||||
if [ -e "$_EXT_CONFIG_PATH" ]; then
|
||||
msg2 "External configuration file $_EXT_CONFIG_PATH will be used and will override customization.cfg values."
|
||||
@@ -40,6 +39,8 @@ fi
|
||||
|
||||
source current_env
|
||||
|
||||
source "$_where"/linux-tkg-config/prepare
|
||||
|
||||
# Make sure we're in a clean state
|
||||
if [ ! -e "$_where"/BIG_UGLY_FROGMINER ]; then
|
||||
_tkg_initscript
|
||||
@@ -56,7 +57,7 @@ else
|
||||
fi
|
||||
pkgname=("${pkgbase}" "${pkgbase}-headers")
|
||||
pkgver="${_basekernel}"."${_sub}"
|
||||
pkgrel=271
|
||||
pkgrel=272
|
||||
pkgdesc='Linux-tkg'
|
||||
arch=('x86_64') # no i686 in here
|
||||
url="https://www.kernel.org/"
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# Linux distribution you are using, options are "Arch", "Void", "Ubuntu", "Debian", "Fedora", "Suse", "Gentoo", "Generic".
|
||||
# It is automatically set to "Arch" when using PKGBUILD.
|
||||
# If left empty, the script will prompt
|
||||
_distro=""
|
||||
_distro="Arch"
|
||||
|
||||
# Kernel Version - Options are "5.4", and from "5.7" to "5.19"
|
||||
# you can also set a specific kernel version, e.g. "6.0-rc4" or "5.10.51",
|
||||
@@ -20,7 +20,7 @@ _EXT_CONFIG_PATH=~/.config/frogminer/linux-tkg.cfg
|
||||
# Default is "true".
|
||||
_NUKR="true"
|
||||
|
||||
# Git mirror to use to get the kernel sources, possible values are "kernel.org", "googlesource.com" and "github.com"
|
||||
# Git mirror to use to get the kernel sources, possible values are "kernel.org", "googlesource.com", "github.com" and "torvalds"
|
||||
_git_mirror="kernel.org"
|
||||
|
||||
# Custom compiler root dirs - Leave empty to use system compilers
|
||||
@@ -32,7 +32,7 @@ CUSTOM_GCC_PATH=""
|
||||
CUSTOM_LLVM_PATH=""
|
||||
|
||||
# Set to true to bypass makepkg.conf and use all available threads for compilation. False will respect your makepkg.conf options.
|
||||
_force_all_threads="true"
|
||||
_force_all_threads="false"
|
||||
|
||||
# Set to true to prevent ccache from being used and set CONFIG_GCC_PLUGINS=y (which needs to be disabled for ccache to work properly)
|
||||
_noccache="false"
|
||||
@@ -46,10 +46,10 @@ _modprobeddb="false"
|
||||
_modprobeddb_db_path=~/.config/modprobed.db
|
||||
|
||||
# Set to "1" to call make menuconfig, "2" to call make nconfig, "3" to call make xconfig, before building the kernel. Set to false to disable and skip the prompt.
|
||||
_menunconfig=""
|
||||
_menunconfig="false"
|
||||
|
||||
# Set to true to generate a kernel config fragment from your changes in menuconfig/nconfig. Set to false to disable and skip the prompt.
|
||||
_diffconfig=""
|
||||
_diffconfig="false"
|
||||
|
||||
# Set to the file name where the generated config fragment should be written to. Only used if _diffconfig is active.
|
||||
_diffconfig_name=""
|
||||
@@ -90,11 +90,11 @@ _STRIP="true"
|
||||
# LEAVE AN EMPTY VALUE TO BE PROMPTED ABOUT FOLLOWING OPTIONS AT BUILD TIME
|
||||
|
||||
# CPU scheduler - Options are "upds" (TkG's Undead PDS), "pds", "bmq", "muqss", "cacule" or "cfs" (kernel's default)
|
||||
_cpusched=""
|
||||
_cpusched="pds"
|
||||
|
||||
# Compiler to use - Options are "gcc" or "llvm".
|
||||
# For advanced users.
|
||||
_compiler=""
|
||||
_compiler="gcc"
|
||||
|
||||
# Force the use of the LLVM Integrated Assembler whether using LLVM, LTO or not.
|
||||
# Set to "1" to enable.
|
||||
@@ -124,7 +124,7 @@ _preempt_rt_force=""
|
||||
# For BMQ: 0: No yield.
|
||||
# 1: Deboost and requeue task. (Default)
|
||||
# 2: Set rq skip task.
|
||||
_sched_yield_type=""
|
||||
_sched_yield_type="0"
|
||||
|
||||
# Round Robin interval is the longest duration two tasks with the same nice level will be delayed for. When CPU time is requested by a task, it receives a time slice equal
|
||||
# to the rr_interval in addition to a virtual deadline. When using yield_type 2, a low value can help offset the disadvantages of rescheduling a process that has yielded.
|
||||
@@ -132,7 +132,7 @@ _sched_yield_type=""
|
||||
# PDS default: 4ms"
|
||||
# BMQ default: 2ms"
|
||||
# Set to "1" for 2ms, "2" for 4ms, "3" for 6ms, "4" for 8ms, or "default" to keep the chosen scheduler defaults.
|
||||
_rr_interval=""
|
||||
_rr_interval="2"
|
||||
|
||||
# Set to "true" to disable FUNCTION_TRACER/GRAPH_TRACER, lowering overhead but limiting debugging and analyzing of kernel functions - Kernel default is "false"
|
||||
_ftracedisable="false"
|
||||
@@ -144,11 +144,13 @@ _numadisable="false"
|
||||
_misc_adds="true"
|
||||
|
||||
# Set to "0" for periodic ticks, "1" to use CattaRappa mode (enabling full tickless) and "2" for tickless idle only.
|
||||
# Full tickless can give higher performances in various cases but, depending on hardware, lower consistency. Just tickless idle can perform better on some platforms (mostly AMD based).
|
||||
_tickless=""
|
||||
# Full tickless can give higher performances in case you use isolation of CPUs for tasks
|
||||
# and it works only when using the nohz_full kernel parameter, otherwise behaves like idle.
|
||||
# Just tickless idle perform better for most platforms.
|
||||
_tickless="2"
|
||||
|
||||
# Set to "true" to use ACS override patch - https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29 - Kernel default is "false"
|
||||
_acs_override=""
|
||||
_acs_override="false"
|
||||
|
||||
# Set to "true" to add Bcache filesystem support. You'll have to install bcachefs-tools-git from AUR for utilities - https://bcachefs.org/ - If in doubt, set to "false"
|
||||
# This can be buggy and isn't recommended on a production machine, also enabling this option will not allow you to enable MGLRU.
|
||||
@@ -177,17 +179,17 @@ _futex_waitv="false"
|
||||
_winesync="false"
|
||||
|
||||
# Set to "true" to enable Binder and Ashmem, the kernel modules required to use the android emulator Anbox. ! This doesn't apply to 5.4.y !
|
||||
_anbox=""
|
||||
_anbox="false"
|
||||
|
||||
# A selection of patches from Zen/Liquorix kernel and additional tweaks for a better gaming experience (ZENIFY) - Default is "true"
|
||||
_zenify="true"
|
||||
|
||||
# compiler optimization level - 1. Optimize for performance (-O2); 2. Optimize harder (-O3); 3. Optimize for size (-Os) - Kernel default is "1"
|
||||
_compileroptlevel="1"
|
||||
_compileroptlevel="2"
|
||||
|
||||
# CPU compiler optimizations - Defaults to prompt at kernel config if left empty
|
||||
# AMD CPUs : "k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver" "steamroller" "excavator" "zen" "zen2" "zen3" (zen3 opt support depends on GCC11)
|
||||
# Intel CPUs : "mpsc"(P4 & older Netburst based Xeon) "atom" "core2" "nehalem" "westmere" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake" "cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake"
|
||||
# AMD CPUs : "k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver" "steamroller" "excavator" "zen" "zen2" "zen3" "zen4" (zen3 opt support depends on GCC11) (zen4 opt support depends on GCC13)
|
||||
# Intel CPUs : "mpsc"(P4 & older Netburst based Xeon) "atom" "core2" "nehalem" "westmere" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake" "cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake" "raptorlake" "meteorlake" (raptorlake and meteorlake opt support require GCC13)
|
||||
# Other options :
|
||||
# - "native_amd" (use compiler autodetection - Selecting your arch manually in the list above is recommended instead of this option)
|
||||
# - "native_intel" (use compiler autodetection and will prompt for P6_NOPS - Selecting your arch manually in the list above is recommended instead of this option)
|
||||
@@ -197,7 +199,7 @@ _compileroptlevel="1"
|
||||
# - "generic_v2" (depends on GCC11 - to share the package between machines with different CPU µarch supporting at least x86-64-v2
|
||||
# - "generic_v3" (depends on GCC11 - to share the package between machines with different CPU µarch supporting at least x86-64-v3
|
||||
# - "generic_v4" (depends on GCC11 - to share the package between machines with different CPU µarch supporting at least x86-64-v4
|
||||
_processor_opt=""
|
||||
_processor_opt="skylake"
|
||||
|
||||
# MuQSS only - Make IRQ threading compulsory (FORCE_IRQ_THREADING) - Default is "false"
|
||||
_irq_threading="false"
|
||||
@@ -213,17 +215,17 @@ _cacule_rdb_interval="19"
|
||||
_tt_high_hz="false"
|
||||
|
||||
# MuQSS and PDS only - SMT (Hyperthreading) aware nice priority and policy support (SMT_NICE) - Kernel default is "true" - You can disable this on non-SMT/HT CPUs for lower overhead
|
||||
_smt_nice=""
|
||||
_smt_nice="true"
|
||||
|
||||
# Trust the CPU manufacturer to initialize Linux's CRNG (RANDOM_TRUST_CPU) - Kernel default is "false"
|
||||
_random_trust_cpu="false"
|
||||
_random_trust_cpu="true"
|
||||
|
||||
# MuQSS only - CPU scheduler runqueue sharing - No sharing (RQ_NONE), SMT (hyperthread) siblings (RQ_SMT), Multicore siblings (RQ_MC), Symmetric Multi-Processing (RQ_SMP), NUMA (RQ_ALL)
|
||||
# Valid values are "none", "smt", "mc", "mc-llc"(for zen), "smp", "all" - Kernel default is "smt"
|
||||
_runqueue_sharing=""
|
||||
|
||||
# Timer frequency - "100" "250" "300" "500" "750" "1000" ("2000" is available for cacule cpusched only) - More options available in kernel config prompt when left empty depending on selected cpusched with the default option pointed with a ">" (2000 for cacule, 100 for muqss and 1000 for other cpu schedulers)
|
||||
_timer_freq=""
|
||||
_timer_freq="500"
|
||||
|
||||
# Default CPU governor - "performance", "ondemand", "schedutil" or leave empty for default (schedutil)
|
||||
_default_cpu_gov="ondemand"
|
||||
|
@@ -44,6 +44,12 @@ plain() {
|
||||
|
||||
declare -p -x > current_env
|
||||
source customization.cfg
|
||||
|
||||
if [ -e "$_EXT_CONFIG_PATH" ]; then
|
||||
msg2 "External configuration file $_EXT_CONFIG_PATH will be used and will override customization.cfg values."
|
||||
source "$_EXT_CONFIG_PATH"
|
||||
fi
|
||||
|
||||
. current_env
|
||||
|
||||
source linux-tkg-config/prepare
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Linux/x86 6.0.0-arch1 Kernel Configuration
|
||||
# Linux/x86 6.0.5-arch1 Kernel Configuration
|
||||
#
|
||||
CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0"
|
||||
CONFIG_CC_IS_GCC=y
|
||||
@@ -17,7 +17,7 @@ CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
|
||||
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
|
||||
CONFIG_CC_HAS_ASM_INLINE=y
|
||||
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
|
||||
CONFIG_PAHOLE_VERSION=123
|
||||
CONFIG_PAHOLE_VERSION=124
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_BUILDTIME_TABLE_SORT=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
@@ -7596,6 +7596,7 @@ CONFIG_HID_SMARTJOYPLUS=m
|
||||
CONFIG_SMARTJOYPLUS_FF=y
|
||||
CONFIG_HID_TIVO=m
|
||||
CONFIG_HID_TOPSEED=m
|
||||
CONFIG_HID_TOPRE=m
|
||||
CONFIG_HID_THINGM=m
|
||||
CONFIG_HID_THRUSTMASTER=m
|
||||
CONFIG_THRUSTMASTER_FF=y
|
||||
@@ -10374,6 +10375,7 @@ CONFIG_LSM="landlock,lockdown,yama,integrity,bpf"
|
||||
# Memory initialization
|
||||
#
|
||||
CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y
|
||||
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y
|
||||
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
|
||||
# CONFIG_INIT_STACK_NONE is not set
|
||||
# CONFIG_INIT_STACK_ALL_PATTERN is not set
|
||||
@@ -10849,6 +10851,7 @@ CONFIG_DEBUG_KERNEL=y
|
||||
# Compile-time checks and compiler options
|
||||
#
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_AS_HAS_NON_CONST_LEB128=y
|
||||
# CONFIG_DEBUG_INFO_NONE is not set
|
||||
# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
|
||||
# CONFIG_DEBUG_INFO_DWARF4 is not set
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Linux/x86 6.1.0-rc1 Kernel Configuration
|
||||
# Linux/x86 6.1.0-arch1 Kernel Configuration
|
||||
#
|
||||
CONFIG_CC_VERSION_TEXT="gcc (TkG-mostlyportable) 12.2.1 20220822"
|
||||
CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0"
|
||||
CONFIG_CC_IS_GCC=y
|
||||
CONFIG_GCC_VERSION=120201
|
||||
CONFIG_GCC_VERSION=120200
|
||||
CONFIG_CLANG_VERSION=0
|
||||
CONFIG_AS_IS_GNU=y
|
||||
CONFIG_AS_VERSION=23900
|
||||
@@ -17,7 +17,7 @@ CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
|
||||
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
|
||||
CONFIG_CC_HAS_ASM_INLINE=y
|
||||
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
|
||||
CONFIG_PAHOLE_VERSION=123
|
||||
CONFIG_PAHOLE_VERSION=124
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_BUILDTIME_TABLE_SORT=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
@@ -659,7 +659,7 @@ CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
|
||||
#
|
||||
CONFIG_X86_INTEL_PSTATE=y
|
||||
CONFIG_X86_PCC_CPUFREQ=m
|
||||
CONFIG_X86_AMD_PSTATE=m
|
||||
CONFIG_X86_AMD_PSTATE=y
|
||||
CONFIG_X86_AMD_PSTATE_UT=m
|
||||
CONFIG_X86_ACPI_CPUFREQ=m
|
||||
CONFIG_X86_ACPI_CPUFREQ_CPB=y
|
||||
@@ -1217,6 +1217,7 @@ CONFIG_INET_ESP=m
|
||||
CONFIG_INET_ESP_OFFLOAD=m
|
||||
CONFIG_INET_ESPINTCP=y
|
||||
CONFIG_INET_IPCOMP=m
|
||||
CONFIG_INET_TABLE_PERTURB_ORDER=16
|
||||
CONFIG_INET_XFRM_TUNNEL=m
|
||||
CONFIG_INET_TUNNEL=m
|
||||
CONFIG_INET_DIAG=m
|
||||
@@ -2638,7 +2639,7 @@ CONFIG_UACCE=m
|
||||
CONFIG_PVPANIC=y
|
||||
CONFIG_PVPANIC_MMIO=m
|
||||
CONFIG_PVPANIC_PCI=m
|
||||
# CONFIG_GP_PCI1XXXX is not set
|
||||
CONFIG_GP_PCI1XXXX=m
|
||||
# end of Misc devices
|
||||
|
||||
#
|
||||
@@ -3241,7 +3242,7 @@ CONFIG_NGBE=m
|
||||
CONFIG_TXGBE=m
|
||||
CONFIG_JME=m
|
||||
CONFIG_NET_VENDOR_ADI=y
|
||||
# CONFIG_ADIN1110 is not set
|
||||
CONFIG_ADIN1110=m
|
||||
CONFIG_NET_VENDOR_LITEX=y
|
||||
CONFIG_NET_VENDOR_MARVELL=y
|
||||
CONFIG_MVMDIO=m
|
||||
@@ -3272,7 +3273,7 @@ CONFIG_MLX5_TC_CT=y
|
||||
CONFIG_MLX5_TC_SAMPLE=y
|
||||
CONFIG_MLX5_CORE_EN_DCB=y
|
||||
CONFIG_MLX5_CORE_IPOIB=y
|
||||
# CONFIG_MLX5_EN_MACSEC is not set
|
||||
CONFIG_MLX5_EN_MACSEC=y
|
||||
CONFIG_MLX5_EN_IPSEC=y
|
||||
CONFIG_MLX5_EN_TLS=y
|
||||
CONFIG_MLX5_SW_STEERING=y
|
||||
@@ -3495,7 +3496,8 @@ CONFIG_DP83TD510_PHY=m
|
||||
CONFIG_VITESSE_PHY=m
|
||||
CONFIG_XILINX_GMII2RGMII=m
|
||||
CONFIG_MICREL_KS8995MA=m
|
||||
# CONFIG_PSE_CONTROLLER is not set
|
||||
CONFIG_PSE_CONTROLLER=y
|
||||
CONFIG_PSE_REGULATOR=m
|
||||
CONFIG_CAN_DEV=m
|
||||
CONFIG_CAN_VCAN=m
|
||||
CONFIG_CAN_VXCAN=m
|
||||
@@ -4090,7 +4092,7 @@ CONFIG_KEYBOARD_MCS=m
|
||||
CONFIG_KEYBOARD_MPR121=m
|
||||
CONFIG_KEYBOARD_NEWTON=m
|
||||
CONFIG_KEYBOARD_OPENCORES=m
|
||||
# CONFIG_KEYBOARD_PINEPHONE is not set
|
||||
CONFIG_KEYBOARD_PINEPHONE=m
|
||||
CONFIG_KEYBOARD_SAMSUNG=m
|
||||
CONFIG_KEYBOARD_STOWAWAY=m
|
||||
CONFIG_KEYBOARD_SUNKBD=m
|
||||
@@ -4330,7 +4332,7 @@ CONFIG_INPUT_PCAP=m
|
||||
CONFIG_INPUT_ADXL34X=m
|
||||
CONFIG_INPUT_ADXL34X_I2C=m
|
||||
CONFIG_INPUT_ADXL34X_SPI=m
|
||||
# CONFIG_INPUT_IBM_PANEL is not set
|
||||
CONFIG_INPUT_IBM_PANEL=m
|
||||
CONFIG_INPUT_IMS_PCU=m
|
||||
CONFIG_INPUT_IQS269A=m
|
||||
CONFIG_INPUT_IQS626A=m
|
||||
@@ -4344,7 +4346,7 @@ CONFIG_INPUT_DRV260X_HAPTICS=m
|
||||
CONFIG_INPUT_DRV2665_HAPTICS=m
|
||||
CONFIG_INPUT_DRV2667_HAPTICS=m
|
||||
CONFIG_INPUT_RAVE_SP_PWRBUTTON=m
|
||||
# CONFIG_INPUT_RT5120_PWRKEY is not set
|
||||
CONFIG_INPUT_RT5120_PWRKEY=m
|
||||
CONFIG_RMI4_CORE=m
|
||||
CONFIG_RMI4_I2C=m
|
||||
CONFIG_RMI4_SPI=m
|
||||
@@ -4454,7 +4456,7 @@ CONFIG_SERIAL_ARC_NR_PORTS=1
|
||||
CONFIG_SERIAL_RP2=m
|
||||
CONFIG_SERIAL_RP2_NR_UARTS=32
|
||||
CONFIG_SERIAL_FSL_LPUART=m
|
||||
# CONFIG_SERIAL_FSL_LPUART_CONSOLE is not set
|
||||
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
|
||||
CONFIG_SERIAL_FSL_LINFLEXUART=m
|
||||
CONFIG_SERIAL_MEN_Z135=m
|
||||
CONFIG_SERIAL_SPRD=m
|
||||
@@ -4491,7 +4493,7 @@ CONFIG_IPMI_IPMB=m
|
||||
CONFIG_IPMI_WATCHDOG=m
|
||||
CONFIG_IPMI_POWEROFF=m
|
||||
CONFIG_IPMB_DEVICE_INTERFACE=m
|
||||
CONFIG_HW_RANDOM=m
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_TIMERIOMEM=m
|
||||
CONFIG_HW_RANDOM_INTEL=m
|
||||
CONFIG_HW_RANDOM_AMD=m
|
||||
@@ -4518,10 +4520,10 @@ CONFIG_DEVPORT=y
|
||||
CONFIG_HPET=y
|
||||
# CONFIG_HPET_MMAP is not set
|
||||
CONFIG_HANGCHECK_TIMER=m
|
||||
CONFIG_TCG_TPM=m
|
||||
CONFIG_TCG_TPM=y
|
||||
CONFIG_HW_RANDOM_TPM=y
|
||||
CONFIG_TCG_TIS_CORE=m
|
||||
CONFIG_TCG_TIS=m
|
||||
CONFIG_TCG_TIS_CORE=y
|
||||
CONFIG_TCG_TIS=y
|
||||
CONFIG_TCG_TIS_SPI=m
|
||||
CONFIG_TCG_TIS_SPI_CR50=y
|
||||
CONFIG_TCG_TIS_I2C=m
|
||||
@@ -4533,7 +4535,7 @@ CONFIG_TCG_NSC=m
|
||||
CONFIG_TCG_ATMEL=m
|
||||
CONFIG_TCG_INFINEON=m
|
||||
CONFIG_TCG_XEN=m
|
||||
CONFIG_TCG_CRB=m
|
||||
CONFIG_TCG_CRB=y
|
||||
CONFIG_TCG_VTPM_PROXY=m
|
||||
CONFIG_TCG_TIS_ST33ZP24=m
|
||||
CONFIG_TCG_TIS_ST33ZP24_I2C=m
|
||||
@@ -4633,7 +4635,7 @@ CONFIG_I2C_DIOLAN_U2C=m
|
||||
CONFIG_I2C_DLN2=m
|
||||
CONFIG_I2C_CP2615=m
|
||||
CONFIG_I2C_PARPORT=m
|
||||
# CONFIG_I2C_PCI1XXXX is not set
|
||||
CONFIG_I2C_PCI1XXXX=m
|
||||
CONFIG_I2C_ROBOTFUZZ_OSIF=m
|
||||
CONFIG_I2C_TAOS_EVM=m
|
||||
CONFIG_I2C_TINY_USB=m
|
||||
@@ -4684,7 +4686,7 @@ CONFIG_SPI_INTEL_PCI=m
|
||||
CONFIG_SPI_INTEL_PLATFORM=m
|
||||
CONFIG_SPI_LM70_LLP=m
|
||||
CONFIG_SPI_MICROCHIP_CORE=m
|
||||
# CONFIG_SPI_MICROCHIP_CORE_QSPI is not set
|
||||
CONFIG_SPI_MICROCHIP_CORE_QSPI=m
|
||||
# CONFIG_SPI_LANTIQ_SSC is not set
|
||||
CONFIG_SPI_OC_TINY=m
|
||||
CONFIG_SPI_PXA2XX=m
|
||||
@@ -4750,7 +4752,7 @@ CONFIG_PINCONF=y
|
||||
CONFIG_GENERIC_PINCONF=y
|
||||
# CONFIG_DEBUG_PINCTRL is not set
|
||||
CONFIG_PINCTRL_AMD=y
|
||||
# CONFIG_PINCTRL_CY8C95X0 is not set
|
||||
CONFIG_PINCTRL_CY8C95X0=m
|
||||
CONFIG_PINCTRL_DA9062=m
|
||||
CONFIG_PINCTRL_MCP23S08_I2C=m
|
||||
CONFIG_PINCTRL_MCP23S08_SPI=m
|
||||
@@ -5008,6 +5010,7 @@ CONFIG_CHARGER_MAX8997=m
|
||||
CONFIG_CHARGER_MAX8998=m
|
||||
CONFIG_CHARGER_MP2629=m
|
||||
CONFIG_CHARGER_MT6360=m
|
||||
CONFIG_CHARGER_MT6370=m
|
||||
CONFIG_CHARGER_BQ2415X=m
|
||||
CONFIG_CHARGER_BQ24190=m
|
||||
CONFIG_CHARGER_BQ24257=m
|
||||
@@ -5364,7 +5367,7 @@ CONFIG_ADVANTECH_WDT=m
|
||||
CONFIG_ALIM1535_WDT=m
|
||||
CONFIG_ALIM7101_WDT=m
|
||||
CONFIG_EBC_C384_WDT=m
|
||||
# CONFIG_EXAR_WDT is not set
|
||||
CONFIG_EXAR_WDT=m
|
||||
CONFIG_F71808E_WDT=m
|
||||
CONFIG_SP5100_TCO=m
|
||||
CONFIG_SBC_FITPC2_WATCHDOG=m
|
||||
@@ -5498,10 +5501,10 @@ CONFIG_MFD_MAX8925=y
|
||||
CONFIG_MFD_MAX8997=y
|
||||
CONFIG_MFD_MAX8998=y
|
||||
CONFIG_MFD_MT6360=m
|
||||
# CONFIG_MFD_MT6370 is not set
|
||||
CONFIG_MFD_MT6370=m
|
||||
CONFIG_MFD_MT6397=m
|
||||
CONFIG_MFD_MENF21BMC=m
|
||||
# CONFIG_MFD_OCELOT is not set
|
||||
CONFIG_MFD_OCELOT=m
|
||||
CONFIG_EZX_PCAP=y
|
||||
CONFIG_MFD_VIPERBOARD=m
|
||||
CONFIG_MFD_RETU=m
|
||||
@@ -5626,6 +5629,7 @@ CONFIG_REGULATOR_MT6332=m
|
||||
CONFIG_REGULATOR_MT6358=m
|
||||
CONFIG_REGULATOR_MT6359=m
|
||||
CONFIG_REGULATOR_MT6360=m
|
||||
CONFIG_REGULATOR_MT6370=m
|
||||
CONFIG_REGULATOR_MT6397=m
|
||||
CONFIG_REGULATOR_PALMAS=m
|
||||
CONFIG_REGULATOR_PCA9450=m
|
||||
@@ -6756,6 +6760,7 @@ CONFIG_BACKLIGHT_PWM=m
|
||||
CONFIG_BACKLIGHT_DA903X=m
|
||||
CONFIG_BACKLIGHT_DA9052=m
|
||||
CONFIG_BACKLIGHT_MAX8925=m
|
||||
CONFIG_BACKLIGHT_MT6370=m
|
||||
CONFIG_BACKLIGHT_APPLE=m
|
||||
CONFIG_BACKLIGHT_QCOM_WLED=m
|
||||
CONFIG_BACKLIGHT_RT4831=m
|
||||
@@ -7193,9 +7198,8 @@ CONFIG_SND_SOC_SOF_INTEL_COMMON=m
|
||||
CONFIG_SND_SOC_SOF_BAYTRAIL=m
|
||||
# CONFIG_SND_SOC_SOF_BROADWELL is not set
|
||||
CONFIG_SND_SOC_SOF_MERRIFIELD=m
|
||||
CONFIG_SND_SOC_SOF_INTEL_SKL=m
|
||||
CONFIG_SND_SOC_SOF_SKYLAKE=m
|
||||
CONFIG_SND_SOC_SOF_KABYLAKE=m
|
||||
# CONFIG_SND_SOC_SOF_SKYLAKE is not set
|
||||
# CONFIG_SND_SOC_SOF_KABYLAKE is not set
|
||||
CONFIG_SND_SOC_SOF_INTEL_APL=m
|
||||
CONFIG_SND_SOC_SOF_APOLLOLAKE=m
|
||||
CONFIG_SND_SOC_SOF_GEMINILAKE=m
|
||||
@@ -7398,7 +7402,8 @@ CONFIG_SND_SOC_SIGMADSP_REGMAP=m
|
||||
CONFIG_SND_SOC_SIMPLE_AMPLIFIER=m
|
||||
CONFIG_SND_SOC_SIMPLE_MUX=m
|
||||
CONFIG_SND_SOC_SPDIF=m
|
||||
# CONFIG_SND_SOC_SRC4XXX_I2C is not set
|
||||
CONFIG_SND_SOC_SRC4XXX_I2C=m
|
||||
CONFIG_SND_SOC_SRC4XXX=m
|
||||
CONFIG_SND_SOC_SSM2305=m
|
||||
CONFIG_SND_SOC_SSM2518=m
|
||||
CONFIG_SND_SOC_SSM2602=m
|
||||
@@ -7556,7 +7561,7 @@ CONFIG_HID_KYE=m
|
||||
CONFIG_HID_UCLOGIC=m
|
||||
CONFIG_HID_WALTOP=m
|
||||
CONFIG_HID_VIEWSONIC=m
|
||||
# CONFIG_HID_VRC2 is not set
|
||||
CONFIG_HID_VRC2=m
|
||||
CONFIG_HID_XIAOMI=m
|
||||
CONFIG_HID_GYRATION=m
|
||||
CONFIG_HID_ICADE=m
|
||||
@@ -7601,7 +7606,7 @@ CONFIG_HID_PICOLCD_CIR=y
|
||||
CONFIG_HID_PLANTRONICS=m
|
||||
CONFIG_HID_PLAYSTATION=m
|
||||
CONFIG_PLAYSTATION_FF=y
|
||||
# CONFIG_HID_PXRC is not set
|
||||
CONFIG_HID_PXRC=m
|
||||
CONFIG_HID_RAZER=m
|
||||
CONFIG_HID_PRIMAX=m
|
||||
CONFIG_HID_RETRODE=m
|
||||
@@ -8062,6 +8067,7 @@ CONFIG_TYPEC_TCPM=m
|
||||
CONFIG_TYPEC_TCPCI=m
|
||||
CONFIG_TYPEC_RT1711H=m
|
||||
CONFIG_TYPEC_MT6360=m
|
||||
CONFIG_TYPEC_TCPCI_MT6370=m
|
||||
CONFIG_TYPEC_TCPCI_MAXIM=m
|
||||
CONFIG_TYPEC_FUSB302=m
|
||||
CONFIG_TYPEC_WCOVE=m
|
||||
@@ -9233,7 +9239,7 @@ CONFIG_MEN_Z188_ADC=m
|
||||
CONFIG_MP2629_ADC=m
|
||||
CONFIG_NAU7802=m
|
||||
CONFIG_PALMAS_GPADC=m
|
||||
# CONFIG_RICHTEK_RTQ6056 is not set
|
||||
CONFIG_RICHTEK_RTQ6056=m
|
||||
CONFIG_SD_ADC_MODULATOR=m
|
||||
CONFIG_TI_ADC081C=m
|
||||
CONFIG_TI_ADC0832=m
|
||||
@@ -9481,8 +9487,9 @@ CONFIG_ADIS16480=m
|
||||
CONFIG_BMI160=m
|
||||
CONFIG_BMI160_I2C=m
|
||||
CONFIG_BMI160_SPI=m
|
||||
# CONFIG_BOSCH_BNO055_SERIAL is not set
|
||||
# CONFIG_BOSCH_BNO055_I2C is not set
|
||||
CONFIG_BOSCH_BNO055=m
|
||||
CONFIG_BOSCH_BNO055_SERIAL=m
|
||||
CONFIG_BOSCH_BNO055_I2C=m
|
||||
CONFIG_FXOS8700=m
|
||||
CONFIG_FXOS8700_I2C=m
|
||||
CONFIG_FXOS8700_SPI=m
|
||||
@@ -9827,7 +9834,7 @@ CONFIG_DEV_DAX_HMEM_DEVICES=y
|
||||
CONFIG_DEV_DAX_KMEM=m
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_SYSFS=y
|
||||
# CONFIG_NVMEM_RAVE_SP_EEPROM is not set
|
||||
CONFIG_NVMEM_RAVE_SP_EEPROM=m
|
||||
CONFIG_NVMEM_RMEM=m
|
||||
|
||||
#
|
||||
@@ -11223,6 +11230,7 @@ CONFIG_ASYNC_RAID6_TEST=m
|
||||
# CONFIG_TEST_BITMAP is not set
|
||||
# CONFIG_TEST_UUID is not set
|
||||
# CONFIG_TEST_XARRAY is not set
|
||||
# CONFIG_TEST_MAPLE_TREE is not set
|
||||
# CONFIG_TEST_RHASHTABLE is not set
|
||||
# CONFIG_TEST_SIPHASH is not set
|
||||
# CONFIG_TEST_IDA is not set
|
||||
|
@@ -1,16 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# List of kernels that are maintained upstream
|
||||
_current_kernels=("6.1" "6.0" "5.19" "5.15" "5.10" "5.4")
|
||||
_current_kernels=("6.1" "6.0" "5.15" "5.10" "5.4")
|
||||
|
||||
# List of kernels that are no longer maintained upstream
|
||||
_eol_kernels=("5.18" "5.17" "5.16" "5.14" "5.13" "5.12" "5.11" "5.9" "5.8" "5.7")
|
||||
_eol_kernels=("5.19" "5.18" "5.17" "5.16" "5.14" "5.13" "5.12" "5.11" "5.9" "5.8" "5.7")
|
||||
|
||||
typeset -Ag _kernel_git_remotes
|
||||
_kernel_git_remotes=(
|
||||
["kernel.org"]="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
|
||||
["googlesource.com"]="https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable"
|
||||
["github.com"]="https://github.com/gregkh/linux.git"
|
||||
["torvalds"]="https://github.com/torvalds/linux.git"
|
||||
)
|
||||
|
||||
_git_remote_names=( "${!_kernel_git_remotes[@]}" )
|
||||
@@ -35,53 +36,35 @@ for _key in "${_current_kernels[@]}" "${_eol_kernels[@]}"; do
|
||||
_kver_latest_tags_map[$_key]=$(echo "$_kernel_tags" | grep -F "v$_key" | tail -1 | cut -c1-)
|
||||
done
|
||||
|
||||
# only used by workflow trigger script
|
||||
typeset -Ag _kver_subver_map
|
||||
_kver_subver_map=(
|
||||
["5.4"]="214"
|
||||
["5.7"]="19"
|
||||
["5.8"]="18"
|
||||
["5.9"]="16"
|
||||
["5.10"]="144"
|
||||
["5.11"]="22"
|
||||
["5.12"]="19"
|
||||
["5.13"]="19"
|
||||
["5.14"]="21"
|
||||
["5.15"]="69"
|
||||
["5.16"]="20"
|
||||
["5.17"]="15"
|
||||
["5.18"]="19"
|
||||
["5.19"]="10"
|
||||
["6.0"]="rc6"
|
||||
)
|
||||
|
||||
|
||||
|
||||
# PREEMPT_RT's supported kernel subversion
|
||||
typeset -Ag _rt_subver_map
|
||||
_rt_subver_map=(
|
||||
["5.4"]="188"
|
||||
["5.4"]="209"
|
||||
["5.9"]="1"
|
||||
["5.10"]="109"
|
||||
["5.10"]="153"
|
||||
["5.11"]="4"
|
||||
["5.14"]="2"
|
||||
["5.15"]="32"
|
||||
["5.15"]="76"
|
||||
["5.16"]="2"
|
||||
["5.17"]="1"
|
||||
["6.0"]="5"
|
||||
["6.1"]="rc3"
|
||||
)
|
||||
|
||||
# PREEMPT_RT's patch revision for the kernel
|
||||
# We separated this to allow for forcing the application of the patch when _preempt_rt_force=1 on version mismatch
|
||||
typeset -Ag _rt_rev_map
|
||||
_rt_rev_map=(
|
||||
["5.4"]="73"
|
||||
["5.4"]="77"
|
||||
["5.9"]="20"
|
||||
["5.10"]="65"
|
||||
["5.10"]="76"
|
||||
["5.11"]="11"
|
||||
["5.14"]="21"
|
||||
["5.15"]="39"
|
||||
["5.15"]="53"
|
||||
["5.16"]="19"
|
||||
["5.17"]="17"
|
||||
["6.0"]="14"
|
||||
["6.1"]="2"
|
||||
)
|
||||
|
||||
_undefine() {
|
||||
@@ -287,7 +270,7 @@ _set_cpu_scheduler() {
|
||||
elif [ "$_kver" = "514" ]; then
|
||||
_avail_cpu_scheds=("pds" "bmq" "cacule" "cfs")
|
||||
elif [ "$_kver" = "515" ]; then
|
||||
_avail_cpu_scheds=("pds" "bmq" "cacule" "tt" "cfs")
|
||||
_avail_cpu_scheds=("pds" "bmq" "cacule" "tt" "bore" "cfs")
|
||||
elif [ "$_kver" = "516" ]; then
|
||||
_avail_cpu_scheds=("pds" "bmq" "cacule" "cfs")
|
||||
elif [ "$_kver" = "517" ]; then
|
||||
@@ -297,19 +280,30 @@ _set_cpu_scheduler() {
|
||||
elif [ "$_kver" = "519" ]; then
|
||||
_avail_cpu_scheds=("cfs" "pds" "bmq" "cacule" "tt" "bore")
|
||||
elif [ "$_kver" = "600" ]; then
|
||||
_avail_cpu_scheds=("cfs" "pds" "bmq" "tt" "bore")
|
||||
elif [ "$_kver" = "601" ]; then
|
||||
_avail_cpu_scheds=("cfs" "tt" "bore")
|
||||
else
|
||||
_avail_cpu_scheds=("cfs")
|
||||
fi
|
||||
|
||||
if [ "${_preempt_rt}" = "1" ]; then
|
||||
warning "! Since you have enabled _preempt_rt, incompatible cpu schedulers will not be available !"
|
||||
if [[ "${_avail_cpu_scheds[*]}" =~ "bore" ]]; then
|
||||
_avail_cpu_scheds=("cfs" "bore")
|
||||
else
|
||||
_avail_cpu_scheds=("cfs")
|
||||
fi
|
||||
fi
|
||||
|
||||
# Populate descriptions of the available CPU schedulers
|
||||
_avail_cpu_scheds_text=()
|
||||
for _sched in "${_avail_cpu_scheds[@]}"; do
|
||||
if [ "$_sched" = "pds" ] || [ "$_sched" = "bmq" ] && [ "$_projectc_unoff" = "1" ]; then
|
||||
_avail_cpu_scheds_text+=("Project C / ${_sched^^} (unofficial port - ! possibly unstable !)")
|
||||
else
|
||||
_avail_cpu_scheds_text+=("${_sched_description_array[$_sched]}")
|
||||
fi
|
||||
done
|
||||
|
||||
if ! [[ ${_avail_cpu_scheds[*]} =~ "$_cpusched" ]]; then
|
||||
@@ -432,6 +426,7 @@ _linux_git_branch_checkout() {
|
||||
msg2 "master branch doesn't locally exist, shallow cloning..."
|
||||
git remote set-branches --add kernel.org master
|
||||
git remote set-branches --add googlesource.com master
|
||||
git remote set-branches --add torvalds master
|
||||
git fetch --depth=1 $_git_mirror master
|
||||
git fetch --depth 1 $_git_mirror tag "$_kernel_git_tag"
|
||||
git checkout -b master-${_git_mirror} ${_git_mirror}/master
|
||||
@@ -449,6 +444,7 @@ _linux_git_branch_checkout() {
|
||||
msg2 "${_basekernel}.y branch doesn't locally exist, shallow cloning..."
|
||||
git remote set-branches --add kernel.org linux-${_basekernel}.y
|
||||
git remote set-branches --add googlesource.com linux-${_basekernel}.y
|
||||
git remote set-branches --add torvalds linux-${_basekernel}.y
|
||||
git fetch --depth=1 $_git_mirror linux-${_basekernel}.y
|
||||
git fetch --depth=1 $_git_mirror tag "$_kernel_git_tag"
|
||||
git checkout -b linux-${_basekernel}-${_git_mirror} ${_git_mirror}/linux-${_basekernel}.y
|
||||
@@ -650,8 +646,13 @@ _tkg_srcprep() {
|
||||
if [ ${_rt_subver_map[$_basekernel]+_} = "_" ]; then
|
||||
preempt_rt_ksubver="${_rt_subver_map[$_basekernel]}"
|
||||
# Check if subversion is supported, skip check if forced
|
||||
if [ "${_preempt_rt_force}" = "1" ] || [ "${preempt_rt_ksubver}" = "${_kver_subver_map[$_basekernel]}" ]; then
|
||||
preempt_rt_file_gz="patch-${_basekernel}.${preempt_rt_ksubver}-rt${_rt_rev_map["$_basekernel"]}.patch.gz"
|
||||
if [ "${_preempt_rt_force}" = "1" ] || [ "${preempt_rt_ksubver}" = "${_sub}" ]; then
|
||||
if [[ "${_sub}" == *rc* ]]; then
|
||||
_separator="-"
|
||||
else
|
||||
_separator="."
|
||||
fi
|
||||
preempt_rt_file_gz="patch-${_basekernel}${_separator}${preempt_rt_ksubver}-rt${_rt_rev_map["$_basekernel"]}.patch.gz"
|
||||
preempt_rt_file=`basename ${preempt_rt_file_gz} .gz`
|
||||
curl "https://cdn.kernel.org/pub/linux/kernel/projects/rt/${_basekernel}/${preempt_rt_file_gz}" > "$srcdir"/"${preempt_rt_file_gz}"
|
||||
last_pwd=`pwd`
|
||||
@@ -661,10 +662,10 @@ _tkg_srcprep() {
|
||||
tkgpatch="$srcdir/${preempt_rt_file}"
|
||||
_msg="Applying PREEMPT_RT patch" && _tkg_patcher
|
||||
else
|
||||
msg2 "Skipping PREEMPT_RT patch for ${_basekernel}.${_sub}"
|
||||
warning "Skipping PREEMPT_RT patch for ${_basekernel}.${_sub} (last known good ${_basekernel}.${preempt_rt_ksubver})"
|
||||
fi
|
||||
else
|
||||
msg2 "Skipping PREEMPT_RT patch on unsupported kernel version"
|
||||
warning "Skipping PREEMPT_RT patch on unsupported kernel version"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -677,6 +678,11 @@ _tkg_srcprep() {
|
||||
tkgpatch="$srcdir/0003-glitched-base.patch"
|
||||
_msg="Applying glitched base patch" && _tkg_patcher
|
||||
|
||||
if [ "${_preempt_rt}" != "1" ]; then
|
||||
tkgpatch="$srcdir/0003-glitched-base-nonrt.patch"
|
||||
_msg="Applying glitched base non-rt additions patch" && _tkg_patcher
|
||||
fi
|
||||
|
||||
if [[ "$_distro" =~ ^(Fedora|Suse)$ ]]; then
|
||||
tkgpatch="$srcdir/0013-fedora-rpm.patch"
|
||||
_msg="RPM: fixing spec generator" && _tkg_patcher
|
||||
@@ -705,7 +711,7 @@ _tkg_srcprep() {
|
||||
elif [ "$_kver" = "509" ]; then
|
||||
rev=3
|
||||
elif [ "$_kver" = "510" ]; then
|
||||
rev=3
|
||||
rev=5
|
||||
elif [ "$_kver" = "511" ]; then
|
||||
rev=3
|
||||
elif [ "$_kver" = "512" ]; then
|
||||
@@ -941,10 +947,10 @@ _tkg_srcprep() {
|
||||
# cpu opt
|
||||
_cpu_marchs=("native_amd" "native_intel" "generic_cpu" "generic_cpu2" "generic_cpu3" "generic_cpu4")
|
||||
_cpu_marchs+=("k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver")
|
||||
_cpu_marchs+=("steamroller" "excavator" "zen" "zen2" "zen3" "mpsc" "atom" "core2" "nehalem" "westmere")
|
||||
_cpu_marchs+=("steamroller" "excavator" "zen" "zen2" "zen3" "zen4" "mpsc" "atom" "core2" "nehalem" "westmere")
|
||||
_cpu_marchs+=("bonnell" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake")
|
||||
_cpu_marchs+=("skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake")
|
||||
_cpu_marchs+=("cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake")
|
||||
_cpu_marchs+=("cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake" "raptorlake" "meteorlake")
|
||||
|
||||
typeset -A _generic_march_map
|
||||
_generic_march_map=(
|
||||
@@ -1328,7 +1334,7 @@ _tkg_srcprep() {
|
||||
plain "Use CattaRappa mode (Tickless/Dynticks) ?"
|
||||
_tickless_array_text=(
|
||||
"No, use periodic ticks."
|
||||
"Yes, full tickless baby!\n Can give higher performances in many cases but lower consistency on some hardware."
|
||||
"Yes, full tickless baby!\n Full tickless can give higher performances in case you use isolation of CPUs for task, in other cases it behaves as Idle."
|
||||
"Just tickless idle plz.\n Just tickless idle can perform better with some platforms (mostly AMD) or CPU schedulers (mostly MuQSS)."
|
||||
)
|
||||
_default_index="2"
|
||||
|
38
linux-tkg-patches/5.10/0003-glitched-base-nonrt.patch
Normal file
38
linux-tkg-patches/5.10/0003-glitched-base-nonrt.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
@@ -54,46 +54,6 @@ index 361ea7ab30ea..0c5cf69b241a 100644
|
||||
2.28.0
|
||||
|
||||
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
||||
|
||||
|
||||
From acc49f33a10f61dc66c423888cbb883ba46710e4 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 17:41:29 +0000
|
||||
|
File diff suppressed because it is too large
Load Diff
38
linux-tkg-patches/5.15/0003-glitched-base-nonrt.patch
Normal file
38
linux-tkg-patches/5.15/0003-glitched-base-nonrt.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
@@ -54,46 +54,6 @@ index 361ea7ab30ea..0c5cf69b241a 100644
|
||||
2.28.0
|
||||
|
||||
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
||||
|
||||
|
||||
From acc49f33a10f61dc66c423888cbb883ba46710e4 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 17:41:29 +0000
|
||||
|
File diff suppressed because it is too large
Load Diff
38
linux-tkg-patches/5.4/0003-glitched-base-nonrt.patch
Normal file
38
linux-tkg-patches/5.4/0003-glitched-base-nonrt.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
@@ -31,31 +31,6 @@ index 2acfc69878f5..3f1131431e06 100644
|
||||
EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure);
|
||||
|
||||
__cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock);
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index 211890edf37e..37121563407d 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -41,7 +41,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we average the RT time consumption, measured
|
||||
@@ -61,9 +61,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
diff --git a/lib/Kconfig b/lib/Kconfig
|
||||
index 5fe577673b98..c44c27cd6e05 100644
|
||||
--- a/lib/Kconfig
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,56 +1,3 @@
|
||||
From b53bf730e6bba71ebc0ec8452cc2ca399137090e Mon Sep 17 00:00:00 2001
|
||||
From: Tor Vic <torvic9@mailbox.org>
|
||||
Date: Mon, 3 Oct 2022 11:19:50 +0200
|
||||
Subject: [PATCH] Project-C 6.0-rc0-vd
|
||||
|
||||
---
|
||||
.../admin-guide/kernel-parameters.txt | 6 +
|
||||
Documentation/admin-guide/sysctl/kernel.rst | 10 +
|
||||
Documentation/scheduler/sched-BMQ.txt | 110 +
|
||||
fs/proc/base.c | 2 +-
|
||||
include/asm-generic/resource.h | 2 +-
|
||||
include/linux/sched.h | 33 +-
|
||||
include/linux/sched/deadline.h | 20 +
|
||||
include/linux/sched/prio.h | 26 +
|
||||
include/linux/sched/rt.h | 2 +
|
||||
include/linux/sched/topology.h | 3 +-
|
||||
init/Kconfig | 34 +
|
||||
init/init_task.c | 18 +
|
||||
kernel/Kconfig.preempt | 2 +-
|
||||
kernel/cgroup/cpuset.c | 4 +-
|
||||
kernel/delayacct.c | 2 +-
|
||||
kernel/exit.c | 4 +-
|
||||
kernel/locking/rtmutex.c | 16 +-
|
||||
kernel/sched/Makefile | 5 +
|
||||
kernel/sched/alt_core.c | 7937 +++++++++++++++++
|
||||
kernel/sched/alt_debug.c | 31 +
|
||||
kernel/sched/alt_sched.h | 645 ++
|
||||
kernel/sched/bmq.h | 110 +
|
||||
kernel/sched/build_policy.c | 8 +-
|
||||
kernel/sched/build_utility.c | 3 +-
|
||||
kernel/sched/cpufreq_schedutil.c | 10 +
|
||||
kernel/sched/cputime.c | 10 +-
|
||||
kernel/sched/debug.c | 10 +
|
||||
kernel/sched/idle.c | 2 +
|
||||
kernel/sched/pds.h | 127 +
|
||||
kernel/sched/pelt.c | 4 +-
|
||||
kernel/sched/pelt.h | 8 +-
|
||||
kernel/sched/sched.h | 9 +
|
||||
kernel/sched/stats.c | 4 +
|
||||
kernel/sched/stats.h | 2 +
|
||||
kernel/sched/topology.c | 17 +
|
||||
kernel/sysctl.c | 15 +
|
||||
kernel/time/hrtimer.c | 2 +
|
||||
kernel/time/posix-cpu-timers.c | 10 +-
|
||||
kernel/trace/trace_selftest.c | 5 +
|
||||
39 files changed, 9245 insertions(+), 23 deletions(-)
|
||||
create mode 100644 Documentation/scheduler/sched-BMQ.txt
|
||||
create mode 100644 kernel/sched/alt_core.c
|
||||
create mode 100644 kernel/sched/alt_debug.c
|
||||
create mode 100644 kernel/sched/alt_sched.h
|
||||
create mode 100644 kernel/sched/bmq.h
|
||||
create mode 100644 kernel/sched/pds.h
|
||||
|
||||
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
|
||||
index 426fa892d311..43b06e44128c 100644
|
||||
--- a/Documentation/admin-guide/kernel-parameters.txt
|
||||
@@ -405,7 +352,7 @@ index 816df6cc444e..c8da08e18c91 100644
|
||||
#else
|
||||
static inline void rebuild_sched_domains_energy(void)
|
||||
diff --git a/init/Kconfig b/init/Kconfig
|
||||
index 532362fcfe31..d9ccd98f2856 100644
|
||||
index 532362fcfe31..2bf9e67b73c9 100644
|
||||
--- a/init/Kconfig
|
||||
+++ b/init/Kconfig
|
||||
@@ -808,6 +808,7 @@ menu "Scheduler features"
|
||||
@@ -422,15 +369,15 @@ index 532362fcfe31..d9ccd98f2856 100644
|
||||
|
||||
+menuconfig SCHED_ALT
|
||||
+ bool "Alternative CPU Schedulers"
|
||||
+ default n
|
||||
+ default y
|
||||
+ help
|
||||
+ This feature enables the ProjectC alternative CPU schedulers."
|
||||
+ This feature enable alternative CPU scheduler"
|
||||
+
|
||||
+if SCHED_ALT
|
||||
+
|
||||
+choice
|
||||
+ prompt "Alternative CPU schedulers"
|
||||
+ default SCHED_PDS
|
||||
+ prompt "Alternative CPU Scheduler"
|
||||
+ default SCHED_BMQ
|
||||
+
|
||||
+config SCHED_BMQ
|
||||
+ bool "BMQ CPU scheduler"
|
||||
@@ -685,10 +632,10 @@ index 976092b7bd45..31d587c16ec1 100644
|
||||
obj-y += build_utility.o
|
||||
diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
|
||||
new file mode 100644
|
||||
index 000000000000..f3bac14124c3
|
||||
index 000000000000..03e3956194f7
|
||||
--- /dev/null
|
||||
+++ b/kernel/sched/alt_core.c
|
||||
@@ -0,0 +1,7937 @@
|
||||
@@ -0,0 +1,7890 @@
|
||||
+/*
|
||||
+ * kernel/sched/alt_core.c
|
||||
+ *
|
||||
@@ -758,7 +705,7 @@ index 000000000000..f3bac14124c3
|
||||
+#define sched_feat(x) (0)
|
||||
+#endif /* CONFIG_SCHED_DEBUG */
|
||||
+
|
||||
+#define ALT_SCHED_VERSION "v6.0-r0-vd"
|
||||
+#define ALT_SCHED_VERSION "v6.0-r0"
|
||||
+
|
||||
+/* rt_prio(prio) defined in include/linux/sched/rt.h */
|
||||
+#define rt_task(p) rt_prio((p)->prio)
|
||||
@@ -838,91 +785,7 @@ index 000000000000..f3bac14124c3
|
||||
+#ifdef CONFIG_SCHED_SMT
|
||||
+static cpumask_t sched_sg_idle_mask ____cacheline_aligned_in_smp;
|
||||
+#endif
|
||||
+
|
||||
+#define BITS_PER_ATOMIC_LONG_T BITS_PER_LONG
|
||||
+typedef struct sched_bitmask {
|
||||
+ atomic_long_t bits[DIV_ROUND_UP(SCHED_QUEUE_BITS, BITS_PER_ATOMIC_LONG_T)];
|
||||
+} sched_bitmask_t;
|
||||
+static sched_bitmask_t sched_rq_watermark[NR_CPUS] ____cacheline_aligned_in_smp;
|
||||
+
|
||||
+#define x(p, set, mask) \
|
||||
+ do { \
|
||||
+ smp_mb__before_atomic(); \
|
||||
+ if (set) \
|
||||
+ atomic_long_or((mask), (p)); \
|
||||
+ else \
|
||||
+ atomic_long_and(~(mask), (p)); \
|
||||
+ smp_mb__after_atomic(); \
|
||||
+ } while (0)
|
||||
+
|
||||
+static __always_inline void sched_rq_watermark_fill_downwards(int cpu, unsigned int end,
|
||||
+ unsigned int start, bool set)
|
||||
+{
|
||||
+ unsigned int start_idx, start_bit;
|
||||
+ unsigned int end_idx, end_bit;
|
||||
+ atomic_long_t *p;
|
||||
+
|
||||
+ if (end == start) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ start_idx = start / BITS_PER_ATOMIC_LONG_T;
|
||||
+ start_bit = start % BITS_PER_ATOMIC_LONG_T;
|
||||
+ end_idx = (end - 1) / BITS_PER_ATOMIC_LONG_T;
|
||||
+ end_bit = (end - 1) % BITS_PER_ATOMIC_LONG_T;
|
||||
+ p = &sched_rq_watermark[cpu].bits[end_idx];
|
||||
+
|
||||
+ if (end_idx == start_idx) {
|
||||
+ x(p, set, (~0UL >> (BITS_PER_ATOMIC_LONG_T - 1 - end_bit)) & (~0UL << start_bit));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (end_bit != BITS_PER_ATOMIC_LONG_T - 1) {
|
||||
+ x(p, set, (~0UL >> (BITS_PER_ATOMIC_LONG_T - 1 - end_bit)));
|
||||
+ p -= 1;
|
||||
+ end_idx -= 1;
|
||||
+ }
|
||||
+
|
||||
+ while (end_idx != start_idx) {
|
||||
+ smp_mb__before_atomic();
|
||||
+ atomic_long_set(p, set ? ~0UL : 0);
|
||||
+ smp_mb__after_atomic();
|
||||
+ p -= 1;
|
||||
+ end_idx -= 1;
|
||||
+ }
|
||||
+
|
||||
+ x(p, set, ~0UL << start_bit);
|
||||
+}
|
||||
+
|
||||
+#undef x
|
||||
+
|
||||
+static __always_inline bool sched_rq_watermark_and(cpumask_t *dstp, const cpumask_t *cpus, int prio, bool not)
|
||||
+{
|
||||
+ int cpu;
|
||||
+ bool ret = false;
|
||||
+ int idx = prio / BITS_PER_ATOMIC_LONG_T;
|
||||
+ int bit = prio % BITS_PER_ATOMIC_LONG_T;
|
||||
+
|
||||
+ cpumask_clear(dstp);
|
||||
+ for_each_cpu(cpu, cpus)
|
||||
+ if (test_bit(bit, (long*)&sched_rq_watermark[cpu].bits[idx].counter) == !not) {
|
||||
+ __cpumask_set_cpu(cpu, dstp);
|
||||
+ ret = true;
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static __always_inline bool sched_rq_watermark_test(const cpumask_t *cpus, int prio, bool not)
|
||||
+{
|
||||
+ int cpu;
|
||||
+ int idx = prio / BITS_PER_ATOMIC_LONG_T;
|
||||
+ int bit = prio % BITS_PER_ATOMIC_LONG_T;
|
||||
+
|
||||
+ for_each_cpu(cpu, cpus)
|
||||
+ if (test_bit(bit, (long*)&sched_rq_watermark[cpu].bits[idx].counter) == !not)
|
||||
+ return true;
|
||||
+ return false;
|
||||
+}
|
||||
+static cpumask_t sched_rq_watermark[SCHED_QUEUE_BITS] ____cacheline_aligned_in_smp;
|
||||
+
|
||||
+/* sched_queue related functions */
|
||||
+static inline void sched_queue_init(struct sched_queue *q)
|
||||
@@ -951,6 +814,7 @@ index 000000000000..f3bac14124c3
|
||||
+{
|
||||
+ unsigned long watermark = find_first_bit(rq->queue.bitmap, SCHED_QUEUE_BITS);
|
||||
+ unsigned long last_wm = rq->watermark;
|
||||
+ unsigned long i;
|
||||
+ int cpu;
|
||||
+
|
||||
+ if (watermark == last_wm)
|
||||
@@ -959,25 +823,28 @@ index 000000000000..f3bac14124c3
|
||||
+ rq->watermark = watermark;
|
||||
+ cpu = cpu_of(rq);
|
||||
+ if (watermark < last_wm) {
|
||||
+ sched_rq_watermark_fill_downwards(cpu, SCHED_QUEUE_BITS - watermark, SCHED_QUEUE_BITS - last_wm, false);
|
||||
+ for (i = last_wm; i > watermark; i--)
|
||||
+ cpumask_clear_cpu(cpu, sched_rq_watermark + SCHED_QUEUE_BITS - i);
|
||||
+#ifdef CONFIG_SCHED_SMT
|
||||
+ if (static_branch_likely(&sched_smt_present) &&
|
||||
+ unlikely(IDLE_TASK_SCHED_PRIO == last_wm))
|
||||
+ IDLE_TASK_SCHED_PRIO == last_wm)
|
||||
+ cpumask_andnot(&sched_sg_idle_mask,
|
||||
+ &sched_sg_idle_mask, cpu_smt_mask(cpu));
|
||||
+#endif
|
||||
+ return;
|
||||
+ }
|
||||
+ /* last_wm < watermark */
|
||||
+ sched_rq_watermark_fill_downwards(cpu, SCHED_QUEUE_BITS - last_wm, SCHED_QUEUE_BITS - watermark, true);
|
||||
+ for (i = watermark; i > last_wm; i--)
|
||||
+ cpumask_set_cpu(cpu, sched_rq_watermark + SCHED_QUEUE_BITS - i);
|
||||
+#ifdef CONFIG_SCHED_SMT
|
||||
+ if (static_branch_likely(&sched_smt_present) &&
|
||||
+ unlikely(IDLE_TASK_SCHED_PRIO == watermark)) {
|
||||
+ const cpumask_t *smt_mask = cpu_smt_mask(cpu);
|
||||
+ IDLE_TASK_SCHED_PRIO == watermark) {
|
||||
+ cpumask_t tmp;
|
||||
+
|
||||
+ if (!sched_rq_watermark_test(smt_mask, 0, true))
|
||||
+ cpumask_and(&tmp, cpu_smt_mask(cpu), sched_rq_watermark);
|
||||
+ if (cpumask_equal(&tmp, cpu_smt_mask(cpu)))
|
||||
+ cpumask_or(&sched_sg_idle_mask,
|
||||
+ &sched_sg_idle_mask, smt_mask);
|
||||
+ &sched_sg_idle_mask, cpu_smt_mask(cpu));
|
||||
+ }
|
||||
+#endif
|
||||
+}
|
||||
@@ -1394,15 +1261,21 @@ index 000000000000..f3bac14124c3
|
||||
+ rq->load_stamp = time;
|
||||
+}
|
||||
+
|
||||
+unsigned long rq_load_util(struct rq *rq, int cpu)
|
||||
+unsigned long rq_load_util(int cpu)
|
||||
+{
|
||||
+ return RQ_LOAD_HISTORY_TO_UTIL(rq->load_history) * (arch_scale_cpu_capacity(cpu) >> RQ_UTIL_SHIFT);
|
||||
+ struct rq *rq;
|
||||
+ unsigned long max;
|
||||
+
|
||||
+ rq = cpu_rq(cpu);
|
||||
+ max = arch_scale_cpu_capacity(cpu);
|
||||
+
|
||||
+ return RQ_LOAD_HISTORY_TO_UTIL(rq->load_history) * (max >> RQ_UTIL_SHIFT);
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_SMP
|
||||
+unsigned long sched_cpu_util(int cpu)
|
||||
+{
|
||||
+ return rq_load_util(cpu_rq(cpu), cpu);
|
||||
+ return rq_load_util(cpu);
|
||||
+}
|
||||
+#endif /* CONFIG_SMP */
|
||||
+
|
||||
@@ -1579,11 +1452,15 @@ index 000000000000..f3bac14124c3
|
||||
+ ({ \
|
||||
+ typeof(ptr) _ptr = (ptr); \
|
||||
+ typeof(mask) _mask = (mask); \
|
||||
+ typeof(*_ptr) _val = *_ptr; \
|
||||
+ typeof(*_ptr) _old, _val = *_ptr; \
|
||||
+ \
|
||||
+ do { \
|
||||
+ } while (!try_cmpxchg(_ptr, &_val, _val | _mask)); \
|
||||
+ _val; \
|
||||
+ for (;;) { \
|
||||
+ _old = cmpxchg(_ptr, _val, _val | _mask); \
|
||||
+ if (_old == _val) \
|
||||
+ break; \
|
||||
+ _val = _old; \
|
||||
+ } \
|
||||
+ _old; \
|
||||
+})
|
||||
+
|
||||
+#if defined(CONFIG_SMP) && defined(TIF_POLLING_NRFLAG)
|
||||
@@ -1592,7 +1469,7 @@ index 000000000000..f3bac14124c3
|
||||
+ * this avoids any races wrt polling state changes and thereby avoids
|
||||
+ * spurious IPIs.
|
||||
+ */
|
||||
+static inline bool set_nr_and_not_polling(struct task_struct *p)
|
||||
+static bool set_nr_and_not_polling(struct task_struct *p)
|
||||
+{
|
||||
+ struct thread_info *ti = task_thread_info(p);
|
||||
+ return !(fetch_or(&ti->flags, _TIF_NEED_RESCHED) & _TIF_POLLING_NRFLAG);
|
||||
@@ -1607,28 +1484,30 @@ index 000000000000..f3bac14124c3
|
||||
+static bool set_nr_if_polling(struct task_struct *p)
|
||||
+{
|
||||
+ struct thread_info *ti = task_thread_info(p);
|
||||
+ typeof(ti->flags) val = READ_ONCE(ti->flags);
|
||||
+ typeof(ti->flags) old, val = READ_ONCE(ti->flags);
|
||||
+
|
||||
+ for (;;) {
|
||||
+ if (!(val & _TIF_POLLING_NRFLAG))
|
||||
+ return false;
|
||||
+ if (val & _TIF_NEED_RESCHED)
|
||||
+ return true;
|
||||
+ if (try_cmpxchg(&ti->flags, &val, val | _TIF_NEED_RESCHED))
|
||||
+ old = cmpxchg(&ti->flags, val, val | _TIF_NEED_RESCHED);
|
||||
+ if (old == val)
|
||||
+ break;
|
||||
+ val = old;
|
||||
+ }
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+static inline bool set_nr_and_not_polling(struct task_struct *p)
|
||||
+static bool set_nr_and_not_polling(struct task_struct *p)
|
||||
+{
|
||||
+ set_tsk_need_resched(p);
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_SMP
|
||||
+static inline bool set_nr_if_polling(struct task_struct *p)
|
||||
+static bool set_nr_if_polling(struct task_struct *p)
|
||||
+{
|
||||
+ return false;
|
||||
+}
|
||||
@@ -2302,7 +2181,7 @@ index 000000000000..f3bac14124c3
|
||||
+ rq = cpu_rq(new_cpu);
|
||||
+
|
||||
+ raw_spin_lock(&rq->lock);
|
||||
+ WARN_ON_ONCE(task_cpu(p) != new_cpu);
|
||||
+ BUG_ON(task_cpu(p) != new_cpu);
|
||||
+ sched_task_sanity_check(p, rq);
|
||||
+ enqueue_task(p, rq, 0);
|
||||
+ p->on_rq = TASK_ON_RQ_QUEUED;
|
||||
@@ -2668,9 +2547,9 @@ index 000000000000..f3bac14124c3
|
||||
+#ifdef CONFIG_SCHED_SMT
|
||||
+ cpumask_and(&tmp, &chk_mask, &sched_sg_idle_mask) ||
|
||||
+#endif
|
||||
+ sched_rq_watermark_and(&tmp, &chk_mask, 0, false) ||
|
||||
+ sched_rq_watermark_and(&tmp, &chk_mask,
|
||||
+ SCHED_QUEUE_BITS - 1 - task_sched_prio(p), false))
|
||||
+ cpumask_and(&tmp, &chk_mask, sched_rq_watermark) ||
|
||||
+ cpumask_and(&tmp, &chk_mask,
|
||||
+ sched_rq_watermark + SCHED_QUEUE_BITS - 1 - task_sched_prio(p)))
|
||||
+ return best_mask_cpu(task_cpu(p), &tmp);
|
||||
+
|
||||
+ return best_mask_cpu(task_cpu(p), &chk_mask);
|
||||
@@ -4052,7 +3931,8 @@ index 000000000000..f3bac14124c3
|
||||
+ * Claim the task as running, we do this before switching to it
|
||||
+ * such that any running task will have this set.
|
||||
+ *
|
||||
+ * See the ttwu() WF_ON_CPU case and its ordering comment.
|
||||
+ * See the smp_load_acquire(&p->on_cpu) case in ttwu() and
|
||||
+ * its ordering comment.
|
||||
+ */
|
||||
+ WRITE_ONCE(next->on_cpu, 1);
|
||||
+}
|
||||
@@ -4122,7 +4002,7 @@ index 000000000000..f3bac14124c3
|
||||
+ if (likely(!head))
|
||||
+ return NULL;
|
||||
+
|
||||
+ lockdep_assert_held(&rq->lock);
|
||||
+ lockdep_assert_rq_held(rq);
|
||||
+ /*
|
||||
+ * Must not take balance_push_callback off the list when
|
||||
+ * splice_balance_callbacks() and balance_callbacks() are not
|
||||
@@ -4793,7 +4673,7 @@ index 000000000000..f3bac14124c3
|
||||
+ * find potential cpus which can migrate the current running task
|
||||
+ */
|
||||
+ if (cpumask_test_cpu(cpu, &sched_sg_idle_mask) &&
|
||||
+ sched_rq_watermark_and(&chk, cpu_online_mask, 0, true) &&
|
||||
+ cpumask_andnot(&chk, cpu_online_mask, sched_rq_watermark) &&
|
||||
+ cpumask_andnot(&chk, &chk, &sched_rq_pending_mask)) {
|
||||
+ int i;
|
||||
+
|
||||
@@ -4935,7 +4815,7 @@ index 000000000000..f3bac14124c3
|
||||
+int __init sched_tick_offload_init(void)
|
||||
+{
|
||||
+ tick_work_cpu = alloc_percpu(struct tick_work);
|
||||
+ WARN_ON_ONCE(!tick_work_cpu);
|
||||
+ BUG_ON(!tick_work_cpu);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
@@ -5101,8 +4981,9 @@ index 000000000000..f3bac14124c3
|
||||
+#ifdef ALT_SCHED_DEBUG
|
||||
+void alt_sched_debug(void)
|
||||
+{
|
||||
+ printk(KERN_INFO "sched: pending: 0x%04lx, sg_idle: 0x%04lx\n",
|
||||
+ printk(KERN_INFO "sched: pending: 0x%04lx, idle: 0x%04lx, sg_idle: 0x%04lx\n",
|
||||
+ sched_rq_pending_mask.bits[0],
|
||||
+ sched_rq_watermark[0].bits[0],
|
||||
+ sched_sg_idle_mask.bits[0]);
|
||||
+}
|
||||
+#else
|
||||
@@ -5740,7 +5621,7 @@ index 000000000000..f3bac14124c3
|
||||
+ enum ctx_state prev_state;
|
||||
+
|
||||
+ /* Catch callers which need to be fixed */
|
||||
+ WARN_ON_ONCE(preempt_count() || !irqs_disabled());
|
||||
+ BUG_ON(preempt_count() || !irqs_disabled());
|
||||
+
|
||||
+ prev_state = exception_enter();
|
||||
+
|
||||
@@ -5915,17 +5796,29 @@ index 000000000000..f3bac14124c3
|
||||
+EXPORT_SYMBOL(set_user_nice);
|
||||
+
|
||||
+/*
|
||||
+ * is_nice_reduction - check if nice value is an actual reduction
|
||||
+ *
|
||||
+ * Similar to can_nice() but does not perform a capability check.
|
||||
+ *
|
||||
+ * @p: task
|
||||
+ * @nice: nice value
|
||||
+ */
|
||||
+static bool is_nice_reduction(const struct task_struct *p, const int nice)
|
||||
+{
|
||||
+ /* Convert nice value [19,-20] to rlimit style value [1,40]: */
|
||||
+ int nice_rlim = nice_to_rlimit(nice);
|
||||
+
|
||||
+ return (nice_rlim <= task_rlimit(p, RLIMIT_NICE));
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * can_nice - check if a task can reduce its nice value
|
||||
+ * @p: task
|
||||
+ * @nice: nice value
|
||||
+ */
|
||||
+int can_nice(const struct task_struct *p, const int nice)
|
||||
+{
|
||||
+ /* Convert nice value [19,-20] to rlimit style value [1,40] */
|
||||
+ int nice_rlim = nice_to_rlimit(nice);
|
||||
+
|
||||
+ return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
|
||||
+ capable(CAP_SYS_NICE));
|
||||
+ return is_nice_reduction(p, nice) || capable(CAP_SYS_NICE);
|
||||
+}
|
||||
+
|
||||
+#ifdef __ARCH_WANT_SYS_NICE
|
||||
@@ -6076,6 +5969,45 @@ index 000000000000..f3bac14124c3
|
||||
+ return match;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Allow unprivileged RT tasks to decrease priority.
|
||||
+ * Only issue a capable test if needed and only once to avoid an audit
|
||||
+ * event on permitted non-privileged operations:
|
||||
+ */
|
||||
+static int user_check_sched_setscheduler(struct task_struct *p,
|
||||
+ const struct sched_attr *attr,
|
||||
+ int policy, int reset_on_fork)
|
||||
+{
|
||||
+ if (rt_policy(policy)) {
|
||||
+ unsigned long rlim_rtprio = task_rlimit(p, RLIMIT_RTPRIO);
|
||||
+
|
||||
+ /* Can't set/change the rt policy: */
|
||||
+ if (policy != p->policy && !rlim_rtprio)
|
||||
+ goto req_priv;
|
||||
+
|
||||
+ /* Can't increase priority: */
|
||||
+ if (attr->sched_priority > p->rt_priority &&
|
||||
+ attr->sched_priority > rlim_rtprio)
|
||||
+ goto req_priv;
|
||||
+ }
|
||||
+
|
||||
+ /* Can't change other user's priorities: */
|
||||
+ if (!check_same_owner(p))
|
||||
+ goto req_priv;
|
||||
+
|
||||
+ /* Normal users shall not reset the sched_reset_on_fork flag: */
|
||||
+ if (p->sched_reset_on_fork && !reset_on_fork)
|
||||
+ goto req_priv;
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+req_priv:
|
||||
+ if (!capable(CAP_SYS_NICE))
|
||||
+ return -EPERM;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int __sched_setscheduler(struct task_struct *p,
|
||||
+ const struct sched_attr *attr,
|
||||
+ bool user, bool pi)
|
||||
@@ -6095,7 +6027,7 @@ index 000000000000..f3bac14124c3
|
||||
+ raw_spinlock_t *lock;
|
||||
+
|
||||
+ /* The pi code expects interrupts enabled */
|
||||
+ WARN_ON_ONCE(pi && in_interrupt());
|
||||
+ BUG_ON(pi && in_interrupt());
|
||||
+
|
||||
+ /*
|
||||
+ * Alt schedule FW supports SCHED_DEADLINE by squash it as prio 0 SCHED_FIFO
|
||||
@@ -6132,34 +6064,11 @@ index 000000000000..f3bac14124c3
|
||||
+ (attr->sched_priority != 0))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /*
|
||||
+ * Allow unprivileged RT tasks to decrease priority:
|
||||
+ */
|
||||
+ if (user && !capable(CAP_SYS_NICE)) {
|
||||
+ if (SCHED_FIFO == policy || SCHED_RR == policy) {
|
||||
+ unsigned long rlim_rtprio =
|
||||
+ task_rlimit(p, RLIMIT_RTPRIO);
|
||||
+
|
||||
+ /* Can't set/change the rt policy */
|
||||
+ if (policy != p->policy && !rlim_rtprio)
|
||||
+ return -EPERM;
|
||||
+
|
||||
+ /* Can't increase priority */
|
||||
+ if (attr->sched_priority > p->rt_priority &&
|
||||
+ attr->sched_priority > rlim_rtprio)
|
||||
+ return -EPERM;
|
||||
+ }
|
||||
+
|
||||
+ /* Can't change other user's priorities */
|
||||
+ if (!check_same_owner(p))
|
||||
+ return -EPERM;
|
||||
+
|
||||
+ /* Normal users shall not reset the sched_reset_on_fork flag */
|
||||
+ if (p->sched_reset_on_fork && !reset_on_fork)
|
||||
+ return -EPERM;
|
||||
+ }
|
||||
+
|
||||
+ if (user) {
|
||||
+ retval = user_check_sched_setscheduler(p, attr, policy, reset_on_fork);
|
||||
+ if (retval)
|
||||
+ return retval;
|
||||
+
|
||||
+ retval = security_task_setscheduler(p);
|
||||
+ if (retval)
|
||||
+ return retval;
|
||||
@@ -7583,7 +7492,7 @@ index 000000000000..f3bac14124c3
|
||||
+{
|
||||
+ struct mm_struct *mm = current->active_mm;
|
||||
+
|
||||
+ WARN_ON_ONCE(current != this_rq()->idle);
|
||||
+ BUG_ON(current != this_rq()->idle);
|
||||
+
|
||||
+ if (mm != &init_mm) {
|
||||
+ switch_mm(mm, &init_mm, current);
|
||||
@@ -8097,17 +8006,8 @@ index 000000000000..f3bac14124c3
|
||||
+ wait_bit_init();
|
||||
+
|
||||
+#ifdef CONFIG_SMP
|
||||
+ for (i = 0; i < nr_cpu_ids; i++) {
|
||||
+ long val = cpumask_test_cpu(i, cpu_present_mask) ? -1L : 0;
|
||||
+ int j;
|
||||
+ for (j = 0; j < DIV_ROUND_UP(SCHED_QUEUE_BITS, BITS_PER_ATOMIC_LONG_T); j++)
|
||||
+ atomic_long_set(&sched_rq_watermark[i].bits[j], val);
|
||||
+ }
|
||||
+ for (i = nr_cpu_ids; i < NR_CPUS; i++) {
|
||||
+ int j;
|
||||
+ for (j = 0; j < DIV_ROUND_UP(SCHED_QUEUE_BITS, BITS_PER_ATOMIC_LONG_T); j++)
|
||||
+ atomic_long_set(&sched_rq_watermark[i].bits[j], 0);
|
||||
+ }
|
||||
+ for (i = 0; i < SCHED_QUEUE_BITS; i++)
|
||||
+ cpumask_copy(sched_rq_watermark + i, cpu_present_mask);
|
||||
+#endif
|
||||
+
|
||||
+#ifdef CONFIG_CGROUP_SCHED
|
||||
@@ -8665,7 +8565,7 @@ index 000000000000..1212a031700e
|
||||
+{}
|
||||
diff --git a/kernel/sched/alt_sched.h b/kernel/sched/alt_sched.h
|
||||
new file mode 100644
|
||||
index 000000000000..318431c553ca
|
||||
index 000000000000..bec061f2ae10
|
||||
--- /dev/null
|
||||
+++ b/kernel/sched/alt_sched.h
|
||||
@@ -0,0 +1,645 @@
|
||||
@@ -8901,7 +8801,7 @@ index 000000000000..318431c553ca
|
||||
+#endif /* CONFIG_NO_HZ_COMMON */
|
||||
+};
|
||||
+
|
||||
+extern unsigned long rq_load_util(struct rq *rq, int cpu);
|
||||
+extern unsigned long rq_load_util(int cpu);
|
||||
+
|
||||
+extern unsigned long calc_load_update;
|
||||
+extern atomic_long_t calc_load_tasks;
|
||||
@@ -9456,18 +9356,10 @@ index d9dc9ab3773f..71a25540d65e 100644
|
||||
+#include "deadline.c"
|
||||
+#endif
|
||||
diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c
|
||||
index 99bdd96f454f..bc17d5a6fc41 100644
|
||||
index 99bdd96f454f..23f80a86d2d7 100644
|
||||
--- a/kernel/sched/build_utility.c
|
||||
+++ b/kernel/sched/build_utility.c
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <linux/nospec.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/psi.h>
|
||||
-#include <linux/psi.h>
|
||||
#include <linux/ptrace_api.h>
|
||||
#include <linux/sched_clock.h>
|
||||
#include <linux/security.h>
|
||||
@@ -85,7 +84,9 @@
|
||||
@@ -85,7 +85,9 @@
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
# include "cpupri.c"
|
||||
@@ -9478,7 +9370,7 @@ index 99bdd96f454f..bc17d5a6fc41 100644
|
||||
#endif
|
||||
|
||||
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
|
||||
index 1207c78f85c1..f66b715e4287 100644
|
||||
index 1207c78f85c1..3ed06d7ef4f8 100644
|
||||
--- a/kernel/sched/cpufreq_schedutil.c
|
||||
+++ b/kernel/sched/cpufreq_schedutil.c
|
||||
@@ -159,9 +159,14 @@ static void sugov_get_util(struct sugov_cpu *sg_cpu)
|
||||
@@ -9491,7 +9383,7 @@ index 1207c78f85c1..f66b715e4287 100644
|
||||
FREQUENCY_UTIL, NULL);
|
||||
+#else
|
||||
+ sg_cpu->bw_dl = 0;
|
||||
+ sg_cpu->util = rq_load_util(rq, sg_cpu->cpu);
|
||||
+ sg_cpu->util = rq_load_util(cpu_of(rq));
|
||||
+#endif /* CONFIG_SCHED_ALT */
|
||||
}
|
||||
|
||||
@@ -10002,7 +9894,7 @@ index 8739c2a5a54e..d8dd6c15eb47 100644
|
||||
+#endif /* CONFIG_NUMA */
|
||||
+#endif
|
||||
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
|
||||
index 205d605cacc5..c1dac3a542b8 100644
|
||||
index 205d605cacc5..7dd950601cca 100644
|
||||
--- a/kernel/sysctl.c
|
||||
+++ b/kernel/sysctl.c
|
||||
@@ -86,6 +86,10 @@
|
||||
@@ -10016,7 +9908,23 @@ index 205d605cacc5..c1dac3a542b8 100644
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
static const int six_hundred_forty_kb = 640 * 1024;
|
||||
#endif
|
||||
@@ -1943,6 +1947,17 @@ static struct ctl_table kern_table[] = {
|
||||
@@ -1631,6 +1635,7 @@ int proc_do_static_key(struct ctl_table *table, int write,
|
||||
}
|
||||
|
||||
static struct ctl_table kern_table[] = {
|
||||
+#ifndef CONFIG_SCHED_ALT
|
||||
#ifdef CONFIG_NUMA_BALANCING
|
||||
{
|
||||
.procname = "numa_balancing",
|
||||
@@ -1642,6 +1647,7 @@ static struct ctl_table kern_table[] = {
|
||||
.extra2 = SYSCTL_FOUR,
|
||||
},
|
||||
#endif /* CONFIG_NUMA_BALANCING */
|
||||
+#endif /* !CONFIG_SCHED_ALT */
|
||||
{
|
||||
.procname = "panic",
|
||||
.data = &panic_timeout,
|
||||
@@ -1943,6 +1949,17 @@ static struct ctl_table kern_table[] = {
|
||||
.proc_handler = proc_dointvec,
|
||||
},
|
||||
#endif
|
||||
@@ -10129,6 +10037,3 @@ index a2d301f58ced..2ccdede8585c 100644
|
||||
};
|
||||
struct wakeup_test_data *x = data;
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
@@ -64,140 +64,6 @@ index 2c7171e0b0010..85de313ddec29 100644
|
||||
select CPU_FREQ_GOV_PERFORMANCE
|
||||
help
|
||||
|
||||
From 2535fbde890f14c78b750139fcf87d1143850626 Mon Sep 17 00:00:00 2001
|
||||
From: Johannes Weiner <hannes@cmpxchg.org>
|
||||
Date: Tue, 2 Aug 2022 12:28:11 -0400
|
||||
Subject: [PATCH] mm: vmscan: fix extreme overreclaim and swap floods
|
||||
|
||||
During proactive reclaim, we sometimes observe severe overreclaim, with
|
||||
several thousand times more pages reclaimed than requested.
|
||||
|
||||
This trace was obtained from shrink_lruvec() during such an instance:
|
||||
|
||||
prio:0 anon_cost:1141521 file_cost:7767
|
||||
nr_reclaimed:4387406 nr_to_reclaim:1047 (or_factor:4190)
|
||||
nr=[7161123 345 578 1111]
|
||||
|
||||
While he reclaimer requested 4M, vmscan reclaimed close to 16G, most of it
|
||||
by swapping. These requests take over a minute, during which the write()
|
||||
to memory.reclaim is unkillably stuck inside the kernel.
|
||||
|
||||
Digging into the source, this is caused by the proportional reclaim
|
||||
bailout logic. This code tries to resolve a fundamental conflict: to
|
||||
reclaim roughly what was requested, while also aging all LRUs fairly and
|
||||
in accordance to their size, swappiness, refault rates etc. The way it
|
||||
attempts fairness is that once the reclaim goal has been reached, it stops
|
||||
scanning the LRUs with the smaller remaining scan targets, and adjusts the
|
||||
remainder of the bigger LRUs according to how much of the smaller LRUs was
|
||||
scanned. It then finishes scanning that remainder regardless of the
|
||||
reclaim goal.
|
||||
|
||||
This works fine if priority levels are low and the LRU lists are
|
||||
comparable in size. However, in this instance, the cgroup that is
|
||||
targeted by proactive reclaim has almost no files left - they've already
|
||||
been squeezed out by proactive reclaim earlier - and the remaining anon
|
||||
pages are hot. Anon rotations cause the priority level to drop to 0,
|
||||
which results in reclaim targeting all of anon (a lot) and all of file
|
||||
(almost nothing). By the time reclaim decides to bail, it has scanned
|
||||
most or all of the file target, and therefor must also scan most or all of
|
||||
the enormous anon target. This target is thousands of times larger than
|
||||
the reclaim goal, thus causing the overreclaim.
|
||||
|
||||
The bailout code hasn't changed in years, why is this failing now? The
|
||||
most likely explanations are two other recent changes in anon reclaim:
|
||||
|
||||
1. Before the series starting with commit 5df741963d52 ("mm: fix LRU
|
||||
balancing effect of new transparent huge pages"), the VM was
|
||||
overall relatively reluctant to swap at all, even if swap was
|
||||
configured. This means the LRU balancing code didn't come into play
|
||||
as often as it does now, and mostly in high pressure situations
|
||||
where pronounced swap activity wouldn't be as surprising.
|
||||
|
||||
2. For historic reasons, shrink_lruvec() loops on the scan targets of
|
||||
all LRU lists except the active anon one, meaning it would bail if
|
||||
the only remaining pages to scan were active anon - even if there
|
||||
were a lot of them.
|
||||
|
||||
Before the series starting with commit ccc5dc67340c ("mm/vmscan:
|
||||
make active/inactive ratio as 1:1 for anon lru"), most anon pages
|
||||
would live on the active LRU; the inactive one would contain only a
|
||||
handful of preselected reclaim candidates. After the series, anon
|
||||
gets aged similarly to file, and the inactive list is the default
|
||||
for new anon pages as well, making it often the much bigger list.
|
||||
|
||||
As a result, the VM is now more likely to actually finish large
|
||||
anon targets than before.
|
||||
|
||||
Change the code such that only one SWAP_CLUSTER_MAX-sized nudge toward the
|
||||
larger LRU lists is made before bailing out on a met reclaim goal.
|
||||
|
||||
This fixes the extreme overreclaim problem.
|
||||
|
||||
Fairness is more subtle and harder to evaluate. No obvious misbehavior
|
||||
was observed on the test workload, in any case. Conceptually, fairness
|
||||
should primarily be a cumulative effect from regular, lower priority
|
||||
scans. Once the VM is in trouble and needs to escalate scan targets to
|
||||
make forward progress, fairness needs to take a backseat. This is also
|
||||
acknowledged by the myriad exceptions in get_scan_count(). This patch
|
||||
makes fairness decrease gradually, as it keeps fairness work static over
|
||||
increasing priority levels with growing scan targets. This should make
|
||||
more sense - although we may have to re-visit the exact values.
|
||||
|
||||
Link: https://lkml.kernel.org/r/20220802162811.39216-1-hannes@cmpxchg.org
|
||||
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
|
||||
Reviewed-by: Rik van Riel <riel@surriel.com>
|
||||
Acked-by: Mel Gorman <mgorman@techsingularity.net>
|
||||
Cc: Hugh Dickins <hughd@google.com>
|
||||
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
|
||||
Cc: <stable@vger.kernel.org>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
---
|
||||
mm/vmscan.c | 10 ++++------
|
||||
1 file changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/mm/vmscan.c b/mm/vmscan.c
|
||||
index 382dbe97329f33..266eb8cfe93a67 100644
|
||||
--- a/mm/vmscan.c
|
||||
+++ b/mm/vmscan.c
|
||||
@@ -2955,8 +2955,8 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
enum lru_list lru;
|
||||
unsigned long nr_reclaimed = 0;
|
||||
unsigned long nr_to_reclaim = sc->nr_to_reclaim;
|
||||
+ bool proportional_reclaim;
|
||||
struct blk_plug plug;
|
||||
- bool scan_adjusted;
|
||||
|
||||
get_scan_count(lruvec, sc, nr);
|
||||
|
||||
@@ -2974,8 +2974,8 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
* abort proportional reclaim if either the file or anon lru has already
|
||||
* dropped to zero at the first pass.
|
||||
*/
|
||||
- scan_adjusted = (!cgroup_reclaim(sc) && !current_is_kswapd() &&
|
||||
- sc->priority == DEF_PRIORITY);
|
||||
+ proportional_reclaim = (!cgroup_reclaim(sc) && !current_is_kswapd() &&
|
||||
+ sc->priority == DEF_PRIORITY);
|
||||
|
||||
blk_start_plug(&plug);
|
||||
while (nr[LRU_INACTIVE_ANON] || nr[LRU_ACTIVE_FILE] ||
|
||||
@@ -2995,7 +2995,7 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
|
||||
cond_resched();
|
||||
|
||||
- if (nr_reclaimed < nr_to_reclaim || scan_adjusted)
|
||||
+ if (nr_reclaimed < nr_to_reclaim || proportional_reclaim)
|
||||
continue;
|
||||
|
||||
/*
|
||||
@@ -3046,8 +3046,6 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
nr_scanned = targets[lru] - nr[lru];
|
||||
nr[lru] = targets[lru] * (100 - percentage) / 100;
|
||||
nr[lru] -= min(nr[lru], nr_scanned);
|
||||
-
|
||||
- scan_adjusted = true;
|
||||
}
|
||||
blk_finish_plug(&plug);
|
||||
sc->nr_reclaimed += nr_reclaimed;
|
||||
From 430daaab3c78de6bd82f10cfb5a0f016c6e583f6 Mon Sep 17 00:00:00 2001
|
||||
From: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
|
||||
Date: Mon, 4 Oct 2021 14:07:34 -0400
|
||||
|
90
linux-tkg-patches/6.1/0005-glitched-pds.patch
Normal file
90
linux-tkg-patches/6.1/0005-glitched-pds.patch
Normal file
@@ -0,0 +1,90 @@
|
||||
From f7f49141a5dbe9c99d78196b58c44307fb2e6be3 Mon Sep 17 00:00:00 2001
|
||||
From: Tk-Glitch <ti3nou@gmail.com>
|
||||
Date: Wed, 4 Jul 2018 04:30:08 +0200
|
||||
Subject: glitched - PDS
|
||||
|
||||
diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
|
||||
index 2a202a846757..1d9c7ed79b11 100644
|
||||
--- a/kernel/Kconfig.hz
|
||||
+++ b/kernel/Kconfig.hz
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
choice
|
||||
prompt "Timer frequency"
|
||||
- default HZ_250
|
||||
+ default HZ_500
|
||||
help
|
||||
Allows the configuration of the timer frequency. It is customary
|
||||
to have the timer interrupt run at 1000 Hz but 100 Hz may be more
|
||||
@@ -39,6 +39,13 @@ choice
|
||||
on SMP and NUMA systems and exactly dividing by both PAL and
|
||||
NTSC frame rates for video and multimedia work.
|
||||
|
||||
+ config HZ_500
|
||||
+ bool "500 HZ"
|
||||
+ help
|
||||
+ 500 Hz is a balanced timer frequency. Provides fast interactivity
|
||||
+ on desktops with great smoothness without increasing CPU power
|
||||
+ consumption and sacrificing the battery life on laptops.
|
||||
+
|
||||
config HZ_1000
|
||||
bool "1000 HZ"
|
||||
help
|
||||
@@ -52,6 +59,7 @@ config HZ
|
||||
default 100 if HZ_100
|
||||
default 250 if HZ_250
|
||||
default 300 if HZ_300
|
||||
+ default 500 if HZ_500
|
||||
default 1000 if HZ_1000
|
||||
|
||||
config SCHED_HRTICK
|
||||
|
||||
diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
|
||||
index 2a202a846757..1d9c7ed79b11 100644
|
||||
--- a/kernel/Kconfig.hz
|
||||
+++ b/kernel/Kconfig.hz
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
choice
|
||||
prompt "Timer frequency"
|
||||
- default HZ_500
|
||||
+ default HZ_750
|
||||
help
|
||||
Allows the configuration of the timer frequency. It is customary
|
||||
to have the timer interrupt run at 1000 Hz but 100 Hz may be more
|
||||
@@ -46,6 +46,13 @@ choice
|
||||
on desktops with great smoothness without increasing CPU power
|
||||
consumption and sacrificing the battery life on laptops.
|
||||
|
||||
+ config HZ_750
|
||||
+ bool "750 HZ"
|
||||
+ help
|
||||
+ 750 Hz is a good timer frequency for desktops. Provides fast
|
||||
+ interactivity with great smoothness without sacrificing too
|
||||
+ much throughput.
|
||||
+
|
||||
config HZ_1000
|
||||
bool "1000 HZ"
|
||||
help
|
||||
@@ -60,6 +67,7 @@ config HZ
|
||||
default 250 if HZ_250
|
||||
default 300 if HZ_300
|
||||
default 500 if HZ_500
|
||||
+ default 750 if HZ_750
|
||||
default 1000 if HZ_1000
|
||||
|
||||
config SCHED_HRTICK
|
||||
|
||||
diff --git a/mm/vmscan.c b/mm/vmscan.c
|
||||
index 9270a4370d54..30d01e647417 100644
|
||||
--- a/mm/vmscan.c
|
||||
+++ b/mm/vmscan.c
|
||||
@@ -169,7 +169,7 @@
|
||||
/*
|
||||
* From 0 .. 200. Higher means more swappy.
|
||||
*/
|
||||
-int vm_swappiness = 60;
|
||||
+int vm_swappiness = 20;
|
||||
|
||||
static void set_task_reclaim_state(struct task_struct *task,
|
||||
struct reclaim_state *rs)
|
90
linux-tkg-patches/6.1/0009-glitched-bmq.patch
Normal file
90
linux-tkg-patches/6.1/0009-glitched-bmq.patch
Normal file
@@ -0,0 +1,90 @@
|
||||
From f7f49141a5dbe9c99d78196b58c44307fb2e6be3 Mon Sep 17 00:00:00 2001
|
||||
From: Tk-Glitch <ti3nou@gmail.com>
|
||||
Date: Wed, 4 Jul 2018 04:30:08 +0200
|
||||
Subject: glitched - BMQ
|
||||
|
||||
diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
|
||||
index 2a202a846757..1d9c7ed79b11 100644
|
||||
--- a/kernel/Kconfig.hz
|
||||
+++ b/kernel/Kconfig.hz
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
choice
|
||||
prompt "Timer frequency"
|
||||
- default HZ_250
|
||||
+ default HZ_500
|
||||
help
|
||||
Allows the configuration of the timer frequency. It is customary
|
||||
to have the timer interrupt run at 1000 Hz but 100 Hz may be more
|
||||
@@ -39,6 +39,13 @@ choice
|
||||
on SMP and NUMA systems and exactly dividing by both PAL and
|
||||
NTSC frame rates for video and multimedia work.
|
||||
|
||||
+ config HZ_500
|
||||
+ bool "500 HZ"
|
||||
+ help
|
||||
+ 500 Hz is a balanced timer frequency. Provides fast interactivity
|
||||
+ on desktops with great smoothness without increasing CPU power
|
||||
+ consumption and sacrificing the battery life on laptops.
|
||||
+
|
||||
config HZ_1000
|
||||
bool "1000 HZ"
|
||||
help
|
||||
@@ -52,6 +59,7 @@ config HZ
|
||||
default 100 if HZ_100
|
||||
default 250 if HZ_250
|
||||
default 300 if HZ_300
|
||||
+ default 500 if HZ_500
|
||||
default 1000 if HZ_1000
|
||||
|
||||
config SCHED_HRTICK
|
||||
|
||||
diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
|
||||
index 2a202a846757..1d9c7ed79b11 100644
|
||||
--- a/kernel/Kconfig.hz
|
||||
+++ b/kernel/Kconfig.hz
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
choice
|
||||
prompt "Timer frequency"
|
||||
- default HZ_500
|
||||
+ default HZ_750
|
||||
help
|
||||
Allows the configuration of the timer frequency. It is customary
|
||||
to have the timer interrupt run at 1000 Hz but 100 Hz may be more
|
||||
@@ -46,6 +46,13 @@ choice
|
||||
on desktops with great smoothness without increasing CPU power
|
||||
consumption and sacrificing the battery life on laptops.
|
||||
|
||||
+ config HZ_750
|
||||
+ bool "750 HZ"
|
||||
+ help
|
||||
+ 750 Hz is a good timer frequency for desktops. Provides fast
|
||||
+ interactivity with great smoothness without sacrificing too
|
||||
+ much throughput.
|
||||
+
|
||||
config HZ_1000
|
||||
bool "1000 HZ"
|
||||
help
|
||||
@@ -60,6 +67,7 @@ config HZ
|
||||
default 250 if HZ_250
|
||||
default 300 if HZ_300
|
||||
default 500 if HZ_500
|
||||
+ default 750 if HZ_750
|
||||
default 1000 if HZ_1000
|
||||
|
||||
config SCHED_HRTICK
|
||||
|
||||
diff --git a/mm/vmscan.c b/mm/vmscan.c
|
||||
index 9270a4370d54..30d01e647417 100644
|
||||
--- a/mm/vmscan.c
|
||||
+++ b/mm/vmscan.c
|
||||
@@ -169,7 +169,7 @@
|
||||
/*
|
||||
* From 0 .. 200. Higher means more swappy.
|
||||
*/
|
||||
-int vm_swappiness = 60;
|
||||
+int vm_swappiness = 20;
|
||||
|
||||
static void set_task_reclaim_state(struct task_struct *task,
|
||||
struct reclaim_state *rs)
|
18
linux-tkg-patches/6.1/0009-glitched-ondemand-bmq.patch
Normal file
18
linux-tkg-patches/6.1/0009-glitched-ondemand-bmq.patch
Normal file
@@ -0,0 +1,18 @@
|
||||
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
|
||||
index 6b423eebfd5d..61e3271675d6 100644
|
||||
--- a/drivers/cpufreq/cpufreq_ondemand.c
|
||||
+++ b/drivers/cpufreq/cpufreq_ondemand.c
|
||||
@@ -21,10 +21,10 @@
|
||||
#include "cpufreq_ondemand.h"
|
||||
|
||||
/* On-demand governor macros */
|
||||
-#define DEF_FREQUENCY_UP_THRESHOLD (80)
|
||||
-#define DEF_SAMPLING_DOWN_FACTOR (1)
|
||||
+#define DEF_FREQUENCY_UP_THRESHOLD (55)
|
||||
+#define DEF_SAMPLING_DOWN_FACTOR (5)
|
||||
#define MAX_SAMPLING_DOWN_FACTOR (100000)
|
||||
-#define MICRO_FREQUENCY_UP_THRESHOLD (95)
|
||||
+#define MICRO_FREQUENCY_UP_THRESHOLD (63)
|
||||
#define MICRO_FREQUENCY_MIN_SAMPLE_RATE (10000)
|
||||
#define MIN_FREQUENCY_UP_THRESHOLD (1)
|
||||
#define MAX_FREQUENCY_UP_THRESHOLD (100)
|
10094
linux-tkg-patches/6.1/0009-prjc_v6.1-r0.patch
Normal file
10094
linux-tkg-patches/6.1/0009-prjc_v6.1-r0.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -64,140 +64,6 @@ index 2c7171e0b0010..85de313ddec29 100644
|
||||
select CPU_FREQ_GOV_PERFORMANCE
|
||||
help
|
||||
|
||||
From 2535fbde890f14c78b750139fcf87d1143850626 Mon Sep 17 00:00:00 2001
|
||||
From: Johannes Weiner <hannes@cmpxchg.org>
|
||||
Date: Tue, 2 Aug 2022 12:28:11 -0400
|
||||
Subject: [PATCH] mm: vmscan: fix extreme overreclaim and swap floods
|
||||
|
||||
During proactive reclaim, we sometimes observe severe overreclaim, with
|
||||
several thousand times more pages reclaimed than requested.
|
||||
|
||||
This trace was obtained from shrink_lruvec() during such an instance:
|
||||
|
||||
prio:0 anon_cost:1141521 file_cost:7767
|
||||
nr_reclaimed:4387406 nr_to_reclaim:1047 (or_factor:4190)
|
||||
nr=[7161123 345 578 1111]
|
||||
|
||||
While he reclaimer requested 4M, vmscan reclaimed close to 16G, most of it
|
||||
by swapping. These requests take over a minute, during which the write()
|
||||
to memory.reclaim is unkillably stuck inside the kernel.
|
||||
|
||||
Digging into the source, this is caused by the proportional reclaim
|
||||
bailout logic. This code tries to resolve a fundamental conflict: to
|
||||
reclaim roughly what was requested, while also aging all LRUs fairly and
|
||||
in accordance to their size, swappiness, refault rates etc. The way it
|
||||
attempts fairness is that once the reclaim goal has been reached, it stops
|
||||
scanning the LRUs with the smaller remaining scan targets, and adjusts the
|
||||
remainder of the bigger LRUs according to how much of the smaller LRUs was
|
||||
scanned. It then finishes scanning that remainder regardless of the
|
||||
reclaim goal.
|
||||
|
||||
This works fine if priority levels are low and the LRU lists are
|
||||
comparable in size. However, in this instance, the cgroup that is
|
||||
targeted by proactive reclaim has almost no files left - they've already
|
||||
been squeezed out by proactive reclaim earlier - and the remaining anon
|
||||
pages are hot. Anon rotations cause the priority level to drop to 0,
|
||||
which results in reclaim targeting all of anon (a lot) and all of file
|
||||
(almost nothing). By the time reclaim decides to bail, it has scanned
|
||||
most or all of the file target, and therefor must also scan most or all of
|
||||
the enormous anon target. This target is thousands of times larger than
|
||||
the reclaim goal, thus causing the overreclaim.
|
||||
|
||||
The bailout code hasn't changed in years, why is this failing now? The
|
||||
most likely explanations are two other recent changes in anon reclaim:
|
||||
|
||||
1. Before the series starting with commit 5df741963d52 ("mm: fix LRU
|
||||
balancing effect of new transparent huge pages"), the VM was
|
||||
overall relatively reluctant to swap at all, even if swap was
|
||||
configured. This means the LRU balancing code didn't come into play
|
||||
as often as it does now, and mostly in high pressure situations
|
||||
where pronounced swap activity wouldn't be as surprising.
|
||||
|
||||
2. For historic reasons, shrink_lruvec() loops on the scan targets of
|
||||
all LRU lists except the active anon one, meaning it would bail if
|
||||
the only remaining pages to scan were active anon - even if there
|
||||
were a lot of them.
|
||||
|
||||
Before the series starting with commit ccc5dc67340c ("mm/vmscan:
|
||||
make active/inactive ratio as 1:1 for anon lru"), most anon pages
|
||||
would live on the active LRU; the inactive one would contain only a
|
||||
handful of preselected reclaim candidates. After the series, anon
|
||||
gets aged similarly to file, and the inactive list is the default
|
||||
for new anon pages as well, making it often the much bigger list.
|
||||
|
||||
As a result, the VM is now more likely to actually finish large
|
||||
anon targets than before.
|
||||
|
||||
Change the code such that only one SWAP_CLUSTER_MAX-sized nudge toward the
|
||||
larger LRU lists is made before bailing out on a met reclaim goal.
|
||||
|
||||
This fixes the extreme overreclaim problem.
|
||||
|
||||
Fairness is more subtle and harder to evaluate. No obvious misbehavior
|
||||
was observed on the test workload, in any case. Conceptually, fairness
|
||||
should primarily be a cumulative effect from regular, lower priority
|
||||
scans. Once the VM is in trouble and needs to escalate scan targets to
|
||||
make forward progress, fairness needs to take a backseat. This is also
|
||||
acknowledged by the myriad exceptions in get_scan_count(). This patch
|
||||
makes fairness decrease gradually, as it keeps fairness work static over
|
||||
increasing priority levels with growing scan targets. This should make
|
||||
more sense - although we may have to re-visit the exact values.
|
||||
|
||||
Link: https://lkml.kernel.org/r/20220802162811.39216-1-hannes@cmpxchg.org
|
||||
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
|
||||
Reviewed-by: Rik van Riel <riel@surriel.com>
|
||||
Acked-by: Mel Gorman <mgorman@techsingularity.net>
|
||||
Cc: Hugh Dickins <hughd@google.com>
|
||||
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
|
||||
Cc: <stable@vger.kernel.org>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
---
|
||||
mm/vmscan.c | 10 ++++------
|
||||
1 file changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/mm/vmscan.c b/mm/vmscan.c
|
||||
index 382dbe97329f33..266eb8cfe93a67 100644
|
||||
--- a/mm/vmscan.c
|
||||
+++ b/mm/vmscan.c
|
||||
@@ -2955,8 +2955,8 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
enum lru_list lru;
|
||||
unsigned long nr_reclaimed = 0;
|
||||
unsigned long nr_to_reclaim = sc->nr_to_reclaim;
|
||||
+ bool proportional_reclaim;
|
||||
struct blk_plug plug;
|
||||
- bool scan_adjusted;
|
||||
|
||||
get_scan_count(lruvec, sc, nr);
|
||||
|
||||
@@ -2974,8 +2974,8 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
* abort proportional reclaim if either the file or anon lru has already
|
||||
* dropped to zero at the first pass.
|
||||
*/
|
||||
- scan_adjusted = (!cgroup_reclaim(sc) && !current_is_kswapd() &&
|
||||
- sc->priority == DEF_PRIORITY);
|
||||
+ proportional_reclaim = (!cgroup_reclaim(sc) && !current_is_kswapd() &&
|
||||
+ sc->priority == DEF_PRIORITY);
|
||||
|
||||
blk_start_plug(&plug);
|
||||
while (nr[LRU_INACTIVE_ANON] || nr[LRU_ACTIVE_FILE] ||
|
||||
@@ -2995,7 +2995,7 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
|
||||
cond_resched();
|
||||
|
||||
- if (nr_reclaimed < nr_to_reclaim || scan_adjusted)
|
||||
+ if (nr_reclaimed < nr_to_reclaim || proportional_reclaim)
|
||||
continue;
|
||||
|
||||
/*
|
||||
@@ -3046,8 +3046,6 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
nr_scanned = targets[lru] - nr[lru];
|
||||
nr[lru] = targets[lru] * (100 - percentage) / 100;
|
||||
nr[lru] -= min(nr[lru], nr_scanned);
|
||||
-
|
||||
- scan_adjusted = true;
|
||||
}
|
||||
blk_finish_plug(&plug);
|
||||
sc->nr_reclaimed += nr_reclaimed;
|
||||
From 430daaab3c78de6bd82f10cfb5a0f016c6e583f6 Mon Sep 17 00:00:00 2001
|
||||
From: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
|
||||
Date: Mon, 4 Oct 2021 14:07:34 -0400
|
||||
@@ -426,99 +292,194 @@ index 4bf4ea6cbb5eee..4850dafbaa05fb 100644
|
||||
}
|
||||
|
||||
/* ---- Socket functions ---- */
|
||||
From 50e6a66675f6c9835d4f1d4f8c947d1699ce8e24 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
|
||||
Date: Fri, 7 Oct 2022 09:51:13 +0200
|
||||
Subject: [PATCH 4/5] drm/sched: add DRM_SCHED_FENCE_DONT_PIPELINE flag
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Setting this flag on a scheduler fence prevents pipelining of jobs
|
||||
depending on this fence. In other words we always insert a full CPU
|
||||
round trip before dependen jobs are pushed to the pipeline.
|
||||
From 727209376f4998bc84db1d5d8af15afea846a92b Mon Sep 17 00:00:00 2001
|
||||
From: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
|
||||
Date: Mon, 24 Oct 2022 17:02:54 -0300
|
||||
Subject: x86/split_lock: Add sysctl to control the misery mode
|
||||
|
||||
Signed-off-by: Christian König <christian.koenig@amd.com>
|
||||
Commit b041b525dab9 ("x86/split_lock: Make life miserable for split lockers")
|
||||
changed the way the split lock detector works when in "warn" mode;
|
||||
basically, it not only shows the warn message, but also intentionally
|
||||
introduces a slowdown through sleeping plus serialization mechanism
|
||||
on such task. Based on discussions in [0], seems the warning alone
|
||||
wasn't enough motivation for userspace developers to fix their
|
||||
applications.
|
||||
|
||||
This slowdown is enough to totally break some proprietary (aka.
|
||||
unfixable) userspace[1].
|
||||
|
||||
Happens that originally the proposal in [0] was to add a new mode
|
||||
which would warns + slowdown the "split locking" task, keeping the
|
||||
old warn mode untouched. In the end, that idea was discarded and
|
||||
the regular/default "warn" mode now slows down the applications. This
|
||||
is quite aggressive with regards proprietary/legacy programs that
|
||||
basically are unable to properly run in kernel with this change.
|
||||
While it is understandable that a malicious application could DoS
|
||||
by split locking, it seems unacceptable to regress old/proprietary
|
||||
userspace programs through a default configuration that previously
|
||||
worked. An example of such breakage was reported in [1].
|
||||
|
||||
Add a sysctl to allow controlling the "misery mode" behavior, as per
|
||||
Thomas suggestion on [2]. This way, users running legacy and/or
|
||||
proprietary software are allowed to still execute them with a decent
|
||||
performance while still observing the warning messages on kernel log.
|
||||
|
||||
[0] https://lore.kernel.org/lkml/20220217012721.9694-1-tony.luck@intel.com/
|
||||
[1] https://github.com/doitsujin/dxvk/issues/2938
|
||||
[2] https://lore.kernel.org/lkml/87pmf4bter.ffs@tglx/
|
||||
|
||||
[ dhansen: minor changelog tweaks, including clarifying the actual
|
||||
problem ]
|
||||
|
||||
Fixes: b041b525dab9 ("x86/split_lock: Make life miserable for split lockers")
|
||||
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
|
||||
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
|
||||
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
|
||||
Reviewed-by: Tony Luck <tony.luck@intel.com>
|
||||
Tested-by: Andre Almeida <andrealmeid@igalia.com>
|
||||
Link: https://lore.kernel.org/all/20221024200254.635256-1-gpiccoli%40igalia.com
|
||||
---
|
||||
drivers/gpu/drm/scheduler/sched_entity.c | 3 ++-
|
||||
include/drm/gpu_scheduler.h | 9 +++++++++
|
||||
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||
Documentation/admin-guide/sysctl/kernel.rst | 23 +++++++++++
|
||||
arch/x86/kernel/cpu/intel.c | 63 ++++++++++++++++++++++++-----
|
||||
2 files changed, 76 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
|
||||
index 6b25b2f4f5a3..6137537aaea4 100644
|
||||
--- a/drivers/gpu/drm/scheduler/sched_entity.c
|
||||
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
|
||||
@@ -385,7 +385,8 @@ static bool drm_sched_entity_add_dependency_cb(struct drm_sched_entity *entity)
|
||||
}
|
||||
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
|
||||
index 98d1b198b2b4c..c2c64c1b706ff 100644
|
||||
--- a/Documentation/admin-guide/sysctl/kernel.rst
|
||||
+++ b/Documentation/admin-guide/sysctl/kernel.rst
|
||||
@@ -1314,6 +1314,29 @@ watchdog work to be queued by the watchdog timer function, otherwise the NMI
|
||||
watchdog — if enabled — can detect a hard lockup condition.
|
||||
|
||||
s_fence = to_drm_sched_fence(fence);
|
||||
- if (s_fence && s_fence->sched == sched) {
|
||||
+ if (s_fence && s_fence->sched == sched &&
|
||||
+ !test_bit(DRM_SCHED_FENCE_DONT_PIPELINE, &fence->flags)) {
|
||||
|
||||
/*
|
||||
* Fence is from the same scheduler, only need to wait for
|
||||
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
|
||||
index addb135eeea6..289a33e80639 100644
|
||||
--- a/include/drm/gpu_scheduler.h
|
||||
+++ b/include/drm/gpu_scheduler.h
|
||||
@@ -32,6 +32,15 @@
|
||||
|
||||
#define MAX_WAIT_SCHED_ENTITY_Q_EMPTY msecs_to_jiffies(1000)
|
||||
|
||||
+/**
|
||||
+ * DRM_SCHED_FENCE_DONT_PIPELINE - Prefent dependency pipelining
|
||||
+ *
|
||||
+ * Setting this flag on a scheduler fence prevents pipelining of jobs depending
|
||||
+ * on this fence. In other words we always insert a full CPU round trip before
|
||||
+ * dependen jobs are pushed to the hw queue.
|
||||
+ */
|
||||
+#define DRM_SCHED_FENCE_DONT_PIPELINE DMA_FENCE_FLAG_USER_BITS
|
||||
+split_lock_mitigate (x86 only)
|
||||
+==============================
|
||||
+
|
||||
struct drm_gem_object;
|
||||
+On x86, each "split lock" imposes a system-wide performance penalty. On larger
|
||||
+systems, large numbers of split locks from unprivileged users can result in
|
||||
+denials of service to well-behaved and potentially more important users.
|
||||
+
|
||||
+The kernel mitigates these bad users by detecting split locks and imposing
|
||||
+penalties: forcing them to wait and only allowing one core to execute split
|
||||
+locks at a time.
|
||||
+
|
||||
+These mitigations can make those bad applications unbearably slow. Setting
|
||||
+split_lock_mitigate=0 may restore some application performance, but will also
|
||||
+increase system exposure to denial of service attacks from split lock users.
|
||||
+
|
||||
+= ===================================================================
|
||||
+0 Disable the mitigation mode - just warns the split lock on kernel log
|
||||
+ and exposes the system to denials of service from the split lockers.
|
||||
+1 Enable the mitigation mode (this is the default) - penalizes the split
|
||||
+ lockers with intentional performance degradation.
|
||||
+= ===================================================================
|
||||
+
|
||||
+
|
||||
stack_erasing
|
||||
=============
|
||||
|
||||
struct drm_gpu_scheduler;
|
||||
--
|
||||
2.25.1
|
||||
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
|
||||
index 2d7ea5480ec33..4278996504833 100644
|
||||
--- a/arch/x86/kernel/cpu/intel.c
|
||||
+++ b/arch/x86/kernel/cpu/intel.c
|
||||
@@ -1034,8 +1034,32 @@ static const struct {
|
||||
|
||||
From e15e1601fba660124acd7ad41b6f61d46a1c4835 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
|
||||
Date: Fri, 7 Oct 2022 10:59:58 +0200
|
||||
Subject: [PATCH 5/5] drm/amdgpu: use DRM_SCHED_FENCE_DONT_PIPELINE for VM
|
||||
updates
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
static struct ratelimit_state bld_ratelimit;
|
||||
|
||||
Make sure that we always have a CPU round trip to let the submission
|
||||
code correctly decide if a TLB flush is necessary or not.
|
||||
+static unsigned int sysctl_sld_mitigate = 1;
|
||||
static DEFINE_SEMAPHORE(buslock_sem);
|
||||
|
||||
Signed-off-by: Christian König <christian.koenig@amd.com>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
|
||||
index 1fd3cbca20a2..c7bf189d50de 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
|
||||
@@ -115,8 +115,15 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,
|
||||
amdgpu_bo_fence(p->vm->root.bo, f, true);
|
||||
+#ifdef CONFIG_PROC_SYSCTL
|
||||
+static struct ctl_table sld_sysctls[] = {
|
||||
+ {
|
||||
+ .procname = "split_lock_mitigate",
|
||||
+ .data = &sysctl_sld_mitigate,
|
||||
+ .maxlen = sizeof(unsigned int),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = proc_douintvec_minmax,
|
||||
+ .extra1 = SYSCTL_ZERO,
|
||||
+ .extra2 = SYSCTL_ONE,
|
||||
+ },
|
||||
+ {}
|
||||
+};
|
||||
+
|
||||
+static int __init sld_mitigate_sysctl_init(void)
|
||||
+{
|
||||
+ register_sysctl_init("kernel", sld_sysctls);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+late_initcall(sld_mitigate_sysctl_init);
|
||||
+#endif
|
||||
+
|
||||
static inline bool match_option(const char *arg, int arglen, const char *opt)
|
||||
{
|
||||
int len = strlen(opt), ratelimit;
|
||||
@@ -1146,12 +1170,20 @@ static void split_lock_init(void)
|
||||
split_lock_verify_msr(sld_state != sld_off);
|
||||
}
|
||||
|
||||
- if (fence && !p->immediate)
|
||||
+ if (fence && !p->immediate) {
|
||||
+ /*
|
||||
+ * Most hw generations now have a separate queue for page table
|
||||
+ * updates, but when the queue is shared with userspace we need
|
||||
+ * the extra CPU round trip to correctly flush the TLB.
|
||||
+ */
|
||||
+ set_bit(DRM_SCHED_FENCE_DONT_PIPELINE, &f->flags);
|
||||
swap(*fence, f);
|
||||
-static void __split_lock_reenable(struct work_struct *work)
|
||||
+static void __split_lock_reenable_unlock(struct work_struct *work)
|
||||
{
|
||||
sld_update_msr(true);
|
||||
up(&buslock_sem);
|
||||
}
|
||||
|
||||
+static DECLARE_DELAYED_WORK(sl_reenable_unlock, __split_lock_reenable_unlock);
|
||||
+
|
||||
+static void __split_lock_reenable(struct work_struct *work)
|
||||
+{
|
||||
+ sld_update_msr(true);
|
||||
+}
|
||||
dma_fence_put(f);
|
||||
+static DECLARE_DELAYED_WORK(sl_reenable, __split_lock_reenable);
|
||||
+
|
||||
/*
|
||||
* If a CPU goes offline with pending delayed work to re-enable split lock
|
||||
* detection then the delayed work will be executed on some other CPU. That
|
||||
@@ -1169,10 +1201,9 @@ static int splitlock_cpu_offline(unsigned int cpu)
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
||||
-static DECLARE_DELAYED_WORK(split_lock_reenable, __split_lock_reenable);
|
||||
-
|
||||
static void split_lock_warn(unsigned long ip)
|
||||
{
|
||||
+ struct delayed_work *work;
|
||||
int cpu;
|
||||
|
||||
if (!current->reported_split_lock)
|
||||
@@ -1180,14 +1211,26 @@ static void split_lock_warn(unsigned long ip)
|
||||
current->comm, current->pid, ip);
|
||||
current->reported_split_lock = 1;
|
||||
|
||||
- /* misery factor #1, sleep 10ms before trying to execute split lock */
|
||||
- if (msleep_interruptible(10) > 0)
|
||||
- return;
|
||||
- /* Misery factor #2, only allow one buslocked disabled core at a time */
|
||||
- if (down_interruptible(&buslock_sem) == -EINTR)
|
||||
- return;
|
||||
+ if (sysctl_sld_mitigate) {
|
||||
+ /*
|
||||
+ * misery factor #1:
|
||||
+ * sleep 10ms before trying to execute split lock.
|
||||
+ */
|
||||
+ if (msleep_interruptible(10) > 0)
|
||||
+ return;
|
||||
+ /*
|
||||
+ * Misery factor #2:
|
||||
+ * only allow one buslocked disabled core at a time.
|
||||
+ */
|
||||
+ if (down_interruptible(&buslock_sem) == -EINTR)
|
||||
+ return;
|
||||
+ work = &sl_reenable_unlock;
|
||||
+ } else {
|
||||
+ work = &sl_reenable;
|
||||
+ }
|
||||
+
|
||||
cpu = get_cpu();
|
||||
- schedule_delayed_work_on(cpu, &split_lock_reenable, 2);
|
||||
+ schedule_delayed_work_on(cpu, work, 2);
|
||||
|
||||
/* Disable split lock detection on this CPU to make progress */
|
||||
sld_update_msr(false);
|
||||
|
Reference in New Issue
Block a user