Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp965213imm; Fri, 22 Jun 2018 08:10:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFmRQwP7qlfVyv5AcdnCnnw1pdyIjepYpEXhxZmE40uim7w5jxZJdJF3kInI02o7yZXM0C X-Received: by 2002:a62:9945:: with SMTP id d66-v6mr2197176pfe.192.1529680242838; Fri, 22 Jun 2018 08:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529680242; cv=none; d=google.com; s=arc-20160816; b=xkLBg7f+K4b022au7DI2PbSYcWa1iWB2VPoBMe6y+yiS0/+Cie5OFq62VPFK3o529M z2SMetdZXL8ocLGou8c1lE292Gu7CxnkROG0WAgAz+We7moWndGWnmETo+C8Km2ErBOc 3ZdqbuiTx075JS6NCIKDHqeg5DBQbTFijiqLAYHgZZ12mDp1RQyFEPwhH7VtcyqurgL3 ynWWOKr0VfLNBzu7OVOGaf4mkEu0PpwccNaPQGM+4+sWTlFTUuddpSnVA6H9Pc6XaLmw V7HiS2HovCkQCChqYyPuH9I+nj9esLNlDBi9Qgi33Hl+q+gS2N6d7Ixraj+FXd88V8Cw OmeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :mime-version:dkim-signature:arc-authentication-results; bh=KumSvhZYiuaHlNNy8cCnbApkYxDl9lrTkEw/2sTTXTU=; b=Viu0SBfLndrovB3SHw3XWXACrBMImJCBuS+00LPd6i9kEB/FSnlIL+HfctjNbuFA2K 8kGp63SbdS4hD8mDbhntdkXu/m7ao8kGWo3ku8UsPdvDC+slTAsDK++LZaNKV0I2CV/F uIJADxKz90xARAx1ns1BxSr4JZj+O5L+vvdcr1+PLSDQ8GQYq+Xwhy0BVKfy6IBZZjxZ G1v/us2FWXtrmjjNBg2JyElJztqF5GvvtpA3ZBqCyjbCjm6jB4fy428Mp8tWT4GqlnC2 9ppL7zfCGESO3twg4cXagfcuk4gcQqGpMRP/V9WZRcGEM4xRzFoSw++mppY+F5nLhsoM E+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p3ulnrRn; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d88-v6si7700695pfl.297.2018.06.22.08.10.27; Fri, 22 Jun 2018 08:10:42 -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=@gmail.com header.s=20161025 header.b=p3ulnrRn; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754127AbeFVPJZ (ORCPT + 99 others); Fri, 22 Jun 2018 11:09:25 -0400 Received: from mail-ot0-f178.google.com ([74.125.82.178]:38228 "EHLO mail-ot0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751233AbeFVPJY (ORCPT ); Fri, 22 Jun 2018 11:09:24 -0400 Received: by mail-ot0-f178.google.com with SMTP id p95-v6so7854365ota.5 for ; Fri, 22 Jun 2018 08:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=KumSvhZYiuaHlNNy8cCnbApkYxDl9lrTkEw/2sTTXTU=; b=p3ulnrRnpVDZWh/cRckaUWf76yq1eS35IQMT+xGVTLof1kv+idbyCLWk4xdUNk6ylu xwWhWgcljxzgFPq1GAFE7qEbzx4qYfmnMwSJGZf8hwZxJFB4OoQB7PRoUDzsWNTyQopS Ybegpu6SNzcr7UskR/UC62h9NYEEd2t3Tbf8irC0kYpMgcbQZMD8Hd0xnDD2EncqCasF zRC1n2hB8sB0qULOUMaQZieStU/9k8JsF8z4uvZCIfohslevd9tv2cm5EwNpfAbNiwK4 LXOZuxFIEEebcvsBmAnbENJKxgTvfbJd4Js+sDH/tpLrxHCf3tdzjue9EEYOlOnJJU3+ SIEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=KumSvhZYiuaHlNNy8cCnbApkYxDl9lrTkEw/2sTTXTU=; b=LXc+lIp9FUc9zaSXQSUX64vxtxGdR3JbHodbxk6iJt5L9TbA7wJEimjSkDqeJxoiTY CL1T6NLmMMMis9gnhCSCeixAvk62kq04+BofM3eAmVKW39EKYvShDdhNc0OP94jZgsj+ Br9KpFmFZYOm9XbIFE1Spg0WmPttpxjcO+/S4ueWR5cXJkc5O+KA1OzhLzZAyg+tvYcV XxPK3R8Xjl3FgoKjqfPKGvzd+5pzjibAbZB6PBXEpAk6tDDFhK5n+8wqBZknNjeTeyZF xsD6sg4y7IIGQ3RQKhL9GHQDqGWD84sD9XQvaIwx1ZlO2ZICKC5nC5Ezf5jNfBg4AQBz rmTQ== X-Gm-Message-State: APt69E2MmXKAQGYrgdd/qI5+nt28hSLC4wuHp0lhV/4+dYuyyuM6vrQ5 Kt95N7lcpu+h3LXik3N68IJt3z31LjxfBY5FiRdO7g== X-Received: by 2002:a9d:fba:: with SMTP id d55-v6mr1222836otd.53.1529680163848; Fri, 22 Jun 2018 08:09:23 -0700 (PDT) MIME-Version: 1.0 From: Thommy Jakobsson Date: Fri, 22 Jun 2018 17:09:12 +0200 Message-ID: Subject: BUG? DOC: Really jiffies in /proc/schedstat? To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I am measuring cpu runtime for a couple of processes, and is using /proc/schedstat and /proc/[pid]/schedstat to do so. According to the schedstat doc (https://www.kernel.org/doc/Documentation/scheduler/sched-stats.txt) the last three values are in jiffies. Doing something like root@gvp4-base-pd-b-rev1:~# cat /proc/schedstat | grep cpu3; sleep 2; cat /proc/schedstat | grep cpu3; cpu3 0 0 0 0 0 0 41155818663320 17173365985560 1011370906 cpu3 0 0 0 0 0 0 41157858979020 17176095339120 1011430425 on a heavy loaded system seems to suggest that at least the sum of running tasks is in nanoseconds, not jiffies. Which I also think looks correct when checking the code. For /proc/[pid]/schedstat the documentation is a bit vague on unit, but I interpret it to be the same as the corresponding global values. Which would mean jiffies. Also here it looks to be in nanoseconds on my system though. Am I just confused? is it configuration/system dependent? or is the doc just plain wrong? Thanks, Thommy Jakobsson