BACKPORT: timekeeping: Restructure the timekeeper some more
Access to time requires to touch two cachelines at minimum
1) The timekeeper data structure
2) The clocksource data structure
The access to the clocksource data structure can be avoided as almost
all clocksource implementations ignore the argument to the read
callback, which is a pointer to the clocksource.
But the core needs to touch it to access the members @read and @mask.
So we are better off by copying the @read function pointer and the
@mask from the clocksource to the core data structure itself.
For the most used ktime_get() access all required data including the
@read and @mask copies fits together with the sequence counter into a
single 64 byte cacheline.
For the other time access functions we touch in the current code three
cache lines in the worst case. But with the clocksource data copies we
can reduce that to two adjacent cachelines, which is more efficient
than disjunct cache lines.
BUG=chromium:324025
TEST=build/boot 3.8 on link
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: John Stultz <[email protected]>
(cherry picked from commit 6d3aadf3e180e09dbefab16478c6876b584ce16e)
Signed-off-by: Sonny Rao <[email protected]>
[SR: fix timekeeping_resume() again due to lack of e445cf1c4]
Conflicts:
kernel/time/timekeeping.c
Change-Id: I628664f3c063144e1a4035a6ece33a59f403b77d
Reviewed-on: https://chromium-review.googlesource.com/300777
Commit-Ready: Sonny Rao <[email protected]>
Tested-by: Sonny Rao <[email protected]>
Reviewed-by: Olof Johansson <[email protected]>
2 files changed