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>
Signed-off-by: Ruchit <ruchitmarathe@gmail.com>
fourteen
Sultan Alsawaf 6 years ago committed by Jenna
parent 66afad287b
commit 29e99761eb
  1. 3
      kernel/power/qos.c

@ -907,6 +907,9 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
s32 value;
struct pm_qos_request *req;
/* 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;

Loading…
Cancel
Save