From: Sukadev Bhattiprolu Subject: [PATCH 13/16][cr][v3]: Add jiffies_begin field to ckpt_ctx Date: Tue, 3 Aug 2010 16:11:34 -0700 Message-ID: <1280877097-12377-14-git-send-email-sukadev@linux.vnet.ibm.com> References: <1280877097-12377-1-git-send-email-sukadev@linux.vnet.ibm.com> Cc: Serge Hallyn , Matt Helsley , Dan Smith , John Stultz , Matthew Wilcox , Jamie Lokier , , Containers To: Oren Laadan Return-path: Received: from e5.ny.us.ibm.com ([32.97.182.145]:46669 "EHLO e5.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757847Ab0HCXG3 (ORCPT ); Tue, 3 Aug 2010 19:06:29 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by e5.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o73Mm5YS017329 for ; Tue, 3 Aug 2010 18:48:05 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o73N6SWS269590 for ; Tue, 3 Aug 2010 19:06:28 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o73N6Qaw004642 for ; Tue, 3 Aug 2010 19:06:27 -0400 In-Reply-To: <1280877097-12377-1-git-send-email-sukadev@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: '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 --- 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