From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757221AbdDFJqx (ORCPT ); Thu, 6 Apr 2017 05:46:53 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:49286 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757148AbdDFJqr (ORCPT ); Thu, 6 Apr 2017 05:46:47 -0400 Date: Thu, 6 Apr 2017 11:46:35 +0200 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Thomas Gleixner , Mike Galbraith , Ingo Molnar , "Rafael J . Wysocki" Subject: Re: [RFC PATCH] kernel: sched: Provide a pointer to the valid CPU mask Message-ID: <20170406094635.iwkaewsbiud35q6b@hirez.programming.kicks-ass.net> References: <20170404184202.20376-1-bigeasy@linutronix.de> <20170405073943.GA17266@gmail.com> <20170405083753.7eszej2njds4ovdb@linutronix.de> <20170406061622.GA19979@gmail.com> <20170406073832.e7bu4ldpfuq44ui6@linutronix.de> <20170406080139.GA22069@gmail.com> <20170406092542.emc3lmqu2ywt3opy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170406092542.emc3lmqu2ywt3opy@linutronix.de> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 06, 2017 at 11:25:42AM +0200, Sebastian Andrzej Siewior wrote: > > I.e. just have a counter and these two APIs: > > > > static inline void migrate_disable(void) > > { > > current->migration_disabled++; > plus > if (current->migration_disabled == 1) > get_online_cpus() You want that other hotplug fast hack crap you have in rt, no? Because mainline will not get anything other than prempt_disable() for migrate_disable(). > > } > > > > ... > > > > static inline void migrate_enable(void) > > { > > current->migration_disabled--; > > } > > > > ... and make sure the scheduler migration code plus the CPU hotplug code considers > > the counter. > > So on the sched part I need go through all places where it looks at the > mask and make sure it ignores the CPU switch decision. This could be > doable. Don't sprinkle that around. Use a wrapper like say: tsk_cpus_allowed() to encapsulate that logic :-)