Re: [PATCH V5 1/6] Sched: Scheduler time slice extension
From: Prakash Sangappa
Date: Tue Jun 10 2025 - 11:45:04 EST
> On Jun 9, 2025, at 2:52 PM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Mon, 9 Jun 2025 16:55:32 -0400
> Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
>> So I applied your patches and fixed up my "extend-sched.c" program to use
>> your method. I booted on bare-metal PREEMPT_RT and ran:
>
> In case anyone else wants to play, I'm attaching the source of extend-sched.c
>
> I ran it with: sleep 5; ./extend-sched
>
> Then switched over to cyclic test, counted to five and it was pretty
> noticeable when it triggered.
>
> To build, simply do:
>
> $ cd linux.git
> $ mkdir /tmp/extend
> $ cp tools/testing/selftests/rseq/rseq-abi.h /tmp/extend
> $ cd /tmp/extend
>
> [ download extend-sched.c here ]
>
> $ gcc extend-sched.c -o extend-sched
>
>
> -- Steve
> <extend-sched.c>
Thanks for sharing the test program.
In test program, unextend() should be slightly modified as follows.
101c101
< if (!(flags & (1 << 4)))
---
> if (flags & (1 << 3))
103,106c103,107
<
< tracefs_printf(NULL, "Yield!\n");
< sched_yield();
< return 1;
---
> if (!(flags & (1 << 4))) {
> tracefs_printf(NULL, "Yield!\n");
> sched_yield();
> }
> return 1;