qos: Don't allow userspace to impose restrictions on CPU idle levels

Giving userspace intimate control over CPU latency requirements is
nonsense. Userspace can't even stop itself from being preempted, so
there's no reason for it to have access to a mechanism primarily used to
eliminate CPU delays on the order of microseconds.

Remove userspace's ability to send pm_qos requests so that it can't hurt
power consumption.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
Sultan Alsawaf 2019-05-03 00:34:19 -07:00 committed by Ksawlii
parent fff787f527
commit d30b7253ed

View file

@ -383,6 +383,9 @@ static ssize_t cpu_latency_qos_write(struct file *filp, const char __user *buf,
/* Don't let userspace impose restrictions on CPU idle levels */
return count;
/* Don't let userspace impose restrictions on CPU idle levels */
return count;
if (count == sizeof(s32)) {
if (copy_from_user(&value, buf, sizeof(s32)))
return -EFAULT;