Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:pzskc383
kernel
linux-2.6.33-default-slack.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File linux-2.6.33-default-slack.patch of Package kernel
From: Arjan van de Ven <arjan@linux.intel.com> Subject: Increase the default timer slack for better power efficiency Patch-mainline: Never Meego tweak to a default value: 1 msec default slack for select() and co is good enough for non-realtime systems such as desktops, and we get some power savings because of that. It also allows us to simplify the automatic estimator to be more predicatable. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> --- fs/select.c | 33 +-------------------------------- include/linux/init_task.h | 2 +- 2 files changed, 2 insertions(+), 33 deletions(-) --- a/fs/select.c +++ b/fs/select.c @@ -44,34 +44,8 @@ #define MAX_SLACK (100 * NSEC_PER_MSEC) -static long __estimate_accuracy(struct timespec *tv) -{ - long slack; - int divfactor = 1000; - - if (tv->tv_sec < 0) - return 0; - - if (task_nice(current) > 0) - divfactor = divfactor / 5; - - if (tv->tv_sec > MAX_SLACK / (NSEC_PER_SEC/divfactor)) - return MAX_SLACK; - - slack = tv->tv_nsec / divfactor; - slack += tv->tv_sec * (NSEC_PER_SEC/divfactor); - - if (slack > MAX_SLACK) - return MAX_SLACK; - - return slack; -} - static long estimate_accuracy(struct timespec *tv) { - unsigned long ret; - struct timespec now; - /* * Realtime tasks get a slack of 0 for obvious reasons. */ @@ -79,12 +53,7 @@ static long estimate_accuracy(struct tim if (rt_task(current)) return 0; - ktime_get_ts(&now); - now = timespec_sub(*tv, now); - ret = __estimate_accuracy(&now); - if (ret < current->timer_slack_ns) - return current->timer_slack_ns; - return ret; + return current->timer_slack_ns; } --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -166,7 +166,7 @@ extern struct cred init_cred; .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ .fs_excl = ATOMIC_INIT(0), \ .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ - .timer_slack_ns = 50000, /* 50 usec default slack */ \ + .timer_slack_ns = 1000000, /* 1 msec default slack */ \ .pids = { \ [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \ [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor