linux56-tkg: Sync our BMQ patchset with upstream fixes

70ef06c844

d394787c8c
This commit is contained in:
Tk-Glitch 2020-04-08 04:56:01 +02:00
parent d14b9caefc
commit 1e7f731ba9
2 changed files with 78 additions and 2 deletions

View File

@ -89,7 +89,7 @@ pkgname=("${pkgbase}" "${pkgbase}-headers")
_basekernel=5.6 _basekernel=5.6
_sub=2 _sub=2
pkgver="${_basekernel}"."${_sub}" pkgver="${_basekernel}"."${_sub}"
pkgrel=6 pkgrel=7
pkgdesc='Linux-tkg' pkgdesc='Linux-tkg'
arch=('x86_64') # no i686 in here arch=('x86_64') # no i686 in here
url="http://www.kernel.org/" url="http://www.kernel.org/"
@ -140,7 +140,7 @@ sha256sums=('e342b04a2aa63808ea0ef1baab28fc520bd031ef8cf93d9ee4a31d4058fcb622'
'2d9260b80b43bbd605cf420d6bd53aa7262103dfd77196ba590ece5600b6dc0d' '2d9260b80b43bbd605cf420d6bd53aa7262103dfd77196ba590ece5600b6dc0d'
'9fad4a40449e09522899955762c8928ae17f4cdaa16e01239fd12592e9d58177' '9fad4a40449e09522899955762c8928ae17f4cdaa16e01239fd12592e9d58177'
'965a517a283f265a012545fbb5cc9e516efc9f6166d2aa1baf7293a32a1086b7' '965a517a283f265a012545fbb5cc9e516efc9f6166d2aa1baf7293a32a1086b7'
'd42ab10e8ff39acd3a9211fc83313c6fb7a69ae0c2d39deb7946c7516c0d5cd5' 'fee8594610e5535296bd57dfa21af281cf161264f0f466f204a1dc1a2aa8e0dc'
'49262ce4a8089fa70275aad742fc914baa28d9c384f710c9a62f64796d13e104' '49262ce4a8089fa70275aad742fc914baa28d9c384f710c9a62f64796d13e104'
'5fe8b22389d9df109f80fc4785908d1c32f1d469f5ef32fee613a0937965469e') '5fe8b22389d9df109f80fc4785908d1c32f1d469f5ef32fee613a0937965469e')

View File

@ -7565,3 +7565,79 @@ index b5e3496cf803..545be2c4f07c 100644
}; };
struct wakeup_test_data *x = data; struct wakeup_test_data *x = data;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 911b30506c83336a94a2748a321060ab11e8f9a7..f38d1343e2bfeb728637be4959120a7b37351b1a 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2484,6 +2484,19 @@ static inline void membarrier_switch_mm(struct rq *rq,
}
#endif
+#ifdef CONFIG_SMP
+static inline bool is_per_cpu_kthread(struct task_struct *p)
+{
+ if (!(p->flags & PF_KTHREAD))
+ return false;
+
+ if (p->nr_cpus_allowed != 1)
+ return false;
+
+ return true;
+}
+#endif
+
static inline int task_running_nice(struct task_struct *p)
{
return (task_nice(p) > 0);
diff --git a/kernel/sched/bmq.c b/kernel/sched/bmq.c
index e6d6fc98bead621f0ea7bfaf885b66af523413c1..fed5e132f2af67007f70851527a401b8f0f79cd1 100644
--- a/kernel/sched/bmq.c
+++ b/kernel/sched/bmq.c
@@ -5499,14 +5499,12 @@ static void sched_init_topology_cpumask_early(void)
}
}
-#define TOPOLOGY_CPUMASK(name, func) \
- if (cpumask_and(chk, chk, func(cpu))) { \
- per_cpu(sched_cpu_llc_mask, cpu) = chk; \
- per_cpu(sd_llc_id, cpu) = cpumask_first(func(cpu)); \
- printk(KERN_INFO "bmq: cpu#%d affinity mask - "#name" 0x%08lx", \
+#define TOPOLOGY_CPUMASK(name, mask, last) \
+ if (cpumask_and(chk, chk, mask)) \
+ printk(KERN_INFO "bmq: cpu#%02d affinity mask: 0x%08lx - "#name,\
cpu, (chk++)->bits[0]); \
- } \
- cpumask_complement(chk, func(cpu))
+ if (!last) \
+ cpumask_complement(chk, mask)
static void sched_init_topology_cpumask(void)
{
@@ -5518,20 +5516,18 @@ static void sched_init_topology_cpumask(void)
cpumask_complement(chk, cpumask_of(cpu));
#ifdef CONFIG_SCHED_SMT
- TOPOLOGY_CPUMASK(smt, topology_sibling_cpumask);
-#endif
-#ifdef CONFIG_SCHED_MC
- TOPOLOGY_CPUMASK(coregroup, cpu_coregroup_mask);
+ TOPOLOGY_CPUMASK(smt, topology_sibling_cpumask(cpu), false);
#endif
+ per_cpu(sd_llc_id, cpu) = cpumask_first(cpu_coregroup_mask(cpu));
+ per_cpu(sched_cpu_llc_mask, cpu) = chk;
+ TOPOLOGY_CPUMASK(coregroup, cpu_coregroup_mask(cpu), false);
- TOPOLOGY_CPUMASK(core, topology_core_cpumask);
+ TOPOLOGY_CPUMASK(core, topology_core_cpumask(cpu), false);
- if (cpumask_and(chk, chk, cpu_online_mask))
- printk(KERN_INFO "bmq: cpu#%d affinity mask - others 0x%08lx",
- cpu, (chk++)->bits[0]);
+ TOPOLOGY_CPUMASK(others, cpu_online_mask, true);
per_cpu(sched_cpu_affinity_end_mask, cpu) = chk;
- printk(KERN_INFO "bmq: cpu#%d llc_id = %d, llc_mask idx = %d\n",
+ printk(KERN_INFO "bmq: cpu#%02d llc_id = %d, llc_mask idx = %d\n",
cpu, per_cpu(sd_llc_id, cpu),
(int) (per_cpu(sched_cpu_llc_mask, cpu) -
&(per_cpu(sched_cpu_affinity_masks, cpu)[0])));