diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2008-09-01 18:52:40 -0400 |
---|---|---|
committer | Arjan van de Ven <arjan@linux.intel.com> | 2008-09-06 00:35:30 -0400 |
commit | 6976675d94042fbd446231d1bd8b7de71a980ada (patch) | |
tree | 2d2acebb8078dd373115ecbdac5423f7d4fa7d72 /include/linux/sched.h | |
parent | 654c8e0b1c623b156c5b92f28d914ab38c9c2c90 (diff) |
hrtimer: create a "timer_slack" field in the task struct
We want to be able to control the default "rounding" that is used by
select() and poll() and friends. This is a per process property
(so that we can have a "nice" like program to start certain programs with
a looser or stricter rounding) that can be set/get via a prctl().
For this purpose, a field called "timer_slack_ns" is added to the task
struct. In addition, a field called "default_timer_slack"ns" is added
so that tasks easily can temporarily to a more/less accurate slack and then
back to the default.
The default value of the slack is set to 50 usec; this is significantly less
than 2.6.27's average select() and poll() timing error but still allows
the kernel to group timers somewhat to preserve power behavior. Applications
and admins can override this via the prctl()
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 3d9120c5ad15..dcc03fd5a7f3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1301,6 +1301,12 @@ struct task_struct { | |||
1301 | int latency_record_count; | 1301 | int latency_record_count; |
1302 | struct latency_record latency_record[LT_SAVECOUNT]; | 1302 | struct latency_record latency_record[LT_SAVECOUNT]; |
1303 | #endif | 1303 | #endif |
1304 | /* | ||
1305 | * time slack values; these are used to round up poll() and | ||
1306 | * select() etc timeout values. These are in nanoseconds. | ||
1307 | */ | ||
1308 | unsigned long timer_slack_ns; | ||
1309 | unsigned long default_timer_slack_ns; | ||
1304 | }; | 1310 | }; |
1305 | 1311 | ||
1306 | /* | 1312 | /* |