linux-rt-users.vger.kernel.org archive mirror
 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; 11+ 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 related	[flat|nested] 11+ messages in thread
* [PATCH] Force processes to non-realtime before mm_exit
@ 2016-05-10 18:04 Brian Silverman
  2016-05-12  8:59 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 11+ messages in thread
From: Brian Silverman @ 2016-05-10 18:04 UTC (permalink / raw)
  To: linux-rt-users; +Cc: 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 related	[flat|nested] 11+ messages in thread

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

Thread overview: 11+ 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
  -- strict thread matches above, loose matches on Subject: below --
2016-05-10 18:04 Brian Silverman
2016-05-12  8:59 ` Sebastian Andrzej Siewior
2016-05-16 21:05   ` Brian Silverman
2016-05-25 16:33     ` Sebastian Andrzej Siewior
2016-05-25 18:00       ` Brian Silverman
2016-05-25 19:54         ` Sebastian Andrzej Siewior
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;
as well as URLs for NNTP newsgroup(s).