mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Force processes to non-realtime before mm_exit
@ 2016-06-03 23:18 Brian Silverman
  2016-06-05  0:28 ` Corey Minyard
  2016-07-14 17:24 ` Peter Zijlstra
  0 siblings, 2 replies; 5+ messages in thread
From: Brian Silverman @ 2016-06-03 23:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-rt-users, bigeasy, Brian Silverman

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.

Signed-off-by: Brian Silverman <brian@peloton-tech.com>
---
 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, &param);
+	}
+
 	exit_mm(tsk);
 
 	if (group_dead)
-- 
2.1.4

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <1462903464-11448-1-git-send-email-brian@peloton-tech.com>]

end of thread, other threads:[~2016-09-02 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-03 23:18 [PATCH] Force processes to non-realtime before mm_exit Brian Silverman
2016-06-05  0:28 ` Corey Minyard
2016-07-14 17:24 ` Peter Zijlstra
2016-09-02 15:02   ` Thomas Gleixner
     [not found] <1462903464-11448-1-git-send-email-brian@peloton-tech.com>
     [not found] ` <20160512085946.GB19035@linutronix.de>
     [not found]   ` <CAGt3f4m=+yimx-wxDjH9TCzAb5F6zUbxG_RAEhTrT4cZWFKKcg@mail.gmail.com>
     [not found]     ` <20160525163323.GB18036@linutronix.de>
     [not found]       ` <CAGt3f4=SyBqM-7Jeitx10Tm8yTrNBpSoFNvCZNZX7A3oixzUzA@mail.gmail.com>
     [not found]         ` <574602F0.2070608@linutronix.de>
2016-06-03 23:33           ` Brian Silverman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome