Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1195441imm; Wed, 19 Sep 2018 13:53:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbWcFxshOKmy32nB8Aycu4KSyFu5SD192M+0ku9lHxw0299Hlwxe1hejbB7gh+SwySK/W2b X-Received: by 2002:aa7:82c3:: with SMTP id f3-v6mr38388190pfn.136.1537390439299; Wed, 19 Sep 2018 13:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537390439; cv=none; d=google.com; s=arc-20160816; b=0jN7zBtIdk18qn8KR/sj+LTMhfK1LENpUAaru4hUNLVHUxrds76IcbuJjoUJ6SQESR OwWC/yfef47eN3GJSwWouZqRJI3SVKJsp4n0vhixs4X7W6KGDH6QduRi1DJK+SHztM9E IQsxBQEevx8XZH41hoZZIE7eCfS6pyotve6ByiykBi+AEE0MpXCKVR9Y7fHD/ubQFghE DFoj2haltTDfgYMSrIK/0/JHedUDmLlrQBpGNDtlRPxC2RfrWR62aNqrAPYZepXNBG77 KHlE20EzJ/BRaueeBi//1uA0h/Aypn0kTluNQ9ZGqvU/96yacPsPmou7oEGWkhD4l1it 08qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=kDaZEMB2C80kMNyCOhHh/iJBiqAUF/7c7WB9+YRBuTE=; b=sZGlv4X3fz1YT5NwO5UnLJEx8l4RMzqWJDu37uR62sns2nnMgAmd15QfltGWn74qK8 RsUA5b2DKXllx7NzVLOUGXoHqAUhmviQAd1W2o6om4sirLcuI4mXqdpKSsleBgnI8Xj+ xDUeYZQLk20FLRed9I2+DREkMeDqqw2FB0++Jx92cjLN8TO9JhmSNyCbOYnHhdGLL1aJ ijfGVpUlVuHql+X8/5GDzXIckHPTY/9uVUX0z7/cPkdYB3UedPqlqkTbTxcoplM52fXG PhoHm4WsIHlC41xdhJbF7/Jh8Row1Ft+jUKWhzXq7fhl676CYyzZdw2zBrdfrTNjssvK S24A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=P0NUL8cA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r18-v6si21141169pgj.194.2018.09.19.13.53.43; Wed, 19 Sep 2018 13:53:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=P0NUL8cA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733016AbeITCby (ORCPT + 99 others); Wed, 19 Sep 2018 22:31:54 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:41806 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732713AbeITCaa (ORCPT ); Wed, 19 Sep 2018 22:30:30 -0400 Received: by mail-ed1-f68.google.com with SMTP id f38-v6so6028917edd.8 for ; Wed, 19 Sep 2018 13:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kDaZEMB2C80kMNyCOhHh/iJBiqAUF/7c7WB9+YRBuTE=; b=P0NUL8cABaWV9joJLNyZH6+AnE5fllXYkQLUGvmTy5DInTp/zeY7mAJXdjxlDDQnjG LtsPp5IrRvWcWhfqitKQsGOUqzN3AttsBlmgRa0ZK1BmossUYcMxvM5lGiwJRVJqWd2f c34ttnpn/dYMdFhiEqksd4ze/gypbGBA2wsqB3vhYLwKsi8higXyhVioVdbwWPU8n5B7 ETrLpQnwMqKQ24iiSroFEBUDI0ncbwhI+PLjxWuluhL1/XTqnlHQkrDQMwqj3Li7rSjh VsNgh30iPovFFtYQy9erO7Hi5/smpxptktRLE4OQ7o0rVtEk/9qCiWdJLdJib5yZY06Y zviQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kDaZEMB2C80kMNyCOhHh/iJBiqAUF/7c7WB9+YRBuTE=; b=Nl/pjraqU7HbM5rtYktKjZF5Xa7vg5Z9Nonqk4ldVylXFK/Xs8BnIFiqW38HUHRhL0 1v0zG8JA6doY3RIRi1rE4pzb2JsWiNiLz2ddSQgCAG1VYXWBzIW4dYCiskLK6ONExGtp NYt4nczx4T9rE7DOKJvOiwtPIGNm+hStOhnPXlFHKt4NJssesb4C2jOdiErF155CZzLf CZfTBfLIBYcqfEk8ZPoi34lLmvo8lKJd1if1xpELXo0yqExkAiS1k1bdh4UdYvcMjOqI W1KOtWD9VPerccUnmJMfgHVf6iqlQLddKsDUturgFmN6Fkj8ZkjdyMbBwf/JOiI+LAA4 uzMQ== X-Gm-Message-State: APzg51CA3in6I5c7HC6QilcvqsP2AG9yAXsLbzoF5JZ5PSiIQsj45vcD I/AXNNIvgCK+mFsgD+g/8tdOi+W5Eak= X-Received: by 2002:a50:a7a2:: with SMTP id i31-v6mr61302489edc.296.1537390249603; Wed, 19 Sep 2018 13:50:49 -0700 (PDT) Received: from dhcp.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id t17-v6sm1747729edb.27.2018.09.19.13.50.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 13:50:48 -0700 (PDT) From: Dmitry Safonov To: linux-kernel@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Dmitry Safonov , Adrian Reber , Andrei Vagin , Andy Lutomirski , Christian Brauner , Cyrill Gorcunov , "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , Thomas Gleixner , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org, Alexey Dobriyan Subject: [RFC 07/20] timens: Shift /proc/uptime Date: Wed, 19 Sep 2018 21:50:24 +0100 Message-Id: <20180919205037.9574-8-dima@arista.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180919205037.9574-1-dima@arista.com> References: <20180919205037.9574-1-dima@arista.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Respect boottime inside time namespace for /proc/uptime Cc: Alexey Dobriyan Signed-off-by: Dmitry Safonov --- fs/proc/uptime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c index a4c2791ab70b..4421ec058472 100644 --- a/fs/proc/uptime.c +++ b/fs/proc/uptime.c @@ -5,6 +5,7 @@ #include #include #include +#include #include static int uptime_proc_show(struct seq_file *m, void *v) @@ -20,6 +21,8 @@ static int uptime_proc_show(struct seq_file *m, void *v) nsec += (__force u64) kcpustat_cpu(i).cpustat[CPUTIME_IDLE]; ktime_get_boottime_ts64(&uptime); + timens_clock_from_host(CLOCK_BOOTTIME, &uptime); + idle.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem); idle.tv_nsec = rem; seq_printf(m, "%lu.%02lu %lu.%02lu\n", -- 2.13.6