Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
kernel: time: Rollback tight loop delays in lieu of queued spin locks
Browse files Browse the repository at this point in the history
This reverts the following commits:
10078b3 ("alarmtimer: Add ndelay for tight loop"
3a6efbd ("kernel: time: Add delay after cpu_relax() in tight loops")

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
  • Loading branch information
0ctobot committed Jun 27, 2020
1 parent bfb2eac commit 5164fcf
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions include/linux/time.h
Expand Up @@ -7,8 +7,6 @@
# include <linux/math64.h>
# include <linux/time64.h>

#define TIMER_LOCK_TIGHT_LOOP_DELAY_NS 350

extern struct timezone sys_tz;

int get_timespec64(struct timespec64 *ts,
Expand Down
2 changes: 0 additions & 2 deletions kernel/time/alarmtimer.c
Expand Up @@ -27,7 +27,6 @@
#include <linux/posix-timers.h>
#include <linux/workqueue.h>
#include <linux/freezer.h>
#include <linux/delay.h>
#include <linux/compat.h>
#include <linux/module.h>

Expand Down Expand Up @@ -465,7 +464,6 @@ int alarm_cancel(struct alarm *alarm)
if (ret >= 0)
return ret;
cpu_relax();
ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
}
}
EXPORT_SYMBOL_GPL(alarm_cancel);
Expand Down
3 changes: 0 additions & 3 deletions kernel/time/hrtimer.c
Expand Up @@ -52,7 +52,6 @@
#include <linux/timer.h>
#include <linux/freezer.h>
#include <linux/compat.h>
#include <linux/delay.h>

#include <linux/uaccess.h>

Expand Down Expand Up @@ -153,7 +152,6 @@ struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer,
raw_spin_unlock_irqrestore(&base->cpu_base->lock, *flags);
}
cpu_relax();
ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
}
}

Expand Down Expand Up @@ -1069,7 +1067,6 @@ int hrtimer_cancel(struct hrtimer *timer)
if (ret >= 0)
return ret;
cpu_relax();
ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
}
}
EXPORT_SYMBOL_GPL(hrtimer_cancel);
Expand Down
2 changes: 0 additions & 2 deletions kernel/time/timer.c
Expand Up @@ -944,7 +944,6 @@ static struct timer_base *lock_timer_base(struct timer_list *timer,
raw_spin_unlock_irqrestore(&base->lock, *flags);
}
cpu_relax();
ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
}
}

Expand Down Expand Up @@ -1267,7 +1266,6 @@ int del_timer_sync(struct timer_list *timer)
if (ret >= 0)
return ret;
cpu_relax();
ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
}
}
EXPORT_SYMBOL(del_timer_sync);
Expand Down

0 comments on commit 5164fcf

Please sign in to comment.