Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754369AbdCILXg (ORCPT ); Thu, 9 Mar 2017 06:23:36 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35633 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753450AbdCILXd (ORCPT ); Thu, 9 Mar 2017 06:23:33 -0500 Subject: Re: RFC: SysRq nice-all-RT-tasks is broken To: Steven Rostedt 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> <20170308124654.10e598f2@gandalf.local.home> Cc: Andrew Morton , Linux Kernel Mailing List , Thomas Gleixner , Ingo Molnar , Peter Zijlstra From: Laurent Dufour Date: Thu, 9 Mar 2017 10:02:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170308124654.10e598f2@gandalf.local.home> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17030909-0040-0000-0000-0000033CE5CE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17030909-0041-0000-0000-00002471D26F Message-Id: <0478c913-d93a-73a0-9d52-5bf60fe54ee4@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-09_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703090070 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1073 Lines: 39 On 08/03/2017 18:46, Steven Rostedt wrote: > 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: Tested on ppc64, no more panic \o/ FWIW, Tested-by: Laurent Dufour Thanks, Laurent. > > -- 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) { >