Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4142129ybi; Mon, 29 Jul 2019 20:10:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcSJkiOQGmQxAGmSX3fTOfN71bCAA7lQxrjpOrAtu2oS3qyG/Urxy0qejtox/mZHswnqQP X-Received: by 2002:a17:90a:350c:: with SMTP id q12mr115645231pjb.46.1564456235173; Mon, 29 Jul 2019 20:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564456235; cv=none; d=google.com; s=arc-20160816; b=qRk7ASK7tzTA3lRYjH+DkdTnwsO7/xgjho6jJywivyFTVqu0GjOpJJGtfNdi3WZCaD Ye0Db+v/fVFB47yH4WymimQk0M96101ATuuKNxLOi1K/wuQfPSegx3oSYqnvzdA8BLKV QHgUpIaEN+nnL072VavG8DpmyIcIkFE1EaKHzLW3fthaqFEEZdqVe/GXL9btx5FHFJGx xWPelOjchRPjXLqDiFRpKljUj87HkX13p53LywPX6s16xdvXS/jkqlWAinDZE0lccLUc jzCs09ylyYO2sjS3ueZE5k+/aY3W7SZgplvLpyhdLtdIkJgZqjb2IpnE0fvGWhGAS7++ 6Jtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uBAXcNmS3l3nfaiqDJOSvjXWDET+01IZ2JhTywzQRP4=; b=Jpq+u8ghbejlIMCaIdQ+5p8w5SPjZ4ZtN2qUztgShkGRMvA9OhKgw8+vj4EiLnSHMt RAW729rdE6XO+K8qZTzdR+nftFhQdg9nLQxFtFHKBOBOXyyooVcJsyywtbbPDix/lqIn URDbx7uSWZGjatr7SSZJIQJ68zeFx3d2Kpj0khiQvmI/MybKhHbP+S5eNWjvzircqK1n fi3eL82BltVA5Km5CwWOt1RS2KDMgQbMsZPrXM31W2XuJSTsjMx9eMGOaIEMHvVqHqDq tWhvCZeILkeIl0j87NywfZp3Uu6kadItJ67cCvHLweESANIR6da8RtrjCYH1TeJNtb6w h7og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b="g1q/BkZM"; 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 e14si21774913pgg.442.2019.07.29.20.10.19; Mon, 29 Jul 2019 20:10:35 -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="g1q/BkZM"; 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 S1728862AbfG2WBc (ORCPT + 99 others); Mon, 29 Jul 2019 18:01:32 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54778 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389267AbfG2V60 (ORCPT ); Mon, 29 Jul 2019 17:58:26 -0400 Received: by mail-wm1-f65.google.com with SMTP id p74so55158476wme.4 for ; Mon, 29 Jul 2019 14:58:24 -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 :mime-version:content-transfer-encoding; bh=uBAXcNmS3l3nfaiqDJOSvjXWDET+01IZ2JhTywzQRP4=; b=g1q/BkZMUq4el8iFlMlE2qzEkE7J7+rd1DrZqn3UcvHHX2Du2fxG9Z0DDNHr5oVrJ+ 1Bxb98mT/fjQcQKWJva03y4yz82D14gv4jdRlqzV2hhwMSna4jSOLGfbfOirH28IYrTc W60RLQS8L+tZBl0NbRkSq/1DiLiC+lUiVsBXwjjOXHw8gXxkZKf/spkYWt8dP05SBtxF bTxglugbOuelSJ01Uj1DhSI9c8egDb8kOj19tHiHMfd3fmISNJBGTAdnBO75pS2H7J7Q lI+azQYIqSjR6z2IlEhXX8Wf2U+l2ww8dFlEKvbhF/SchTCpj5V8wbN/ORqhHKnPqt0+ Sdgg== 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:mime-version:content-transfer-encoding; bh=uBAXcNmS3l3nfaiqDJOSvjXWDET+01IZ2JhTywzQRP4=; b=X9Y/dg3Nna8IfH2OHGE6ZDNNc1pojchhux0uZiLjU/9tM+zLiDx6+kJyUowtNVbC2c 1f2OgZFphvUMKNteSQeyeN+6gp22pH8GhS2ASWoJPzln7GIuq1aakzf7eg/8uFrorFqY B6kCZYZ1W7r/Gf/T7PKdhSzpX/vt7V1lbxK8Ya6dryUEhsiSVU2NQAsabRAHGUBZZsvK HoKmuUKrq20kJiPkotfh4vRE5yB1mPvrTKv1/MBDKusU4qju+aJFgjNqXXxh+SZBMx+4 p/34KM8CZh9BSCF6QbIsUIfEd9CgyX8fVgCF4Iqg7mB20T6xYI/ldzaE9mrg4N466ewV rUAw== X-Gm-Message-State: APjAAAXq9d3tkvpNXvEZpb2a9y4PwKbPThtplV1axtSU4bUpG+2CoOze ku2kyavsiF9d63zSHJpiJ5WpkvLt8MAAmEyTLVBWklwyoZAtnaHuokgJ/LvNhdsI1P4tqVO09gZ bHDXbbXfA0wR5vBgcn7Pg95rHTctNLNk9Mk+gf4zEbnZIcKyCep3GYVYzsdkmct3E+VCvbCXp8r dZbIf5/1pLNZgScOPSaoZR2TFY5bnVcCG6KNbBgpQ= X-Received: by 2002:a1c:9696:: with SMTP id y144mr100565206wmd.73.1564437503760; Mon, 29 Jul 2019 14:58:23 -0700 (PDT) Received: from Mindolluin.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id x20sm49230728wmc.1.2019.07.29.14.58.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 14:58:23 -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 , Arnd Bergmann , Christian Brauner , Cyrill Gorcunov , "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , Thomas Gleixner , Vincenzo Frascino , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org Subject: [PATCHv5 17/37] fd/proc: Respect boottime inside time namespace for /proc/uptime Date: Mon, 29 Jul 2019 22:56:59 +0100 Message-Id: <20190729215758.28405-18-dima@arista.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729215758.28405-1-dima@arista.com> References: <20190729215758.28405-1-dima@arista.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CLOUD-SEC-AV-Info: arista,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin 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..5a1b228964fb 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_add_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.22.0