From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754289AbcIBPEw (ORCPT ); Fri, 2 Sep 2016 11:04:52 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:54373 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753563AbcIBPEv (ORCPT ); Fri, 2 Sep 2016 11:04:51 -0400 Date: Fri, 2 Sep 2016 17:02:29 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Brian Silverman , linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, bigeasy@linutronix.de, Ingo Molnar , Mike Galbraith Subject: Re: [PATCH] Force processes to non-realtime before mm_exit In-Reply-To: <20160714172429.GH30935@twins.programming.kicks-ass.net> Message-ID: References: <1464995924-16367-1-git-send-email-brian@peloton-tech.com> <20160714172429.GH30935@twins.programming.kicks-ass.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Jul 2016, Peter Zijlstra wrote: > On Fri, Jun 03, 2016 at 04:18:44PM -0700, Brian Silverman wrote: > > Without this, a realtime process which has called mlockall exiting > > causes large latencies for other realtime processes at the same or > > lower priorities. This seems like a fairly common use case too, because > > realtime processes generally want their memory locked into RAM. > > So I'm not too sure.. SCHED_FIFO/RR are a complete trainwreck and > provide absolutely no isolation from badly behaving tasks what so ever, > so I'm not too inclined to protect them from exit either, its just one > more way in which they can cause pain. > > But aside from the, the patch has issues.. > > > +++ b/kernel/exit.c > > @@ -730,6 +730,12 @@ void do_exit(long code) > > tsk->exit_code = code; > > taskstats_exit(tsk, group_dead); > > > > + if (tsk->policy == SCHED_FIFO || tsk->policy == SCHED_RR) { > > + struct sched_param param = { .sched_priority = 0 }; > > + > > + sched_setscheduler_nocheck(current, SCHED_NORMAL, ¶m); > > + } > > + > > exit_mm(tsk); > > That only does half a job. You forget about SCHED_DEADLINE and negative > nice tasks. > > Something like the below perhaps... But yeah, unconvinced. I agree that FIFO/RR can cause pain, but running exit_mm() with RT priority or consuming DL time is silly. FWIW: Acked-by-me