linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hagood <david.hagood@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: On a tickless kernel, how to convert jiffies into a real time
Date: Sun, 11 Jan 2015 10:00:38 -0600	[thread overview]
Message-ID: <54B29E26.6070807@gmail.com> (raw)

On a kernel configured for full tickless operation, how can a user space 
program take a value reported by the kernel in jiffies and convert it 
into a meaningful wall clock time?

I am asking specifically in terms of parsing the output from 
/proc/net/xt_recent/*, but there are other places where user space gets 
jiffies from the kernel, so this is a bit more generic.

I have seen several suggestions of just reading the parameters via 
sysconf(_SC_CLK_TCK), but that does not work - that reports 1000 jiffies 
per second, but that is NOT the value that is being used by the kernel - 
as best as I can tell by inspection, it seems to be running somewhere 
around 2145 ticks per second, and seems to vary based upon what the 
system is doing. If the value does indeed vary, then there's really no 
way to compute a jiffies value to wall clock time save at the instant 
that jiffies value is captured.


                 reply	other threads:[~2015-01-11 16:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54B29E26.6070807@gmail.com \
    --to=david.hagood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).