{"id":15007394,"url":"https://github.com/hamadmarri/tt-cpu-scheduler","last_synced_at":"2025-10-03T16:31:29.382Z","repository":{"id":44788628,"uuid":"420947567","full_name":"hamadmarri/TT-CPU-Scheduler","owner":"hamadmarri","description":"Task Type (TT) is an alternative CPU Scheduler for linux.","archived":true,"fork":false,"pushed_at":"2023-04-28T02:29:26.000Z","size":444,"stargazers_count":111,"open_issues_count":12,"forks_count":12,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-19T16:43:23.317Z","etag":null,"topics":["cpu-scheduling","hrrn","hrrn-scheduling","kernel","linux","linux-desktop","linux-kernel","process-scheduler","process-scheduling","real-time","realtime","scheduler","scheduling","task-scheduling","task-type"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamadmarri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-10-25T08:53:04.000Z","updated_at":"2024-11-18T17:41:13.000Z","dependencies_parsed_at":"2024-01-13T15:37:46.372Z","dependency_job_id":"8fa4eb64-fa96-4997-9d26-827b1500354f","html_url":"https://github.com/hamadmarri/TT-CPU-Scheduler","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamadmarri%2FTT-CPU-Scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamadmarri%2FTT-CPU-Scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamadmarri%2FTT-CPU-Scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamadmarri%2FTT-CPU-Scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamadmarri","download_url":"https://codeload.github.com/hamadmarri/TT-CPU-Scheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235155970,"owners_count":18944822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpu-scheduling","hrrn","hrrn-scheduling","kernel","linux","linux-desktop","linux-kernel","process-scheduler","process-scheduling","real-time","realtime","scheduler","scheduling","task-scheduling","task-type"],"created_at":"2024-09-24T19:09:37.326Z","updated_at":"2025-10-03T16:31:28.998Z","avatar_url":"https://github.com/hamadmarri.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TT CPU Scheduler\n\nTask Type (TT) is an alternative CPU Scheduler for linux.\n\nThe goal of the Task Type (TT) scheduler is to detect\ntasks types based on their behaviours and control the schedulling\nbased on their types. There are 5 types:\n1. REALTIME\n2. INTERACTIVE\n3. NO_TYPE\n4. CPU_BOUND\n5. BATCH\n\nFind the descriptions and the detection rules in `tasks.ods`\n\nThe benefit of task types is to allow the scheduler to have\nmore control and choose the best task to run next in the CPU.\n\nTT gives RT tasks a `-20` prio in vruntime calculations. This boosts RT\ntasks over other tasks. The preemption rules are purely HRRN where RT tasks\nhave a priority since their vruntimes are relatively less than other types.\nThe reason of using HRRN instead of hard level picking is to smooth out the\npreemtions and to prevent any chance of starvation.\n\n## Monitoring detected tasks\nYou need to compile with `CONFIG_SCHED_DEBUG=y`. I have added a field in the\noutput of tasks information `task_type`. See and use `ttdebug.sh`.\n\nUsage examples:\n\n`ttdebug.sh | grep -i realtime`\n\n`watch -t \"(ttdebug.sh | grep -i interactive)\"`\n\n`watch -t \"(ttdebug.sh | egrep -i 'webco|firefox')\"`\n\n\nNote: Tasks types are detected based on their behaviour, not by what it should\nbe. So if systemd at some point acted like a REALTIME tasks and went for long sleep\nthen the type would be REALTIME until it wakes up and get its type updated.\nYou might see many sleeping tasks with incorrect types\nbecause at some point on booting time they acted like REALTIME, CPU_BOUND, or\nwhatever type. Those tasks are sleeping for long time, so when they wake up their\ntype will be INTERACITVE sine they have very hight HRRN value. So, don't worry\nabout the type of sleeping system processes.\n\n\n## sysctl`s`\n`kernel.sched_tt_max_lifetime`\n\nDefault is 22s. This is the tasks' maximum life time to normalize their life\ntime and vruntime. Similar to CacULE's `cacule_max_lifetime`.\n\n\n`kernel.sched_tt_rt_prio`\nDefault is -20. Range [-20, 19]. In case that tasks with types other than realtime\nare starving because of realtime tasks' priorities are too high, you can soften\nthe priority of realtime tasks. The -20 is the highest, 19 is the least priority.\n\n`kernel.sched_tt_interactive_prio`\nDefault is -10. Range [-20, 19].\n\n`kernel.sched_tt_cpu_bound_prio`\nDefault is -15. Range [-20, 19].\n\n`kernel.sched_tt_batch_prio`\nDefault is 19. Range [-20, 19].\n\n\n`kernel.sched_tt_balancer_opt`\n\nIt can be set to 4 values:\n\n- 0: Normal TT balancer\n- 1: Candidate Balancer (which is an addition to normal TT balancer - good for reponsiveness (perfomance gets affected when #CPUs \u003e 4))\n- 2: CFS balancer (default - good for perfomance/throughput)\n- 3: Power save balancer (tries its best to avoid running tasks on idle cpus - saves power)\n\nYou can change the balancer option at run time.\n\n`kernel.sched_tt_lat_sens_enabled`\nDefault is 1. latency sensitive keeps CPUs (with no tasks) at high frequency for sometime (~1ms) in\ncase of incoming task during this time would run faster. It reduces latency but increases power consumption.\nIf Power save balancer is chosen, then this option has no effect (i.e. disabled, = 0).\n\n`kernel.sched_tt_dedicated_cpu_bound_enabled`\nDefault is 1. This option stick a CPU bound task to its current CPU to enhance cache locality.\nA CPU can only have one dedicated cpu bound task.\n\n\n## Support\nTelegram: https://t.me/tt_sched\n\nThank you\n\nHamad\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamadmarri%2Ftt-cpu-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamadmarri%2Ftt-cpu-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamadmarri%2Ftt-cpu-scheduler/lists"}