From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754484AbdBFO7O (ORCPT ); Mon, 6 Feb 2017 09:59:14 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:46969 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754046AbdBFO7M (ORCPT ); Mon, 6 Feb 2017 09:59:12 -0500 Date: Mon, 6 Feb 2017 15:59:08 +0100 From: Peter Zijlstra To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Andrew Morton , Linus Torvalds , Mike Galbraith , Oleg Nesterov , Thomas Gleixner Subject: Re: [PATCH 78/89] sched/core: Remove the tsk_cpus_allowed() wrapper Message-ID: <20170206145908.GO6515@twins.programming.kicks-ass.net> References: <1486387772-18837-1-git-send-email-mingo@kernel.org> <1486387772-18837-79-git-send-email-mingo@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1486387772-18837-79-git-send-email-mingo@kernel.org> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 06, 2017 at 02:29:21PM +0100, Ingo Molnar wrote: > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c > index 54903862cf57..f40e2a5cf044 100644 > --- a/arch/powerpc/kernel/smp.c > +++ b/arch/powerpc/kernel/smp.c > @@ -796,7 +796,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, ¤t->cpus_allowed); > set_cpus_allowed_ptr(current, cpumask_of(boot_cpuid)); > > if (smp_ops && smp_ops->setup_cpu) > diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c > index 4808b6d23455..d63fc613e7a9 100644 > --- a/arch/sparc/kernel/sysfs.c > +++ b/arch/sparc/kernel/sysfs.c > @@ -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, ¤t->cpus_allowed); > /* should return -EINVAL to userspace */ > if (set_cpus_allowed_ptr(current, cpumask_of(cpu))) > return 0; > diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c > index b73feeb666f9..35ddb6da93aa 100644 > --- a/drivers/cpufreq/sparc-us2e-cpufreq.c > +++ b/drivers/cpufreq/sparc-us2e-cpufreq.c > @@ -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, ¤t->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, ¤t->cpus_allowed); > set_cpus_allowed_ptr(current, cpumask_of(cpu)); > > new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000; > diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c > index 9bb42ba50efa..a8d86a449ca1 100644 > --- a/drivers/cpufreq/sparc-us3-cpufreq.c > +++ b/drivers/cpufreq/sparc-us3-cpufreq.c > @@ -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, ¤t->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, ¤t->cpus_allowed); > set_cpus_allowed_ptr(current, cpumask_of(cpu)); > > new_freq = sparc64_get_clock_tick(cpu) / 1000; Note that all those, and this is where I stopped looking, appear broken vs userspace changing the mask right after.