mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next 0/1] Restart rt period timer when rt runtime exceeded
@ 2021-11-15  1:46 Li Hua
  2021-11-15  1:46 ` [PATCH -next 1/1] sched/rt: Try to restart " Li Hua
  0 siblings, 1 reply; 3+ messages in thread
From: Li Hua @ 2021-11-15  1:46 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: yuehaibing, weiyongjun1, Dietmar Eggemann, Steven Rostedt,
	Ben Segall, Mel Gorman, Daniel Bristot de Oliveira, linux-kernel,
	w.f, hucool.lihua, cj.chengjian, judy.chenhui

When rt_runtime is modified from -1 to a valid control value, it may cause
the task to be throttled all the time. Then the task cannot be killed.
E.g:
The FIFO task A execution while(1):
	#define _GNU_SOURCE
	#include <sched.h>
	#include <unistd.h>

	int main(int argc,char *argv[])
	{
		struct sched_param param;
		int priority = sched_get_priority_min(SCHED_FIFO);
		param.sched_priority = priority;
		sched_setscheduler(getpid(), SCHED_FIFO, &param);
		while(1) {}
		return 0;
	}

Following the steps:
lihua@octopus ~ # echo -1 > /proc/sys/kernel/sched_rt_runtime_us
lihua@octopus ~ # /bin/rt_throttled &
lihua@octopus ~ # echo 950000 > /proc/sys/kernel/sched_rt_runtime_us
lihua@octopus ~ # ps aux | grep rt_throttled
root 7026 65.1  0.0   1848   180 ttyAMA0  R    01:27   0:26 /bin/rt_throttled
root 7068  0.0  0.0   4072   620 ttyAMA0  S+   01:28   0:00 grep rt_throttled
lihua@octopus ~ # killall rt_throttled
lihua@octopus ~ # date
Thu Jan  1 01:28:30 UTC 1970
lihua@octopus ~ # date
Thu Jan  1 01:28:33 UTC 1970
lihua@octopus ~ # ps aux | grep rt_throttled
root 7026 41.0  0.0   1848   180 ttyAMA0  R    01:27   0:26 /bin/rt_throttled
root 7097  0.0  0.0   4072   576 ttyAMA0  S+   01:28   0:00 grep rt_throttled

So the patch try to wake up the timer when rt runtime exceeded.

*** BLURB HERE ***

Li Hua (1):
  sched/rt: Try to restart rt period timer when rt runtime exceeded

 kernel/sched/rt.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-18 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15  1:46 [PATCH -next 0/1] Restart rt period timer when rt runtime exceeded Li Hua
2021-11-15  1:46 ` [PATCH -next 1/1] sched/rt: Try to restart " Li Hua
2021-11-18 15:20   ` Peter Zijlstra

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

all inboxes | Powered by JetHome®