Re: [PATCH] Introduce boot based time

From: Andrew Morton
Date: Thu May 10 2007 - 19:40:52 EST


On Thu, 10 May 2007 19:10:25 +0200
Tomas Janousek <tjanouse@xxxxxxxxxx> wrote:

> The commits
> 411187fb05cd11676b0979d9fbf3291db69dbce2 (GTOD: persistent clock support)
> c1d370e167d66b10bca3b602d3740405469383de (i386: use GTOD persistent clock
> support)
> changed the monotonic time so that it no longer jumps after resume, but it's
> not possible to use it for boot time and process start time calculations then.
> Also, the uptime no longer increases during suspend.
>
> I add a variable to track the wall_to_monotonic changes, a function to get the
> real boot time and a function to get the boot based time from the monotonic
> one.

From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

- I don't think those sybols are needed in modules.

- Document total_sleep_time units (would have been better to call it
total_sleep_time_secs, perhaps).

Cc: John Stultz <johnstul@xxxxxxxxxx>
Cc: Tomas Janousek <tjanouse@xxxxxxxxxx>
Cc: Tomas Smetana <tsmetana@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

kernel/time/timekeeping.c | 6 +-----
1 files changed, 1 insertion(+), 5 deletions(-)

diff -puN include/linux/time.h~introduce-boot-based-time-fix include/linux/time.h
diff -puN kernel/time/timekeeping.c~introduce-boot-based-time-fix kernel/time/timekeeping.c
--- a/kernel/time/timekeeping.c~introduce-boot-based-time-fix
+++ a/kernel/time/timekeeping.c
@@ -46,7 +46,7 @@ EXPORT_SYMBOL(xtime_lock);
*/
struct timespec xtime __attribute__ ((aligned (16)));
struct timespec wall_to_monotonic __attribute__ ((aligned (16)));
-static unsigned long total_sleep_time;
+static unsigned long total_sleep_time; /* seconds */

EXPORT_SYMBOL(xtime);

@@ -503,8 +503,6 @@ void getboottime(struct timespec *ts)
- wall_to_monotonic.tv_nsec);
}

-EXPORT_SYMBOL(getboottime);
-
/**
* monotonic_to_bootbased - Convert the monotonic time to boot based.
* @ts: pointer to the timespec to be converted
@@ -513,5 +511,3 @@ void monotonic_to_bootbased(struct times
{
ts->tv_sec += total_sleep_time;
}
-
-EXPORT_SYMBOL(monotonic_to_bootbased);
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/