Messages in this thread | | | Date | Wed, 01 May 2013 14:42:28 -0400 | From | KOSAKI Motohiro <> | Subject | Re: [PATCH 09/10] sched: task_sched_runtime introduce micro optimization |
| |
(5/1/13 7:00 AM), Peter Zijlstra wrote: > On Mon, Apr 29, 2013 at 11:17:17PM -0400, kosaki.motohiro@gmail.com wrote: >> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> >> >> rq lock in task_sched_runtime() is necessary for two reasons. 1) >> accessing se.sum_exec_runtime is inatomic on 32bit and 2) >> do_task_delta_exec() require it. >> >> And then, 64bit can avoid holds rq lock when add_delta is false. >> >> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> >> --- >> kernel/sched/core.c | 6 ++++++ >> 1 files changed, 6 insertions(+), 0 deletions(-) >> >> diff --git a/kernel/sched/core.c b/kernel/sched/core.c >> index b817e6d..24ba1c6 100644 >> --- a/kernel/sched/core.c >> +++ b/kernel/sched/core.c >> @@ -2657,6 +2657,12 @@ unsigned long long task_sched_runtime(struct task_struct *p, bool add_delta) >> struct rq *rq; >> u64 ns = 0; >> >> + /* Micro optimization. */ > > Instead of the above; how about something like: > > /* 64-bit doesn't need locks to atomically read a 64bit value */
Looks nicer. Indeed.
| |