Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753987AbdCHR4Z (ORCPT ); Wed, 8 Mar 2017 12:56:25 -0500 Received: from mail.kernel.org ([198.145.29.136]:41720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753933AbdCHR4W (ORCPT ); Wed, 8 Mar 2017 12:56:22 -0500 Date: Wed, 8 Mar 2017 12:46:54 -0500 From: Steven Rostedt To: Laurent Dufour Cc: Andrew Morton , Linux Kernel Mailing List , Thomas Gleixner , Ingo Molnar , Peter Zijlstra Subject: Re: RFC: SysRq nice-all-RT-tasks is broken Message-ID: <20170308124654.10e598f2@gandalf.local.home> In-Reply-To: <20170308124012.496a75cf@gandalf.local.home> References: <20170308115114.4e20fc73@gandalf.local.home> <20170308115758.43b38bc7@gandalf.local.home> <22b0e5fe-2aa1-72de-4d00-29d768d226ca@linux.vnet.ibm.com> <20170308124012.496a75cf@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 858 Lines: 28 On Wed, 8 Mar 2017 12:40:12 -0500 Steven Rostedt wrote: > I wonder if we should just have a special flag sent by that sysrq > trigger. Since it is causing all tasks to go "nice" there's no need to > do the pi chain walk in __sched_setscheduler(). Hah, there already is a flag! Laurent, can you test this patch: -- Steve diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3b31fc0..7292fa9 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4129,8 +4129,8 @@ static int __sched_setscheduler(struct task_struct *p, int queue_flags = DEQUEUE_SAVE | DEQUEUE_MOVE; struct rq *rq; - /* May grab non-irq protected spin_locks: */ - BUG_ON(in_interrupt()); + /* The pi code expects interrupts enabled */ + BUG_ON(pi && in_interrupt()); recheck: /* Double check policy once rq lock held: */ if (policy < 0) {