[Devel] [PATCH 13/16][cr][v3]: Add jiffies_begin field to ckpt_ctx
Sukadev Bhattiprolu
sukadev at linux.vnet.ibm.com
Tue Aug 3 16:11:34 PDT 2010
'jiffies_begin' is needed to compute relative time-offsets after restart.
We cannot use ->ktime_begin for these computations since, as pointed out
by John Stultz, converting jiffies to CLOCK_MONOTONIC can result in
incorrect values.
Signed-off-by: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
---
include/linux/checkpoint_types.h | 1 +
kernel/checkpoint/sys.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/linux/checkpoint_types.h b/include/linux/checkpoint_types.h
index 3ffe9bd..aba9380 100644
--- a/include/linux/checkpoint_types.h
+++ b/include/linux/checkpoint_types.h
@@ -33,6 +33,7 @@ struct ckpt_ctx {
int crid; /* unique checkpoint id */
ktime_t ktime_begin; /* checkpoint start time */
+ unsigned long jiffies_begin;
int root_init; /* [container] root init ? */
pid_t root_pid; /* [container] root pid */
diff --git a/kernel/checkpoint/sys.c b/kernel/checkpoint/sys.c
index b761ec0..0beeee5 100644
--- a/kernel/checkpoint/sys.c
+++ b/kernel/checkpoint/sys.c
@@ -278,6 +278,7 @@ static struct ckpt_ctx *ckpt_ctx_alloc(int fd, unsigned long uflags,
ctx->uflags = uflags;
ctx->kflags = kflags;
ctx->ktime_begin = ktime_get();
+ ctx->jiffies_begin = jiffies;
ctx->coord_pidns = get_pid_ns(current->nsproxy->pid_ns);
atomic_set(&ctx->refcount, 0);
--
1.6.0.4
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list