Skip to content

Commit

Permalink
qos: Don't allow userspace to impose restrictions on CPU idle levels
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kerneltoast committed May 5, 2019
1 parent 6bc1772 commit e885e67
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/power/qos.c
Expand Up @@ -868,6 +868,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;
Expand Down

0 comments on commit e885e67

Please sign in to comment.