Commit 7fd93cf3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] posix-timers `unlikely' rejig

!unlikely(expr) hurts my brain.   likely(!expr) is more straightforward.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 863c84b9
...@@ -497,7 +497,7 @@ static void process_timer_rebalance(struct task_struct *p, ...@@ -497,7 +497,7 @@ static void process_timer_rebalance(struct task_struct *p,
left = cputime_div(cputime_sub(expires.cpu, val.cpu), left = cputime_div(cputime_sub(expires.cpu, val.cpu),
nthreads); nthreads);
do { do {
if (!unlikely(t->flags & PF_EXITING)) { if (likely(!(t->flags & PF_EXITING))) {
ticks = cputime_add(prof_ticks(t), left); ticks = cputime_add(prof_ticks(t), left);
if (cputime_eq(t->it_prof_expires, if (cputime_eq(t->it_prof_expires,
cputime_zero) || cputime_zero) ||
...@@ -512,7 +512,7 @@ static void process_timer_rebalance(struct task_struct *p, ...@@ -512,7 +512,7 @@ static void process_timer_rebalance(struct task_struct *p,
left = cputime_div(cputime_sub(expires.cpu, val.cpu), left = cputime_div(cputime_sub(expires.cpu, val.cpu),
nthreads); nthreads);
do { do {
if (!unlikely(t->flags & PF_EXITING)) { if (likely(!(t->flags & PF_EXITING))) {
ticks = cputime_add(virt_ticks(t), left); ticks = cputime_add(virt_ticks(t), left);
if (cputime_eq(t->it_virt_expires, if (cputime_eq(t->it_virt_expires,
cputime_zero) || cputime_zero) ||
...@@ -527,7 +527,7 @@ static void process_timer_rebalance(struct task_struct *p, ...@@ -527,7 +527,7 @@ static void process_timer_rebalance(struct task_struct *p,
nsleft = expires.sched - val.sched; nsleft = expires.sched - val.sched;
do_div(nsleft, nthreads); do_div(nsleft, nthreads);
do { do {
if (!unlikely(t->flags & PF_EXITING)) { if (likely(!(t->flags & PF_EXITING))) {
ns = t->sched_time + nsleft; ns = t->sched_time + nsleft;
if (t->it_sched_expires == 0 || if (t->it_sched_expires == 0 ||
t->it_sched_expires > ns) { t->it_sched_expires > ns) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment