linux518: Update Project C to v5.18-r2

https://gitlab.com/alfredchen/linux-prjc/-/commits/linux-5.18.y-prjc
This commit is contained in:
Tk-Glitch
2022-07-12 23:36:39 +02:00
parent 634be6cea3
commit cf70e42101
3 changed files with 136 additions and 155 deletions

View File

@@ -59,7 +59,7 @@ else
fi fi
pkgname=("${pkgbase}" "${pkgbase}-headers") pkgname=("${pkgbase}" "${pkgbase}-headers")
pkgver="${_basekernel}"."${_sub}" pkgver="${_basekernel}"."${_sub}"
pkgrel=263 pkgrel=264
pkgdesc='Linux-tkg' pkgdesc='Linux-tkg'
arch=('x86_64') # no i686 in here arch=('x86_64') # no i686 in here
url="https://www.kernel.org/" url="https://www.kernel.org/"
@@ -761,7 +761,7 @@ case $_basever in
0008-5.18-bcachefs.patch 0008-5.18-bcachefs.patch
0009-glitched-ondemand-bmq.patch 0009-glitched-ondemand-bmq.patch
0009-glitched-bmq.patch 0009-glitched-bmq.patch
0009-prjc_v5.18-r1.patch 0009-prjc_v5.18-r2.patch
#0012-linux-hardened.patch #0012-linux-hardened.patch
0012-misc-additions.patch 0012-misc-additions.patch
# MM Dirty Soft for WRITE_WATCH support in Wine # MM Dirty Soft for WRITE_WATCH support in Wine
@@ -785,7 +785,7 @@ case $_basever in
'86aab236478c138b2e88d64b84edf550bafbc4e06ab330ce0ffa7f2a9f5bab85' '86aab236478c138b2e88d64b84edf550bafbc4e06ab330ce0ffa7f2a9f5bab85'
'9fad4a40449e09522899955762c8928ae17f4cdaa16e01239fd12592e9d58177' '9fad4a40449e09522899955762c8928ae17f4cdaa16e01239fd12592e9d58177'
'a557b342111849a5f920bbe1c129f3ff1fc1eff62c6bd6685e0972fc88e39911' 'a557b342111849a5f920bbe1c129f3ff1fc1eff62c6bd6685e0972fc88e39911'
'766658d5ec9cf204635f735a8927854991d0133b2e34bdcd9ca36d7e34817e27' 'bb8a2daf56a513701895f67dc0e6cbde153481fcd0557906af45523d24aa9f76'
'428517fbcb161a640b53782000c16f797c2ad27cf2758e7e56133fc62d2d113b' '428517fbcb161a640b53782000c16f797c2ad27cf2758e7e56133fc62d2d113b'
'1b656ad96004f27e9dc63d7f430b50d5c48510d6d4cd595a81c24b21adb70313' '1b656ad96004f27e9dc63d7f430b50d5c48510d6d4cd595a81c24b21adb70313'
'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6') 'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6')

View File

@@ -532,7 +532,7 @@ _tkg_srcprep() {
elif [ "$_basever" = "516" ]; then elif [ "$_basever" = "516" ]; then
rev=1 rev=1
elif [ "$_basever" = "518" ]; then elif [ "$_basever" = "518" ]; then
rev=1 rev=2
else else
rev=0 rev=0
fi fi

View File

@@ -632,10 +632,10 @@ index 976092b7bd45..31d587c16ec1 100644
obj-y += build_utility.o obj-y += build_utility.o
diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
new file mode 100644 new file mode 100644
index 000000000000..a466a05301b8 index 000000000000..b8e67d568e17
--- /dev/null --- /dev/null
+++ b/kernel/sched/alt_core.c +++ b/kernel/sched/alt_core.c
@@ -0,0 +1,7768 @@ @@ -0,0 +1,7750 @@
+/* +/*
+ * kernel/sched/alt_core.c + * kernel/sched/alt_core.c
+ * + *
@@ -679,11 +679,11 @@ index 000000000000..a466a05301b8
+ +
+#include "sched.h" +#include "sched.h"
+ +
+#include "pelt.h"
+
+#include "../../fs/io-wq.h" +#include "../../fs/io-wq.h"
+#include "../smpboot.h" +#include "../smpboot.h"
+ +
+#include "pelt.h"
+
+/* +/*
+ * Export tracepoints that act as a bare tracehook (ie: have no trace event + * Export tracepoints that act as a bare tracehook (ie: have no trace event
+ * associated with them) to allow external modules to probe them. + * associated with them) to allow external modules to probe them.
@@ -705,7 +705,7 @@ index 000000000000..a466a05301b8
+#define sched_feat(x) (0) +#define sched_feat(x) (0)
+#endif /* CONFIG_SCHED_DEBUG */ +#endif /* CONFIG_SCHED_DEBUG */
+ +
+#define ALT_SCHED_VERSION "v5.18-r1" +#define ALT_SCHED_VERSION "v5.18-r2"
+ +
+/* rt_prio(prio) defined in include/linux/sched/rt.h */ +/* rt_prio(prio) defined in include/linux/sched/rt.h */
+#define rt_task(p) rt_prio((p)->prio) +#define rt_task(p) rt_prio((p)->prio)
@@ -785,14 +785,14 @@ index 000000000000..a466a05301b8
+#ifdef CONFIG_SCHED_SMT +#ifdef CONFIG_SCHED_SMT
+static cpumask_t sched_sg_idle_mask ____cacheline_aligned_in_smp; +static cpumask_t sched_sg_idle_mask ____cacheline_aligned_in_smp;
+#endif +#endif
+static cpumask_t sched_rq_watermark[SCHED_BITS] ____cacheline_aligned_in_smp; +static cpumask_t sched_rq_watermark[SCHED_QUEUE_BITS] ____cacheline_aligned_in_smp;
+ +
+/* sched_queue related functions */ +/* sched_queue related functions */
+static inline void sched_queue_init(struct sched_queue *q) +static inline void sched_queue_init(struct sched_queue *q)
+{ +{
+ int i; + int i;
+ +
+ bitmap_zero(q->bitmap, SCHED_BITS); + bitmap_zero(q->bitmap, SCHED_QUEUE_BITS);
+ for(i = 0; i < SCHED_BITS; i++) + for(i = 0; i < SCHED_BITS; i++)
+ INIT_LIST_HEAD(&q->heads[i]); + INIT_LIST_HEAD(&q->heads[i]);
+} +}
@@ -824,7 +824,7 @@ index 000000000000..a466a05301b8
+ cpu = cpu_of(rq); + cpu = cpu_of(rq);
+ if (watermark < last_wm) { + if (watermark < last_wm) {
+ for (i = last_wm; i > watermark; i--) + for (i = last_wm; i > watermark; i--)
+ cpumask_clear_cpu(cpu, sched_rq_watermark + SCHED_BITS - 1 - i); + cpumask_clear_cpu(cpu, sched_rq_watermark + SCHED_QUEUE_BITS - i);
+#ifdef CONFIG_SCHED_SMT +#ifdef CONFIG_SCHED_SMT
+ if (static_branch_likely(&sched_smt_present) && + if (static_branch_likely(&sched_smt_present) &&
+ IDLE_TASK_SCHED_PRIO == last_wm) + IDLE_TASK_SCHED_PRIO == last_wm)
@@ -835,7 +835,7 @@ index 000000000000..a466a05301b8
+ } + }
+ /* last_wm < watermark */ + /* last_wm < watermark */
+ for (i = watermark; i > last_wm; i--) + for (i = watermark; i > last_wm; i--)
+ cpumask_set_cpu(cpu, sched_rq_watermark + SCHED_BITS - 1 - i); + cpumask_set_cpu(cpu, sched_rq_watermark + SCHED_QUEUE_BITS - i);
+#ifdef CONFIG_SCHED_SMT +#ifdef CONFIG_SCHED_SMT
+ if (static_branch_likely(&sched_smt_present) && + if (static_branch_likely(&sched_smt_present) &&
+ IDLE_TASK_SCHED_PRIO == watermark) { + IDLE_TASK_SCHED_PRIO == watermark) {
@@ -2543,7 +2543,7 @@ index 000000000000..a466a05301b8
+#endif +#endif
+ cpumask_and(&tmp, &chk_mask, sched_rq_watermark) || + cpumask_and(&tmp, &chk_mask, sched_rq_watermark) ||
+ cpumask_and(&tmp, &chk_mask, + cpumask_and(&tmp, &chk_mask,
+ sched_rq_watermark + SCHED_BITS - task_sched_prio(p))) + 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), &tmp);
+ +
+ return best_mask_cpu(task_cpu(p), &chk_mask); + return best_mask_cpu(task_cpu(p), &chk_mask);
@@ -4334,24 +4334,6 @@ index 000000000000..a466a05301b8
+ */ + */
+void sched_exec(void) +void sched_exec(void)
+{ +{
+ struct task_struct *p = current;
+ unsigned long flags;
+ int dest_cpu;
+
+ raw_spin_lock_irqsave(&p->pi_lock, flags);
+ dest_cpu = cpumask_any(p->cpus_ptr);
+ if (dest_cpu == smp_processor_id())
+ goto unlock;
+
+ if (likely(cpu_active(dest_cpu))) {
+ struct migration_arg arg = { p, dest_cpu };
+
+ raw_spin_unlock_irqrestore(&p->pi_lock, flags);
+ stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg);
+ return;
+ }
+unlock:
+ raw_spin_unlock_irqrestore(&p->pi_lock, flags);
+} +}
+ +
+#endif +#endif
@@ -4519,7 +4501,7 @@ index 000000000000..a466a05301b8
+} +}
+ +
+#ifdef CONFIG_SCHED_SMT +#ifdef CONFIG_SCHED_SMT
+static inline int active_load_balance_cpu_stop(void *data) +static inline int sg_balance_cpu_stop(void *data)
+{ +{
+ struct rq *rq = this_rq(); + struct rq *rq = this_rq();
+ struct task_struct *p = data; + struct task_struct *p = data;
@@ -4570,15 +4552,15 @@ index 000000000000..a466a05301b8
+ raw_spin_unlock_irqrestore(&rq->lock, flags); + raw_spin_unlock_irqrestore(&rq->lock, flags);
+ +
+ if (res) + if (res)
+ stop_one_cpu_nowait(cpu, active_load_balance_cpu_stop, + stop_one_cpu_nowait(cpu, sg_balance_cpu_stop, curr,
+ curr, &rq->active_balance_work); + &rq->active_balance_work);
+ return res; + return res;
+} +}
+ +
+/* +/*
+ * sg_balance_check - slibing group balance check for run queue @rq + * sg_balance - slibing group balance check for run queue @rq
+ */ + */
+static inline void sg_balance_check(struct rq *rq) +static inline void sg_balance(struct rq *rq)
+{ +{
+ cpumask_t chk; + cpumask_t chk;
+ int cpu = cpu_of(rq); + int cpu = cpu_of(rq);
@@ -5243,7 +5225,7 @@ index 000000000000..a466a05301b8
+ } + }
+ +
+#ifdef CONFIG_SCHED_SMT +#ifdef CONFIG_SCHED_SMT
+ sg_balance_check(rq); + sg_balance(rq);
+#endif +#endif
+} +}
+ +
@@ -7884,7 +7866,7 @@ index 000000000000..a466a05301b8
+ wait_bit_init(); + wait_bit_init();
+ +
+#ifdef CONFIG_SMP +#ifdef CONFIG_SMP
+ for (i = 0; i < SCHED_BITS; i++) + for (i = 0; i < SCHED_QUEUE_BITS; i++)
+ cpumask_copy(sched_rq_watermark + i, cpu_present_mask); + cpumask_copy(sched_rq_watermark + i, cpu_present_mask);
+#endif +#endif
+ +
@@ -9094,10 +9076,10 @@ index 000000000000..611424bbfa9b
+#endif /* ALT_SCHED_H */ +#endif /* ALT_SCHED_H */
diff --git a/kernel/sched/bmq.h b/kernel/sched/bmq.h diff --git a/kernel/sched/bmq.h b/kernel/sched/bmq.h
new file mode 100644 new file mode 100644
index 000000000000..bf7ac80ec242 index 000000000000..66b77291b9d0
--- /dev/null --- /dev/null
+++ b/kernel/sched/bmq.h +++ b/kernel/sched/bmq.h
@@ -0,0 +1,111 @@ @@ -0,0 +1,110 @@
+#define ALT_SCHED_VERSION_MSG "sched/bmq: BMQ CPU Scheduler "ALT_SCHED_VERSION" by Alfred Chen.\n" +#define ALT_SCHED_VERSION_MSG "sched/bmq: BMQ CPU Scheduler "ALT_SCHED_VERSION" by Alfred Chen.\n"
+ +
+/* +/*
@@ -9185,8 +9167,7 @@ index 000000000000..bf7ac80ec242
+ +
+static void sched_task_fork(struct task_struct *p, struct rq *rq) +static void sched_task_fork(struct task_struct *p, struct rq *rq)
+{ +{
+ p->boost_prio = (p->boost_prio < 0) ? + p->boost_prio = MAX_PRIORITY_ADJ;
+ p->boost_prio + MAX_PRIORITY_ADJ : MAX_PRIORITY_ADJ;
+} +}
+ +
+static inline void do_sched_yield_type_1(struct task_struct *p, struct rq *rq) +static inline void do_sched_yield_type_1(struct task_struct *p, struct rq *rq)