From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751322AbcFEA2P (ORCPT ); Sat, 4 Jun 2016 20:28:15 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:33405 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbcFEA2N (ORCPT ); Sat, 4 Jun 2016 20:28:13 -0400 Subject: Re: [PATCH] Force processes to non-realtime before mm_exit To: Brian Silverman , linux-kernel@vger.kernel.org References: <1464995924-16367-1-git-send-email-brian@peloton-tech.com> Cc: linux-rt-users@vger.kernel.org, bigeasy@linutronix.de From: Corey Minyard Message-ID: <57537219.8020904@mvista.com> Date: Sat, 4 Jun 2016 19:28:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1464995924-16367-1-git-send-email-brian@peloton-tech.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/03/2016 06:18 PM, 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. Could this cause a subtle priority inversion for a process waiting on this process to die? I'm thinking that if this is a critical process, it crashes, and the system is very busy with other RT processes, it could take a long time before the process gets restarted when it is expected to happen quickly. I don't have another solution for you, and beyond speeding up the memory reclamation process (which may not be possible or easy) I'm not sure there is. I'm just pointing out a possible side effect. -corey > Signed-off-by: Brian Silverman > --- > kernel/exit.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/kernel/exit.c b/kernel/exit.c > index a0cf72b..68a97df 100644 > --- a/kernel/exit.c > +++ 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); > > if (group_dead)