From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756611AbdDFK5y (ORCPT ); Thu, 6 Apr 2017 06:57:54 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:39784 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752167AbdDFK5o (ORCPT ); Thu, 6 Apr 2017 06:57:44 -0400 Date: Thu, 6 Apr 2017 12:57:36 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: Sebastian Andrzej Siewior , 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: <20170406105736.uw2j22igja45wi4b@hirez.programming.kicks-ass.net> References: <20170404184202.20376-1-bigeasy@linutronix.de> <20170406093224.q3tunb6gdx5a6flr@hirez.programming.kicks-ass.net> <20170406094626.a42cq66ezgq4lohh@linutronix.de> <20170406103516.i3jyjcmee65r3wwj@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:47:21PM +0200, Thomas Gleixner wrote: > On Thu, 6 Apr 2017, Peter Zijlstra wrote: > > IIRC MIPS has a case where only 1 in N cores has an FPU. And once a task > > uses FPU, it gets affined to the core that has one or something like > > that. > > > > Of course, nothing then stops someone else breaking that affinity. But I > > suspect it will simply fault on the next FPU instruction and 'reset' the > > mask or something. I've no clue and no real desire to know. > > It does nasty games with it's own storage of p->thread.user_cpus_allowed > and a fully seperate implementation of sys_sched_set|getaffinity. > > Plus a magic trap handler which forces the thread to a CPU with FPU when > the user_cpus_allowed mask intersects with the cpus_with_fpu_mask... > > Magic crap, which could all be replaced by a simple function in the > scheduler which allows to push a task to a FPU CPU and then disable > migration. If its even halfway coherent, I'd much rather let it stay where it it. I really want to limit migrate_disable() to PREEMPT_RT=y where its used to preserve spinlock semantics and not allow random other migrate_disable() usage in the kernel. Also note, that per the above, it can actually migrate to any core that has an FPU on, so its not a good match for migrate_disable() in any case.