From 588b71679bb4a256fc921062ff4fe4b0d32774e8 Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Mon, 11 May 2020 06:19:12 +0200 Subject: [PATCH] linux56-tkg: Update ck1 patchset to ck2 - https://ck-hack.blogspot.com/2020/05/linux-56-ck2-muqss-version-02-for-linux.html?m=0 --- linux56-tkg/PKGBUILD | 8 +-- ...{0004-5.6-ck1.patch => 0004-5.6-ck2.patch} | 59 ++++++------------- 2 files changed, 21 insertions(+), 46 deletions(-) rename linux56-tkg/linux56-tkg-patches/{0004-5.6-ck1.patch => 0004-5.6-ck2.patch} (99%) diff --git a/linux56-tkg/PKGBUILD b/linux56-tkg/PKGBUILD index 49a63b2..d29b8cf 100644 --- a/linux56-tkg/PKGBUILD +++ b/linux56-tkg/PKGBUILD @@ -89,7 +89,7 @@ pkgname=("${pkgbase}" "${pkgbase}-headers") _basekernel=5.6 _sub=12 pkgver="${_basekernel}"."${_sub}" -pkgrel=25 +pkgrel=26 pkgdesc='Linux-tkg' arch=('x86_64') # no i686 in here url="http://www.kernel.org/" @@ -111,7 +111,7 @@ source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${_basekernel}.tar.x 0003-glitched-cfs.patch 0004-glitched-ondemand-muqss.patch 0004-glitched-muqss.patch - 0004-5.6-ck1.patch + 0004-5.6-ck2.patch 0005-glitched-ondemand-pds.patch 0005-glitched-pds.patch 0005-v5.6_undead-pds099o.patch @@ -137,7 +137,7 @@ sha256sums=('e342b04a2aa63808ea0ef1baab28fc520bd031ef8cf93d9ee4a31d4058fcb622' '7058e57fd68367b029adc77f2a82928f1433daaf02c8c279cb2d13556c8804d7' 'c605f638d74c61861ebdc36ebd4cb8b6475eae2f6273e1ccb2bbb3e10a2ec3fe' 'bc69d6e5ee8172b0242c8fa72d13cfe2b8d2b6601468836908a7dfe8b78a3bbb' - 'a668b78cd8d03797e4dc514b3636a8e198db50e08d2c5ed927d3653a59b0ee5d' + '5590a33a6030b78d766a05bab5ac8552be2441c23aac30300b2dcdad9ffb5704' '62496f9ca788996181ef145f96ad26291282fcc3fb95cdc04080dcf84365be33' '7fd8e776209dac98627453fda754bdf9aff4a09f27cb0b3766d7983612eb3c74' '9ddfb1abaa01acf70e1352db1564fba591c2229d71d3c912213915388e944d6f' @@ -235,7 +235,7 @@ prepare() { if [ "${_cpusched}" == "MuQSS" ]; then # MuQSS - patch -Np1 -i ../0004-5.6-ck1.patch + patch -Np1 -i ../0004-5.6-ck2.patch if [ "${_aggressive_ondemand}" == "true" ]; then patch -Np1 -i ../0004-glitched-ondemand-muqss.patch fi diff --git a/linux56-tkg/linux56-tkg-patches/0004-5.6-ck1.patch b/linux56-tkg/linux56-tkg-patches/0004-5.6-ck2.patch similarity index 99% rename from linux56-tkg/linux56-tkg-patches/0004-5.6-ck1.patch rename to linux56-tkg/linux56-tkg-patches/0004-5.6-ck2.patch index db0175e..d198d86 100644 --- a/linux56-tkg/linux56-tkg-patches/0004-5.6-ck1.patch +++ b/linux56-tkg/linux56-tkg-patches/0004-5.6-ck2.patch @@ -834,14 +834,14 @@ index 000000000000..ae28b85c9995 + +Con Kolivas Sat, 29th October 2016 diff --git a/Makefile b/Makefile -index 4d0711f54047..aa5770ed49a3 100644 +index 4d0711f54047..92e1ee508c18 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,10 @@ NAME = Kleptomaniac Octopus PHONY := _all _all: -+CKVERSION = -ck1 ++CKVERSION = -ck2 +CKNAME = MuQSS Powered +EXTRAVERSION := $(EXTRAVERSION)$(CKVERSION) + @@ -3480,10 +3480,10 @@ index 21fb5a5662b5..a04ffebc6b7a 100644 obj-$(CONFIG_MEMBARRIER) += membarrier.o diff --git a/kernel/sched/MuQSS.c b/kernel/sched/MuQSS.c new file mode 100644 -index 000000000000..25d06f15e4e6 +index 000000000000..43cb43a60716 --- /dev/null +++ b/kernel/sched/MuQSS.c -@@ -0,0 +1,7604 @@ +@@ -0,0 +1,7600 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * kernel/sched/MuQSS.c, was kernel/sched.c @@ -3599,7 +3599,7 @@ index 000000000000..25d06f15e4e6 + +void print_scheduler_version(void) +{ -+ printk(KERN_INFO "MuQSS CPU scheduler v0.199 by Con Kolivas.\n"); ++ printk(KERN_INFO "MuQSS CPU scheduler v0.200 by Con Kolivas.\n"); +} + +/* Define RQ share levels */ @@ -4228,17 +4228,15 @@ index 000000000000..25d06f15e4e6 +static void update_load_avg(struct rq *rq, unsigned int flags) +{ + long us_interval, load; -+ unsigned long curload; + + us_interval = NS_TO_US(rq->niffies - rq->load_update); + if (unlikely(us_interval <= 0)) + return; + -+ curload = rq_load(rq); + load = rq->load_avg - (rq->load_avg * us_interval * 5 / 262144); + if (unlikely(load < 0)) + load = 0; -+ load += curload * curload * SCHED_CAPACITY_SCALE * us_interval * 5 / 262144; ++ load += rq_load(rq) * SCHED_CAPACITY_SCALE * us_interval * 5 / 262144; + rq->load_avg = load; + + rq->load_update = rq->niffies; @@ -4255,17 +4253,15 @@ index 000000000000..25d06f15e4e6 +static void update_irq_load_avg(struct rq *rq, long delta) +{ + long us_interval, load; -+ unsigned long curload; + + us_interval = NS_TO_US(rq->niffies - rq->irq_load_update); + if (unlikely(us_interval <= 0)) + return; + -+ curload = NS_TO_US(delta) / us_interval; + load = rq->irq_load_avg - (rq->irq_load_avg * us_interval * 5 / 262144); + if (unlikely(load < 0)) + load = 0; -+ load += curload * curload * SCHED_CAPACITY_SCALE * us_interval * 5 / 262144; ++ load += NS_TO_US(delta) * SCHED_CAPACITY_SCALE * 5 / 262144; + rq->irq_load_avg = load; + + rq->irq_load_update = rq->niffies; @@ -6964,7 +6960,7 @@ index 000000000000..25d06f15e4e6 + * Make sure the next tick runs within a reasonable + * amount of time. + */ -+ delta = rq_clock_task(rq) - curr->se.exec_start; ++ delta = rq_clock_task(rq) - curr->last_ran; + WARN_ON_ONCE(delta > (u64)NSEC_PER_SEC * 3); + } + task_tick(rq); @@ -12620,39 +12616,18 @@ index ad5b88a53c5a..4c9cd46d850f 100644 { .procname = "spin_retry", diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig -index fcc42353f125..46bb16d3c159 100644 +index fcc42353f125..60b4fd254c80 100644 --- a/kernel/time/Kconfig +++ b/kernel/time/Kconfig -@@ -66,6 +66,9 @@ config NO_HZ_COMMON - depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS - select TICK_ONESHOT +@@ -123,7 +123,7 @@ config CONTEXT_TRACKING -+config NO_HZ_FULL -+ bool -+ - choice - prompt "Timer tick handling" - default NO_HZ_IDLE if NO_HZ -@@ -87,8 +90,9 @@ config NO_HZ_IDLE - - Most of the time you want to say Y here. - --config NO_HZ_FULL -+config NO_HZ_FULL_NODEF - bool "Full dynticks system (tickless)" -+ select NO_HZ_FULL - # NO_HZ_COMMON dependency - depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS - # We need at least one periodic CPU for timekeeping -@@ -114,6 +118,8 @@ config NO_HZ_FULL - transitions: syscalls, exceptions and interrupts. Even when it's - dynamically off. - -+ Not recommended for desktops,laptops, or mobile devices. -+ - Say N. - - endchoice + config CONTEXT_TRACKING_FORCE + bool "Force context tracking" +- depends on CONTEXT_TRACKING ++ depends on CONTEXT_TRACKING && !SCHED_MUQSS + default y if !NO_HZ_FULL + help + The major pre-requirement for full dynticks to work is to diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index f5490222e134..544c58c29267 100644 --- a/kernel/time/clockevents.c