diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2017-10-01 23:53:53 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2017-10-01 23:53:53 -0400 |
commit | 303544ccd49236776435142800f7a60d97e7ed16 (patch) | |
tree | 4384d1c315180382a88e0ed4a31d61d3dbaef879 | |
parent | c5c5f525611e97a1aed5670c0d499070ee98163a (diff) | |
download | 4.12-rt-patches-303544ccd49236776435142800f7a60d97e7ed16.tar.gz |
refresh kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch for vanilla 4.11
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | patches/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch | 180 |
1 files changed, 103 insertions, 77 deletions
diff --git a/patches/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/patches/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index c5f431799ab90b..248e6bb41cddb1 100644 --- a/patches/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/patches/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch @@ -1,3 +1,4 @@ +From 1160ade4f9182a801727627adcfd73f1ad6f6659 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 4 Apr 2017 12:50:16 +0200 Subject: [PATCH] kernel: sched: Provide a pointer to the valid CPU mask @@ -55,36 +56,12 @@ Cc: Mike Galbraith <efault@gmx.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/ia64/kernel/mca.c | 2 - - arch/mips/include/asm/switch_to.h | 4 +- - arch/mips/kernel/mips-mt-fpaff.c | 2 - - arch/mips/kernel/traps.c | 6 ++-- - arch/powerpc/platforms/cell/spufs/sched.c | 2 - - arch/tile/include/asm/setup.h | 2 - - arch/tile/kernel/hardwall.c | 10 +++--- - drivers/infiniband/hw/hfi1/affinity.c | 6 ++-- - drivers/infiniband/hw/hfi1/sdma.c | 3 -- - drivers/infiniband/hw/qib/qib_file_ops.c | 7 ++-- - fs/proc/array.c | 4 +- - include/linux/init_task.h | 3 +- - include/linux/sched.h | 5 ++- - kernel/cgroup/cpuset.c | 2 - - kernel/fork.c | 2 + - kernel/sched/core.c | 42 ++++++++++++++--------------- - kernel/sched/cpudeadline.c | 4 +- - kernel/sched/cpupri.c | 4 +- - kernel/sched/deadline.c | 6 ++-- - kernel/sched/fair.c | 28 +++++++++---------- - kernel/sched/rt.c | 4 +- - kernel/trace/trace_hwlat.c | 2 - - lib/smp_processor_id.c | 2 - - samples/trace_events/trace-events-sample.c | 2 - - 24 files changed, 78 insertions(+), 76 deletions(-) +diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c +index 79c7c46d7dc1..f5f116e1a504 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c -@@ -1824,7 +1824,7 @@ format_mca_init_stack(void *mca_data, un +@@ -1824,7 +1824,7 @@ format_mca_init_stack(void *mca_data, unsigned long offset, ti->cpu = cpu; p->stack = ti; p->state = TASK_UNINTERRUPTIBLE; @@ -93,6 +70,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> INIT_LIST_HEAD(&p->tasks); p->parent = p->real_parent = p->group_leader = p; INIT_LIST_HEAD(&p->children); +diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h +index e610473d61b8..1428b4febbc9 100644 --- a/arch/mips/include/asm/switch_to.h +++ b/arch/mips/include/asm/switch_to.h @@ -42,7 +42,7 @@ extern struct task_struct *ll_task; @@ -113,9 +92,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } \ next->thread.emulated_fp = 0; \ } while(0) +diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c +index 8cab633e0e5a..f64555ea9068 100644 --- a/arch/mips/kernel/mips-mt-fpaff.c +++ b/arch/mips/kernel/mips-mt-fpaff.c -@@ -176,7 +176,7 @@ asmlinkage long mipsmt_sys_sched_getaffi +@@ -176,7 +176,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, if (retval) goto out_unlock; @@ -124,9 +105,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cpumask_and(&mask, &allowed, cpu_active_mask); out_unlock: +diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c +index b49e7bf9f950..176d2777a5d7 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c -@@ -1193,12 +1193,12 @@ static void mt_ase_fp_affinity(void) +@@ -1191,12 +1191,12 @@ static void mt_ase_fp_affinity(void) * restricted the allowed set to exclude any CPUs with FPUs, * we'll skip the procedure. */ @@ -142,9 +125,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> &mt_fpu_cpumask); set_cpus_allowed_ptr(current, &tmask); set_thread_flag(TIF_FPUBOUND); +diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c +index 1fbb5da17dd2..ca86366d5424 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c -@@ -141,7 +141,7 @@ void __spu_update_sched_info(struct spu_ +@@ -141,7 +141,7 @@ void __spu_update_sched_info(struct spu_context *ctx) * runqueue. The context will be rescheduled on the proper node * if it is timesliced or preempted. */ @@ -153,6 +138,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Save the current cpu id for spu interrupt routing. */ ctx->last_ran = raw_smp_processor_id(); +diff --git a/arch/tile/include/asm/setup.h b/arch/tile/include/asm/setup.h +index 2a0347af0702..670fa2f4cfc3 100644 --- a/arch/tile/include/asm/setup.h +++ b/arch/tile/include/asm/setup.h @@ -49,7 +49,7 @@ int hardwall_ipi_valid(int cpu); @@ -164,9 +151,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> hardwall_deactivate_all(p); \ } while (0) #endif +diff --git a/arch/tile/kernel/hardwall.c b/arch/tile/kernel/hardwall.c +index 2fd1694ac1d0..98f4fb696289 100644 --- a/arch/tile/kernel/hardwall.c +++ b/arch/tile/kernel/hardwall.c -@@ -590,12 +590,12 @@ static int hardwall_activate(struct hard +@@ -590,12 +590,12 @@ static int hardwall_activate(struct hardwall_info *info) * Get our affinity; if we're not bound to this tile uniquely, * we can't access the network registers. */ @@ -181,7 +170,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!cpumask_test_cpu(cpu, &info->cpumask)) return -EINVAL; -@@ -621,17 +621,17 @@ static int hardwall_activate(struct hard +@@ -621,17 +621,17 @@ static int hardwall_activate(struct hardwall_info *info) * Deactivate a task's hardwall. Must hold lock for hardwall_type. * This method may be called from exit_thread(), so we don't want to * rely on too many fields of struct task_struct still being valid. @@ -202,6 +191,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> BUG(); } +diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c +index e2cd2cd3b28a..822873226a19 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c @@ -576,7 +576,7 @@ int hfi1_get_proc_affinity(int node) @@ -231,9 +222,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> hfi1_cdbg(PROC, "PID %u %s affinity set to CPU set(s) %*pbl", current->pid, current->comm, cpumask_pr_args(proc_mask)); +diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c +index 5cde1ecda0fe..d8555c2d232c 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c -@@ -856,14 +856,13 @@ struct sdma_engine *sdma_select_user_eng +@@ -856,14 +856,13 @@ struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd, { struct sdma_rht_node *rht_node; struct sdma_engine *sde = NULL; @@ -249,9 +242,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto out; cpu_id = smp_processor_id(); +diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c +index 9396c1807cc3..a42fcd4735cb 100644 --- a/drivers/infiniband/hw/qib/qib_file_ops.c +++ b/drivers/infiniband/hw/qib/qib_file_ops.c -@@ -1163,7 +1163,7 @@ static unsigned int qib_poll(struct file +@@ -1163,7 +1163,7 @@ static unsigned int qib_poll(struct file *fp, struct poll_table_struct *pt) static void assign_ctxt_affinity(struct file *fp, struct qib_devdata *dd) { struct qib_filedata *fd = fp->private_data; @@ -260,7 +255,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> const struct cpumask *local_mask = cpumask_of_pcibus(dd->pcidev->bus); int local_cpu; -@@ -1644,9 +1644,8 @@ static int qib_assign_ctxt(struct file * +@@ -1644,9 +1644,8 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo) ret = find_free_ctxt(i_minor - 1, fp, uinfo); else { int unit; @@ -272,9 +267,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (weight == 1 && !test_bit(cpu, qib_cpulist)) if (!find_hca(cpu, &unit) && unit >= 0) +diff --git a/fs/proc/array.c b/fs/proc/array.c +index 88c355574aa0..5fe112bce201 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c -@@ -364,9 +364,9 @@ static inline void task_context_switch_c +@@ -364,9 +364,9 @@ static inline void task_context_switch_counts(struct seq_file *m, static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) { seq_printf(m, "Cpus_allowed:\t%*pb\n", @@ -286,6 +283,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, +diff --git a/include/linux/init_task.h b/include/linux/init_task.h +index 2c487e0879d5..f760c3ac8fc6 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -226,7 +226,8 @@ extern struct cred init_cred; @@ -298,6 +297,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> .nr_cpus_allowed= NR_CPUS, \ .mm = NULL, \ .active_mm = &init_mm, \ +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 84b2910e6d5d..2de83101e548 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -535,7 +535,8 @@ struct task_struct { @@ -319,9 +320,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ +diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c +index 0f41292be0fb..5bb6d48cfece 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c -@@ -2092,7 +2092,7 @@ static void cpuset_fork(struct task_stru +@@ -2092,7 +2092,7 @@ static void cpuset_fork(struct task_struct *task) if (task_css_is_root(task, cpuset_cgrp_id)) return; @@ -330,10 +333,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> task->mems_allowed = current->mems_allowed; } +diff --git a/kernel/fork.c b/kernel/fork.c +index b30196a00b0d..5d8e25b1a0de 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -539,6 +539,8 @@ static struct task_struct *dup_task_stru - tsk->stack_canary = get_random_long(); +@@ -539,6 +539,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) + tsk->stack_canary = get_random_int(); #endif + if (orig->cpus_ptr == &orig->cpus_mask) @@ -341,9 +346,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * One for us, one for whoever does the "release_task()" (usually * parent) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 1199a4275095..1ce68555bf2c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -986,7 +986,7 @@ static struct rq *__migrate_task(struct +@@ -986,7 +986,7 @@ static struct rq *__migrate_task(struct rq *rq, struct task_struct *p, int dest_ return rq; /* Affinity changed (again). */ @@ -352,7 +359,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return rq; rq = move_queued_task(rq, p, dest_cpu); -@@ -1012,7 +1012,7 @@ static int migration_cpu_stop(void *data +@@ -1012,7 +1012,7 @@ static int migration_cpu_stop(void *data) local_irq_disable(); /* * We need to explicitly wake pending tasks before running @@ -361,7 +368,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * during wakeups, see set_cpus_allowed_ptr()'s TASK_WAKING test. */ sched_ttwu_pending(); -@@ -1043,7 +1043,7 @@ static int migration_cpu_stop(void *data +@@ -1043,7 +1043,7 @@ static int migration_cpu_stop(void *data) */ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_mask) { @@ -370,7 +377,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> p->nr_cpus_allowed = cpumask_weight(new_mask); } -@@ -1113,7 +1113,7 @@ static int __set_cpus_allowed_ptr(struct +@@ -1113,7 +1113,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, goto out; } @@ -392,7 +399,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto unlock; __migrate_swap_task(arg->src_task, arg->dst_cpu); -@@ -1308,10 +1308,10 @@ int migrate_swap(struct task_struct *cur +@@ -1308,10 +1308,10 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p) if (!cpu_active(arg.src_cpu) || !cpu_active(arg.dst_cpu)) goto out; @@ -414,7 +421,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * * A few notes on cpu_active vs cpu_online: * -@@ -1495,14 +1495,14 @@ static int select_fallback_rq(int cpu, s +@@ -1495,14 +1495,14 @@ static int select_fallback_rq(int cpu, struct task_struct *p) for_each_cpu(dest_cpu, nodemask) { if (!cpu_active(dest_cpu)) continue; @@ -431,7 +438,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!(p->flags & PF_KTHREAD) && !cpu_active(dest_cpu)) continue; if (!cpu_online(dest_cpu)) -@@ -1547,7 +1547,7 @@ static int select_fallback_rq(int cpu, s +@@ -1547,7 +1547,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p) } /* @@ -440,7 +447,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ static inline int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) -@@ -1557,11 +1557,11 @@ int select_task_rq(struct task_struct *p +@@ -1557,11 +1557,11 @@ int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) if (p->nr_cpus_allowed > 1) cpu = p->sched_class->select_task_rq(p, cpu, sd_flags, wake_flags); else @@ -454,7 +461,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * CPU. * * Since this is common to all placement strategies, this lives here. -@@ -1569,7 +1569,7 @@ int select_task_rq(struct task_struct *p +@@ -1569,7 +1569,7 @@ int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) * [ this allows ->select_task() to simply return task_cpu(p) and * not worry about this generic constraint ] */ @@ -463,7 +470,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> !cpu_online(cpu))) cpu = select_fallback_rq(task_cpu(p), p); -@@ -2543,7 +2543,7 @@ void wake_up_new_task(struct task_struct +@@ -2543,7 +2543,7 @@ void wake_up_new_task(struct task_struct *p) #ifdef CONFIG_SMP /* * Fork balancing, do it here and not earlier because: @@ -472,7 +479,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * - any previously selected CPU might disappear through hotplug * * Use __set_task_cpu() to avoid calling sched_class::migrate_task_rq, -@@ -4315,7 +4315,7 @@ static int __sched_setscheduler(struct t +@@ -4315,7 +4315,7 @@ static int __sched_setscheduler(struct task_struct *p, * the entire root_domain to become SCHED_DEADLINE. We * will also fail if there's no bandwidth available. */ @@ -481,7 +488,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rq->rd->dl_bw.bw == 0) { task_rq_unlock(rq, p, &rf); return -EPERM; -@@ -4909,7 +4909,7 @@ long sched_getaffinity(pid_t pid, struct +@@ -4909,7 +4909,7 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask) goto out_unlock; raw_spin_lock_irqsave(&p->pi_lock, flags); @@ -490,7 +497,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irqrestore(&p->pi_lock, flags); out_unlock: -@@ -5469,7 +5469,7 @@ int task_can_attach(struct task_struct * +@@ -5469,7 +5469,7 @@ int task_can_attach(struct task_struct *p, * allowed nodes is unnecessary. Thus, cpusets are not * applicable for such threads. This prevents checking for * success of set_cpus_allowed_ptr() on all attached tasks @@ -499,7 +506,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ if (p->flags & PF_NO_SETAFFINITY) { ret = -EINVAL; -@@ -5525,7 +5525,7 @@ int migrate_task_to(struct task_struct * +@@ -5525,7 +5525,7 @@ int migrate_task_to(struct task_struct *p, int target_cpu) if (curr_cpu == target_cpu) return 0; @@ -508,7 +515,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return -EINVAL; /* TODO: This is not properly updating schedstats */ -@@ -5665,7 +5665,7 @@ static void migrate_tasks(struct rq *dea +@@ -5665,7 +5665,7 @@ static void migrate_tasks(struct rq *dead_rq) next->sched_class->put_prev_task(rq, next); /* @@ -517,9 +524,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * both pi_lock and rq->lock, such that holding either * stabilizes the mask. * +diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c +index fba235c7d026..165dd5078e85 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c -@@ -128,10 +128,10 @@ int cpudl_find(struct cpudl *cp, struct +@@ -128,10 +128,10 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p, const struct sched_dl_entity *dl_se = &p->dl; if (later_mask && @@ -532,9 +541,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> dl_time_before(dl_se->deadline, cp->elements[0].dl)) { best_cpu = cpudl_maximum(cp); if (later_mask) +diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c +index 981fcd7dc394..d84aae9b694c 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c -@@ -103,11 +103,11 @@ int cpupri_find(struct cpupri *cp, struc +@@ -103,11 +103,11 @@ int cpupri_find(struct cpupri *cp, struct task_struct *p, if (skip) continue; @@ -548,9 +559,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * We have to ensure that we have at least one bit +diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c +index a2ce59015642..ce9233cd1126 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c -@@ -252,7 +252,7 @@ static struct rq *dl_task_offline_migrat +@@ -252,7 +252,7 @@ static struct rq *dl_task_offline_migration(struct rq *rq, struct task_struct *p * If we cannot preempt any rq, fall back to pick any * online cpu. */ @@ -559,7 +572,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (cpu >= nr_cpu_ids) { /* * Fail to find any suitable cpu. -@@ -1286,7 +1286,7 @@ static void set_curr_task_dl(struct rq * +@@ -1286,7 +1286,7 @@ static void set_curr_task_dl(struct rq *rq) static int pick_dl_task(struct rq *rq, struct task_struct *p, int cpu) { if (!task_running(rq, p) && @@ -568,7 +581,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 1; return 0; } -@@ -1435,7 +1435,7 @@ static struct rq *find_lock_later_rq(str +@@ -1435,7 +1435,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq) /* Retry if something changed. */ if (double_lock_balance(rq, later_rq)) { if (unlikely(task_rq(task) != rq || @@ -577,9 +590,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> task_running(rq, task) || !dl_task(task) || !task_on_rq_queued(task))) { +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index dea138964b91..e136330f861f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -1553,7 +1553,7 @@ static void task_numa_compare(struct tas +@@ -1553,7 +1553,7 @@ static void task_numa_compare(struct task_numa_env *env, */ if (cur) { /* Skip this swap candidate if cannot move to the source cpu */ @@ -588,7 +603,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto unlock; /* -@@ -1663,7 +1663,7 @@ static void task_numa_find_cpu(struct ta +@@ -1663,7 +1663,7 @@ static void task_numa_find_cpu(struct task_numa_env *env, for_each_cpu(cpu, cpumask_of_node(env->dst_nid)) { /* Skip this CPU if the source task cannot migrate */ @@ -597,7 +612,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> continue; env->dst_cpu = cpu; -@@ -5460,7 +5460,7 @@ find_idlest_group(struct sched_domain *s +@@ -5460,7 +5460,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, /* Skip over this group if it has no CPUs allowed */ if (!cpumask_intersects(sched_group_cpus(group), @@ -606,7 +621,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> continue; local_group = cpumask_test_cpu(this_cpu, -@@ -5580,7 +5580,7 @@ find_idlest_cpu(struct sched_group *grou +@@ -5580,7 +5580,7 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu) return cpumask_first(sched_group_cpus(group)); /* Traverse only the allowed CPUs */ @@ -615,16 +630,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (idle_cpu(i)) { struct rq *rq = cpu_rq(i); struct cpuidle_state *idle = idle_get_state(rq); -@@ -5682,7 +5682,7 @@ static int select_idle_core(struct task_ +@@ -5719,7 +5719,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int if (!test_idle_cores(target, false)) return -1; - cpumask_and(cpus, sched_domain_span(sd), &p->cpus_allowed); + cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); - for_each_cpu_wrap(core, cpus, target) { + for_each_cpu_wrap(core, cpus, target, wrap) { bool idle = true; -@@ -5716,7 +5716,7 @@ static int select_idle_smt(struct task_s +@@ -5753,7 +5753,7 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t return -1; for_each_cpu(cpu, cpu_smt_mask(target)) { @@ -633,16 +648,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> continue; if (idle_cpu(cpu)) return cpu; -@@ -5768,7 +5768,7 @@ static int select_idle_cpu(struct task_s +@@ -5805,7 +5805,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t time = local_clock(); - for_each_cpu_wrap(cpu, sched_domain_span(sd), target) { + for_each_cpu_wrap(cpu, sched_domain_span(sd), target, wrap) { - if (!cpumask_test_cpu(cpu, &p->cpus_allowed)) + if (!cpumask_test_cpu(cpu, p->cpus_ptr)) continue; if (idle_cpu(cpu)) break; -@@ -5923,7 +5923,7 @@ select_task_rq_fair(struct task_struct * +@@ -5960,7 +5960,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f if (sd_flag & SD_BALANCE_WAKE) { record_wakee(p); want_affine = !wake_wide(p) && !wake_cap(p, cpu, prev_cpu) @@ -651,7 +666,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } rcu_read_lock(); -@@ -6656,14 +6656,14 @@ int can_migrate_task(struct task_struct +@@ -6693,14 +6693,14 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) /* * We do not migrate tasks that are: * 1) throttled_lb_pair, or @@ -668,7 +683,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int cpu; schedstat_inc(p->se.statistics.nr_failed_migrations_affine); -@@ -6683,7 +6683,7 @@ int can_migrate_task(struct task_struct +@@ -6720,7 +6720,7 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) /* Prevent to re-select dst_cpu via env's cpus */ for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) { @@ -677,7 +692,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> env->flags |= LBF_DST_PINNED; env->new_dst_cpu = cpu; break; -@@ -7217,7 +7217,7 @@ check_cpu_capacity(struct rq *rq, struct +@@ -7254,7 +7254,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) /* * Group imbalance indicates (and tries to solve) the problem where balancing @@ -686,7 +701,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * * Imagine a situation of two groups of 4 cpus each and 4 tasks each with a * cpumask covering 1 cpu of the first group and 3 cpus of the second group. -@@ -7791,7 +7791,7 @@ static struct sched_group *find_busiest_ +@@ -7828,7 +7828,7 @@ static struct sched_group *find_busiest_group(struct lb_env *env) /* * If the busiest group is imbalanced the below checks don't * work because they assume all things are equal, which typically @@ -695,7 +710,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ if (busiest->group_type == group_imbalanced) goto force_balance; -@@ -8176,7 +8176,7 @@ static int load_balance(int this_cpu, st +@@ -8213,7 +8213,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, * if the curr task on busiest cpu can't be * moved to this_cpu */ @@ -704,9 +719,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irqrestore(&busiest->lock, flags); env.flags |= LBF_ALL_PINNED; +diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c +index 9f3e40226dec..872eba9f2174 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c -@@ -1591,7 +1591,7 @@ static void put_prev_task_rt(struct rq * +@@ -1591,7 +1591,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p) static int pick_rt_task(struct rq *rq, struct task_struct *p, int cpu) { if (!task_running(rq, p) && @@ -715,7 +732,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 1; return 0; } -@@ -1726,7 +1726,7 @@ static struct rq *find_lock_lowest_rq(st +@@ -1726,7 +1726,7 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq) * Also make sure that it wasn't scheduled on its rq. */ if (unlikely(task_rq(task) != rq || @@ -724,6 +741,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> task_running(rq, task) || !rt_task(task) || !task_on_rq_queued(task))) { +diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c +index 21ea6ae77d93..0cdf70878312 100644 --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c @@ -279,7 +279,7 @@ static void move_to_next_cpu(void) @@ -735,9 +754,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto disable; get_online_cpus(); +diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c +index 2fb007be0212..de3b2d925473 100644 --- a/lib/smp_processor_id.c +++ b/lib/smp_processor_id.c -@@ -22,7 +22,7 @@ notrace static unsigned int check_preemp +@@ -22,7 +22,7 @@ notrace static unsigned int check_preemption_disabled(const char *what1, * Kernel threads bound to a single CPU can safely use * smp_processor_id(): */ @@ -746,6 +767,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto out; /* +diff --git a/samples/trace_events/trace-events-sample.c b/samples/trace_events/trace-events-sample.c +index bc7fcf010a5b..9abbefb3617c 100644 --- a/samples/trace_events/trace-events-sample.c +++ b/samples/trace_events/trace-events-sample.c @@ -33,7 +33,7 @@ static void simple_thread_func(int cnt) @@ -757,3 +780,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> trace_foo_with_template_simple("HELLO", cnt); +-- +2.1.4 + |