Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c98d344 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

sched/core: Remove the tsk_cpus_allowed() wrapper



So the original intention of tsk_cpus_allowed() was to 'future-proof'
the field - but it's pretty ineffectual at that, because half of
the code uses ->cpus_allowed directly ...

Also, the wrapper makes the code longer than the original expression!

So just get rid of it. This also shrinks <linux/sched.h> a bit.

Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 59ddbcb2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -795,7 +795,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
	 * se we pin us down to CPU 0 for a short while
	 */
	alloc_cpumask_var(&old_mask, GFP_NOWAIT);
	cpumask_copy(old_mask, tsk_cpus_allowed(current));
	cpumask_copy(old_mask, &current->cpus_allowed);
	set_cpus_allowed_ptr(current, cpumask_of(boot_cpuid));
	
	if (smp_ops && smp_ops->setup_cpu)
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,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.
	 */
	cpumask_copy(&ctx->cpus_allowed, tsk_cpus_allowed(current));
	cpumask_copy(&ctx->cpus_allowed, &current->cpus_allowed);

	/* Save the current cpu id for spu interrupt routing. */
	ctx->last_ran = raw_smp_processor_id();
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ static unsigned long run_on_cpu(unsigned long cpu,
	cpumask_t old_affinity;
	unsigned long ret;

	cpumask_copy(&old_affinity, tsk_cpus_allowed(current));
	cpumask_copy(&old_affinity, &current->cpus_allowed);
	/* should return -EINVAL to userspace */
	if (set_cpus_allowed_ptr(current, cpumask_of(cpu)))
		return 0;
+2 −2
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ static unsigned int us2e_freq_get(unsigned int cpu)
	cpumask_t cpus_allowed;
	unsigned long clock_tick, estar;

	cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
	cpumask_copy(&cpus_allowed, &current->cpus_allowed);
	set_cpus_allowed_ptr(current, cpumask_of(cpu));

	clock_tick = sparc64_get_clock_tick(cpu) / 1000;
@@ -252,7 +252,7 @@ static int us2e_freq_target(struct cpufreq_policy *policy, unsigned int index)
	unsigned long clock_tick, divisor, old_divisor, estar;
	cpumask_t cpus_allowed;

	cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
	cpumask_copy(&cpus_allowed, &current->cpus_allowed);
	set_cpus_allowed_ptr(current, cpumask_of(cpu));

	new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000;
+2 −2
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ static unsigned int us3_freq_get(unsigned int cpu)
	unsigned long reg;
	unsigned int ret;

	cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
	cpumask_copy(&cpus_allowed, &current->cpus_allowed);
	set_cpus_allowed_ptr(current, cpumask_of(cpu));

	reg = read_safari_cfg();
@@ -99,7 +99,7 @@ static int us3_freq_target(struct cpufreq_policy *policy, unsigned int index)
	unsigned long new_bits, new_freq, reg;
	cpumask_t cpus_allowed;

	cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
	cpumask_copy(&cpus_allowed, &current->cpus_allowed);
	set_cpus_allowed_ptr(current, cpumask_of(cpu));

	new_freq = sparc64_get_clock_tick(cpu) / 1000;
Loading