From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934362AbdDFJg0 (ORCPT ); Thu, 6 Apr 2017 05:36:26 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36398 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934313AbdDFJgC (ORCPT ); Thu, 6 Apr 2017 05:36:02 -0400 Date: Thu, 6 Apr 2017 11:35:45 +0200 From: Peter Zijlstra To: Ingo Molnar Cc: Sebastian Andrzej Siewior , 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: <20170406093545.dknm76zgay346uui@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170406080139.GA22069@gmail.com> 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 10:01:39AM +0200, Ingo Molnar wrote: > I.e. just have a counter and these two APIs: > > static inline void migrate_disable(void) > { > current->migration_disabled++; > } > > ... > > static inline void migrate_enable(void) > { > current->migration_disabled--; > } > > ... and make sure the scheduler migration code plus the CPU hotplug code considers > the counter. > > Would this work, and would this be the simplest all around solution? If you want to add expensive bits to hot paths like wakeups ... :/