From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: [PATCH 13/17][cr][v4]: Add jiffies_begin field to ckpt_ctx Date: Mon, 16 Aug 2010 12:43:17 -0700 Message-ID: <1281987801-1293-14-git-send-email-sukadev@linux.vnet.ibm.com> References: <1281987801-1293-1-git-send-email-sukadev@linux.vnet.ibm.com> Cc: Serge Hallyn , Matt Helsley , Dan Smith , John Stultz , Matthew Wilcox , Jamie Lokier , Steven Whitehouse , , Containers To: Oren Laadan Return-path: Received: from e39.co.us.ibm.com ([32.97.110.160]:42183 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756237Ab0HPThz (ORCPT ); Mon, 16 Aug 2010 15:37:55 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e39.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o7GJRqSO006507 for ; Mon, 16 Aug 2010 13:27:52 -0600 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7GJbmVx156668 for ; Mon, 16 Aug 2010 13:37:48 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o7GJbkHc015754 for ; Mon, 16 Aug 2010 13:37:48 -0600 In-Reply-To: <1281987801-1293-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