linux / backbone-sources


To clone this repository:

git clone

To push to this repository:

# Add a new remote
git remote add origin

# Push the master branch to the newly added origin, and configure
# this remote and branch as the default:
git push -u origin master

# From now on you can push master to the "origin" remote with:
git push

Commit: #5a9f69b

Parent: #c426a71

hrtimer: Ensure POSIX compliance (relative CLOCK_REALTIME hrtimers)

commit 48d0c9becc7f3c66874c100c126459a9da0fdced upstream.

The POSIX specification defines that relative CLOCK_REALTIME timers are not affected by clock modifications. Those timers have to use CLOCK_MONOTONIC to ensure POSIX compliance.

The introduction of the additional HRTIMER_MODE_PINNED mode broke this requirement for pinned timers.

There is no user space visible impact because user space timers are not using pinned mode, but for consistency reasons this needs to be fixed.

Check whether the mode has the HRTIMER_MODE_REL bit set instead of comparing with HRTIMER_MODE_ABS.

Signed-off-by: Anna-Maria Gleixner <> Cc: Christoph Hellwig <> Cc: John Stultz <> Cc: Linus Torvalds <> Cc: Peter Zijlstra <> Cc: Thomas Gleixner <> Cc: Fixes: 597d0275736d ("timers: Framework for identifying pinned timers") Link: Signed-off-by: Ingo Molnar <> Cc: Mike Galbraith <> Signed-off-by: Greg Kroah-Hartman <>

avatar <gregkh @linuxfo…> (Committer) 21 days ago

avatar Anna-Maria Gleixner <anna-maria @linut…> (Author) 2017-12-21 13:41


1134 1134
1135 1135 cpu_base = raw_cpu_ptr(&hrtimer_bases);
1136 1136
1137 if (clock_id == CLOCK_REALTIME && mode != HRTIMER_MODE_ABS)
1137 /*
1138 * POSIX magic: Relative CLOCK_REALTIME timers are not affected by
1139 * clock modifications, so they needs to become CLOCK_MONOTONIC to
1140 * ensure POSIX compliance.
1141 */
1142 if (clock_id == CLOCK_REALTIME && mode & HRTIMER_MODE_REL)
1138 1143 clock_id = CLOCK_MONOTONIC;
1139 1144
1140 1145 base = hrtimer_clockid_to_base(clock_id);