Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8cde1ad6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'sched-fixes-for-linus' of...

Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched_clock: prevent scd->clock from moving backwards
parents 6bb7a935 5b16a221
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -119,12 +119,12 @@ static u64 __update_sched_clock(struct sched_clock_data *scd, u64 now)
	/*
	 * scd->clock = clamp(scd->tick_gtod + delta,
	 *		      max(scd->tick_gtod, scd->clock),
	 * 		      scd->tick_gtod + TICK_NSEC);
	 *		      max(scd->clock, scd->tick_gtod + TICK_NSEC));
	 */

	clock = scd->tick_gtod + delta;
	min_clock = wrap_max(scd->tick_gtod, scd->clock);
	max_clock = scd->tick_gtod + TICK_NSEC;
	max_clock = wrap_max(scd->clock, scd->tick_gtod + TICK_NSEC);

	clock = wrap_max(clock, min_clock);
	clock = wrap_min(clock, max_clock);