From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754078AbdBHLEy (ORCPT ); Wed, 8 Feb 2017 06:04:54 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:53495 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753836AbdBHLET (ORCPT ); Wed, 8 Feb 2017 06:04:19 -0500 Date: Wed, 8 Feb 2017 11:20:19 +0100 (CET) From: Thomas Gleixner To: Ingo Molnar cc: Peter Zijlstra , Mike Galbraith , Ingo Molnar , Sebastian Andrzej Siewior , LKML Subject: Re: tip: demise of tsk_cpus_allowed() and tsk_nr_cpus_allowed() In-Reply-To: <20170206222313.GA6061@gmail.com> Message-ID: References: <1486355037.10462.17.camel@gmx.de> <20170206103156.GA18908@gmail.com> <1486383511.10462.43.camel@gmx.de> <20170206122928.GB9404@gmail.com> <20170206133242.GK6515@twins.programming.kicks-ass.net> <20170206222313.GA6061@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 6 Feb 2017, Ingo Molnar wrote: > * Peter Zijlstra wrote: > > > > cpumasks are a pain, the above avoids allocating more of them. Indeed. > Yeah, so this could then be done by pointerifying ->cpus_allowed - more robust > than the wrappery, You mean: struct task_struct { cpumask_t cpus_allowed; cpumask_t *effective_cpus_allowed; }; and make the scheduler use effective_cpus_allowed instead of cpus_allowed? Or what do you have in mind? > because as I've noted in the changelog there's a large body of > upstream code that does not use the wrappers but uses ->cpus_allowed directly: Right and we really should audit those places. I bet that half of them are just broken and evil hacks. The wrapper we added is just covering the core scheduler code where the information really matters for decision, but leaves the other oddball cases alone. The extra pointer might be a nicer concept, but it still has the same issue as the wrapper. How do we enforce that random code accesses the right thing? Thanks, tglx