From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934112AbdDFLlk (ORCPT ); Thu, 6 Apr 2017 07:41:40 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:45620 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755494AbdDFLld (ORCPT ); Thu, 6 Apr 2017 07:41:33 -0400 Date: Thu, 6 Apr 2017 13:41:15 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: Sebastian Andrzej Siewior , Ingo Molnar , linux-kernel@vger.kernel.org, Mike Galbraith , Ingo Molnar , "Rafael J . Wysocki" Subject: Re: [RFC PATCH] kernel: sched: Provide a pointer to the valid CPU mask Message-ID: <20170406114115.khh3xltd6a7pmls5@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> <20170406094635.iwkaewsbiud35q6b@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 12:58:27PM +0200, Thomas Gleixner wrote: > On Thu, 6 Apr 2017, Peter Zijlstra wrote: > > Because mainline will not get anything other than prempt_disable() for > > migrate_disable(). > > I'm not yet convinced of that. There is enough stuff which pointlessly > disables preemption and works around the restrictions caused by that or > plays games with cpus_allowed just to stay on a particular cpu. > > I know you don't like it because it imposes restrictions on schedulability, > but disabling preemption for a long time or playing cpus_allowed games has > the same and worse effects. There really isn't much code that plays games with cpus_allowed. And code that disabled preemption for a long time can surely be fixed, we've done so many a time. A pure migrate_disable() (without wrapping lock) is a straight up nightmare, you can end up with a gazillion runnable tasks stuck to one CPU and all other CPUs with their thumbs up their arses waiting for work. The moment you stick migrate_disable() in a lock, you at least get PI to bail you out of some of the pain (but by no means all of it). Adding migrate_disable() to the kernel is really just moving pain around, it doesn't solve anything much.