android_kernel_xiaomi_sm8350/kernel
Peter Zijlstra 9044855f69
sched: Provide sched_set_fifo()
SCHED_FIFO (or any static priority scheduler) is a broken scheduler
model; it is fundamentally incapable of resource management, the one
thing an OS is actually supposed to do.

It is impossible to compose static priority workloads. One cannot take
two well designed and functional static priority workloads and mash
them together and still expect them to work.

Therefore it doesn't make sense to expose the priority field; the
kernel is fundamentally incapable of setting a sensible value, it
needs systems knowledge that it doesn't have.

Take away sched_setschedule() / sched_setattr() from modules and
replace them with:

  - sched_set_fifo(p); create a FIFO task (at prio 50)
  - sched_set_fifo_low(p); create a task higher than NORMAL,
	which ends up being a FIFO task at prio 1.
  - sched_set_normal(p, nice); (re)set the task to normal

This stops the proliferation of randomly chosen, and irrelevant, FIFO
priorities that dont't really mean anything anyway.

The system administrator/integrator, whoever has insight into the
actual system design and requirements (userspace) can set-up
appropriate priorities if and when needed.

Cc: airlied@redhat.com
Cc: alexander.deucher@amd.com
Cc: awalls@md.metrocast.net
Cc: axboe@kernel.dk
Cc: broonie@kernel.org
Cc: daniel.lezcano@linaro.org
Cc: gregkh@linuxfoundation.org
Cc: hannes@cmpxchg.org
Cc: herbert@gondor.apana.org.au
Cc: hverkuil@xs4all.nl
Cc: john.stultz@linaro.org
Cc: nico@fluxnic.net
Cc: paulmck@kernel.org
Cc: rafael.j.wysocki@intel.com
Cc: rmk+kernel@arm.linux.org.uk
Cc: sudeep.holla@arm.com
Cc: tglx@linutronix.de
Cc: ulf.hansson@linaro.org
Cc: wim@linux-watchdog.org
Change-Id: I52ed4f1253e82ba3e8f40f3aa1aff62580163f25
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
2024-04-16 16:57:36 +03:00
..
bpf This is the 5.4.268 stable release 2024-01-26 02:15:05 +00:00
cgroup Merge tag 'ASB-2023-12-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2023-12-11 20:22:05 +02:00
configs
debug kdb: Fix a potential buffer overflow in kdb_local() 2024-01-25 14:34:32 -08:00
dma Merge branch 'android11-5.4-lts' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-02-08 19:02:48 +00:00
events Merge tag 'ASB-2024-02-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-02-09 00:18:00 +02:00
gcov gcov: add support for checksum field 2023-01-18 11:41:42 +01:00
irq Merge branch 'android11-5.4-lts' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-02-08 19:02:48 +00:00
livepatch This is the 5.4.220 stable release 2022-10-29 10:45:08 +02:00
locking Merge branch 'android11-5.4-lts' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-02-08 19:02:48 +00:00
power Merge branch 'android11-5.4-lts' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-02-08 19:02:48 +00:00
printk Merge android11-5.4.191+ (375c2e2) into msm-5.4 2022-06-09 11:43:23 +05:30
rcu Merge tag 'ASB-2023-06-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2023-06-08 12:00:01 +03:00
sched sched: Provide sched_set_fifo() 2024-04-16 16:57:36 +03:00
time Merge branch 'android11-5.4-lts' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-02-08 19:02:48 +00:00
trace Merge branch 'android11-5.4-lts' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-02-08 19:02:48 +00:00
.gitignore This is the 5.4.118 stable release 2021-05-11 16:56:33 +02:00
acct.c acct: fix potential integer overflow in encode_comp_t() 2023-01-18 11:41:34 +01:00
async.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
audit_fsnotify.c audit: fix potential double free on error path from fsnotify_add_inode_mark 2022-09-05 10:27:38 +02:00
audit_tree.c audit: move put_tree() to avoid trim_trees refcount underflow and UAF 2021-09-03 10:08:16 +02:00
audit_watch.c audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() 2023-11-28 16:50:18 +00:00
audit.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
audit.h audit: log AUDIT_TIME_* records only from rules 2022-04-15 14:18:04 +02:00
auditfilter.c
auditsc.c audit: fix possible soft lockup in __audit_inode_child() 2023-09-23 10:59:46 +02:00
backtracetest.c treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD() 2023-04-20 12:07:32 +02:00
bounds.c
capability.c
cfi.c ANDROID: cfi: ensure RCU is watching in __cfi_slowpath 2020-11-02 18:55:52 +00:00
compat.c sched_getaffinity: don't assume 'cpumask_size()' is fully initialized 2023-04-05 11:16:42 +02:00
configs.c
context_tracking.c
cpu_pm.c
cpu.c Revert "hrtimers: Push pending hrtimers away from outgoing CPU earlier" 2023-12-18 18:58:40 +00:00
crash_core.c
crash_dump.c
cred.c Revert "cred: switch to using atomic_long_t" 2024-01-03 17:00:08 +00:00
delayacct.c
dma.c
exec_domain.c
exit.c Merge tag 'ASB-2023-08-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2023-08-31 18:20:41 +03:00
extable.c kernel/extable.c: use address-of operator on section symbols 2023-06-09 10:29:01 +02:00
fail_function.c kernel/fail_function: fix memory leak with using debugfs_lookup() 2023-03-11 16:44:15 +01:00
fork.c Merge tag 'ASB-2023-12-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2023-12-11 20:22:05 +02:00
freezer.c
futex.c Merge 5.4.246 into android11-5.4-lts 2023-06-20 19:13:58 +00:00
gen_kheaders.sh Revert one chunk from 37432a83fa commit 2021-03-18 11:01:03 +05:30
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c
kcmp.c Revert "kernel/kcmp.c: Use new infrastructure to fix deadlocks in execve" 2021-01-11 14:35:18 +01:00
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
kcov.c
kexec_core.c kexec: fix a memory leak in crash_shrink_memory() 2023-07-27 08:37:10 +02:00
kexec_elf.c
kexec_file.c kexec: support purgatories with .text.hot sections 2023-06-21 15:44:10 +02:00
kexec_internal.h
kexec.c
kheaders.c kheaders: Use array declaration instead of char 2023-05-17 11:35:33 +02:00
kmod.c
kprobes.c x86/kprobes: Fix arch_check_optimized_kprobe check within optimized_kprobe range 2023-03-11 16:44:02 +01:00
ksysfs.c
kthread.c This is the 5.4.145 stable release 2021-09-12 09:54:40 +02:00
latencytop.c
Makefile kbuild: update config_data.gz only when the content of .config is changed 2021-05-11 14:04:16 +02:00
module_signature.c module: harden ELF info handling 2021-04-07 14:47:38 +02:00
module_signing.c module: harden ELF info handling 2021-04-07 14:47:38 +02:00
module-internal.h
module.c Merge tag 'ASB-2023-12-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2023-12-11 20:22:05 +02:00
notifier.c kernel/notifier.c: intercept duplicate registrations to avoid infinite loops 2020-10-01 13:17:23 +02:00
nsproxy.c
padata.c crypto: pcrypt - Fix hungtask for PADATA_RESET 2023-11-28 16:50:14 +00:00
panic.c exit: Use READ_ONCE() for all oops/warn limit reads 2023-02-06 07:52:50 +01:00
params.c
pid_namespace.c memcg: enable accounting for pids in nested pid namespaces 2021-09-22 12:26:37 +02:00
pid.c Merge android11-5.4.61+ (d240b69) into msm-5.4 2020-10-09 07:27:04 -07:00
profile.c profiling: fix shift too large makes kernel panic 2022-08-25 11:18:02 +02:00
ptrace.c ptrace: Reimplement PTRACE_KILL by always sending SIGKILL 2022-06-14 18:11:24 +02:00
range.c
reboot.c This is the 5.4.262 stable release 2023-11-29 10:18:14 +00:00
relay.c relayfs: fix out-of-bounds access in relay_file_read 2023-05-17 11:35:58 +02:00
resource.c
rseq.c
scs.c
seccomp.c seccomp: Invalidate seccomp mode to catch death failures 2022-02-16 12:52:53 +01:00
signal.c Merge tag 'ASB-2022-11-01_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2022-11-09 19:53:28 +02:00
smp.c Merge android11-5.4.191+ (375c2e2) into msm-5.4 2022-06-09 11:43:23 +05:30
smpboot.c kthread: Extract KTHREAD_IS_PER_CPU 2021-02-07 15:35:49 +01:00
smpboot.h
softirq.c
stackleak.c
stacktrace.c
stop_machine.c
sys_ni.c Merge android11-5.4.219+ (0ce03d1) into msm-5.4 2023-01-27 00:57:29 +05:30
sys.c This is the 5.4.230 stable release 2023-01-25 16:08:14 +00:00
sysctl_binary.c
sysctl-test.c
sysctl.c Merge tag 'ASB-2023-12-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2023-12-11 20:22:05 +02:00
task_work.c
taskstats.c taskstats: properly account NR_KERNEL_MISC_RECLAIMABLE 2021-07-01 06:18:34 -07:00
test_kprobes.c
torture.c
tracepoint.c tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing 2021-07-14 16:53:08 +02:00
tsacct.c taskstats: Cleanup the use of task->exit_code 2022-02-23 11:59:57 +01:00
ucount.c
uid16.c
uid16.h
umh.c usermodehelper: reset umask to default before executing user process 2020-10-14 10:32:58 +02:00
up.c Revert "smp: Fix smp_call_function_single_async prototype" 2021-05-14 15:29:26 +02:00
user_namespace.c
user-return-notifier.c
user.c
utsname_sysctl.c
utsname.c
watchdog_hld.c watchdog/perf: more properly prevent false positives with turbo modes 2023-07-27 08:37:10 +02:00
watchdog.c Merge android11-5.4.219+ (0ce03d1) into msm-5.4 2023-01-27 00:57:29 +05:30
workqueue_internal.h
workqueue.c Merge tag 'ASB-2023-12-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2023-12-11 20:22:05 +02:00