Revert "linux 6.1.y: Update Project C patchset to v6.1-r3 - https://gitlab.com/alfredchen/linux-prjc/-/commits/linux-6.1.y-prjc"

This reverts commit 3c4f81daa3.
This commit is contained in:
Tk-Glitch
2023-01-26 16:03:52 +01:00
parent 4616e8a334
commit ccc1e5cb69
2 changed files with 131 additions and 149 deletions

View File

@@ -723,7 +723,7 @@ _tkg_srcprep() {
elif [ "$_kver" = "518" ]; then elif [ "$_kver" = "518" ]; then
rev=2 rev=2
elif [ "$_kver" = "601" ]; then elif [ "$_kver" = "601" ]; then
rev=3 rev=1
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..acb8657e811d index 000000000000..572eab74418f
--- /dev/null --- /dev/null
+++ b/kernel/sched/alt_core.c +++ b/kernel/sched/alt_core.c
@@ -0,0 +1,7978 @@ @@ -0,0 +1,7961 @@
+/* +/*
+ * kernel/sched/alt_core.c + * kernel/sched/alt_core.c
+ * + *
@@ -665,6 +665,7 @@ index 000000000000..acb8657e811d
+#include <linux/init_task.h> +#include <linux/init_task.h>
+#include <linux/kcov.h> +#include <linux/kcov.h>
+#include <linux/kprobes.h> +#include <linux/kprobes.h>
+#include <linux/profile.h>
+#include <linux/nmi.h> +#include <linux/nmi.h>
+#include <linux/scs.h> +#include <linux/scs.h>
+ +
@@ -705,7 +706,7 @@ index 000000000000..acb8657e811d
+#define sched_feat(x) (0) +#define sched_feat(x) (0)
+#endif /* CONFIG_SCHED_DEBUG */ +#endif /* CONFIG_SCHED_DEBUG */
+ +
+#define ALT_SCHED_VERSION "v6.1-r3" +#define ALT_SCHED_VERSION "v6.1-r1"
+ +
+/* 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)
@@ -814,14 +815,14 @@ index 000000000000..acb8657e811d
+clear_recorded_preempt_mask(int pr, int low, int high, int cpu) +clear_recorded_preempt_mask(int pr, int low, int high, int cpu)
+{ +{
+ if (low < pr && pr <= high) + if (low < pr && pr <= high)
+ cpumask_clear_cpu(cpu, sched_preempt_mask + SCHED_QUEUE_BITS - pr); + cpumask_clear_cpu(cpu, sched_preempt_mask + SCHED_QUEUE_BITS - 1 - pr);
+} +}
+ +
+static inline void +static inline void
+set_recorded_preempt_mask(int pr, int low, int high, int cpu) +set_recorded_preempt_mask(int pr, int low, int high, int cpu)
+{ +{
+ if (low < pr && pr <= high) + if (low < pr && pr <= high)
+ cpumask_set_cpu(cpu, sched_preempt_mask + SCHED_QUEUE_BITS - pr); + cpumask_set_cpu(cpu, sched_preempt_mask + SCHED_QUEUE_BITS - 1 - pr);
+} +}
+ +
+static atomic_t sched_prio_record = ATOMIC_INIT(0); +static atomic_t sched_prio_record = ATOMIC_INIT(0);
@@ -1391,8 +1392,8 @@ index 000000000000..acb8657e811d
+ * Context: rq->lock + * Context: rq->lock
+ */ + */
+#define __SCHED_DEQUEUE_TASK(p, rq, flags) \ +#define __SCHED_DEQUEUE_TASK(p, rq, flags) \
+ sched_info_dequeue(rq, p); \
+ psi_dequeue(p, flags & DEQUEUE_SLEEP); \ + psi_dequeue(p, flags & DEQUEUE_SLEEP); \
+ sched_info_dequeue(rq, p); \
+ \ + \
+ list_del(&p->sq_node); \ + list_del(&p->sq_node); \
+ if (list_empty(&rq->queue.heads[p->sq_idx])) \ + if (list_empty(&rq->queue.heads[p->sq_idx])) \
@@ -2029,13 +2030,11 @@ index 000000000000..acb8657e811d
+ +
+ WARN_ON_ONCE(is_migration_disabled(p)); + WARN_ON_ONCE(is_migration_disabled(p));
+#endif +#endif
+ if (task_cpu(p) == new_cpu)
+ return;
+ trace_sched_migrate_task(p, new_cpu); + trace_sched_migrate_task(p, new_cpu);
+
+ if (task_cpu(p) != new_cpu)
+ {
+ rseq_migrate(p); + rseq_migrate(p);
+ perf_event_task_migrate(p); + perf_event_task_migrate(p);
+ }
+ +
+ __set_task_cpu(p, new_cpu); + __set_task_cpu(p, new_cpu);
+} +}
@@ -5111,15 +5110,15 @@ index 000000000000..acb8657e811d
+ if (src_rq->nr_running < 2) + if (src_rq->nr_running < 2)
+ cpumask_clear_cpu(i, &sched_rq_pending_mask); + cpumask_clear_cpu(i, &sched_rq_pending_mask);
+ +
+ spin_release(&src_rq->lock.dep_map, _RET_IP_);
+ do_raw_spin_unlock(&src_rq->lock);
+
+ rq->nr_running += nr_migrated; + rq->nr_running += nr_migrated;
+ if (rq->nr_running > 1) + if (rq->nr_running > 1)
+ cpumask_set_cpu(cpu, &sched_rq_pending_mask); + cpumask_set_cpu(cpu, &sched_rq_pending_mask);
+ +
+ cpufreq_update_util(rq, 0); + cpufreq_update_util(rq, 0);
+ +
+ spin_release(&src_rq->lock.dep_map, _RET_IP_);
+ do_raw_spin_unlock(&src_rq->lock);
+
+ return 1; + return 1;
+ } + }
+ +
@@ -5148,7 +5147,7 @@ index 000000000000..acb8657e811d
+} +}
+ +
+static inline struct task_struct * +static inline struct task_struct *
+choose_next_task(struct rq *rq, int cpu) +choose_next_task(struct rq *rq, int cpu, struct task_struct *prev)
+{ +{
+ struct task_struct *next; + struct task_struct *next;
+ +
@@ -5335,7 +5334,7 @@ index 000000000000..acb8657e811d
+ +
+ check_curr(prev, rq); + check_curr(prev, rq);
+ +
+ next = choose_next_task(rq, cpu); + next = choose_next_task(rq, cpu, prev);
+ clear_tsk_need_resched(prev); + clear_tsk_need_resched(prev);
+ clear_preempt_need_resched(); + clear_preempt_need_resched();
+#ifdef CONFIG_SCHED_DEBUG +#ifdef CONFIG_SCHED_DEBUG
@@ -5765,7 +5764,6 @@ index 000000000000..acb8657e811d
+ return; + return;
+ +
+ rq = __task_access_lock(p, &lock); + rq = __task_access_lock(p, &lock);
+ update_rq_clock(rq);
+ /* + /*
+ * Set under pi_lock && rq->lock, such that the value can be used under + * Set under pi_lock && rq->lock, such that the value can be used under
+ * either lock. + * either lock.
@@ -6645,13 +6643,6 @@ index 000000000000..acb8657e811d
+ return retval; + return retval;
+} +}
+ +
+#ifdef CONFIG_SMP
+int dl_task_check_affinity(struct task_struct *p, const struct cpumask *mask)
+{
+ return 0;
+}
+#endif
+
+static int +static int
+__sched_setaffinity(struct task_struct *p, const struct cpumask *mask) +__sched_setaffinity(struct task_struct *p, const struct cpumask *mask)
+{ +{
@@ -8036,14 +8027,6 @@ index 000000000000..acb8657e811d
+ +
+ sched_smp_initialized = true; + sched_smp_initialized = true;
+} +}
+
+static int __init migration_init(void)
+{
+ sched_cpu_starting(smp_processor_id());
+ return 0;
+}
+early_initcall(migration_init);
+
+#else +#else
+void __init sched_init_smp(void) +void __init sched_init_smp(void)
+{ +{
@@ -8653,15 +8636,14 @@ index 000000000000..1212a031700e
+{} +{}
diff --git a/kernel/sched/alt_sched.h b/kernel/sched/alt_sched.h diff --git a/kernel/sched/alt_sched.h b/kernel/sched/alt_sched.h
new file mode 100644 new file mode 100644
index 000000000000..c32403ed82b6 index 000000000000..e3b6320a397a
--- /dev/null --- /dev/null
+++ b/kernel/sched/alt_sched.h +++ b/kernel/sched/alt_sched.h
@@ -0,0 +1,668 @@ @@ -0,0 +1,667 @@
+#ifndef ALT_SCHED_H +#ifndef ALT_SCHED_H
+#define ALT_SCHED_H +#define ALT_SCHED_H
+ +
+#include <linux/context_tracking.h> +#include <linux/context_tracking.h>
+#include <linux/profile.h>
+#include <linux/psi.h> +#include <linux/psi.h>
+#include <linux/stop_machine.h> +#include <linux/stop_machine.h>
+#include <linux/syscalls.h> +#include <linux/syscalls.h>