linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: rjones@redhat.com, tglx@linutronix.de, mingo@redhat.com,
	hpa@zytor.com, x86@kernel.org, len.brown@intel.com,
	wangyun@linux.vnet.ibm.com
Subject: [PATCH] x86: Expose loops_per_jiffy through /proc/cpuinfo.
Date: Fri,  1 Mar 2013 16:38:43 +0000	[thread overview]
Message-ID: <1362155923-884-1-git-send-email-rjones@redhat.com> (raw)

From: "Richard W.M. Jones" <rjones@redhat.com>

When we run the current kernel using qemu with TCG (software emulation
of x86), adding the lpj= option to the guest kernel helps greatly with
clock stability especially when the host is heavily loaded.

Currently the calculated 'lpj=...' argument is printed by the kernel
during boot, but isn't available after boot (eg. if boot messages have
scrolled off the kernel message ring).  It is also not possible to
calculate lpj from available information, especially as non-root.

This adds lpj to /proc/cpuinfo information so it is always available.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
---
 arch/x86/kernel/cpu/proc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index e280253..bf9c2e8 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -103,6 +103,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
 		   c->loops_per_jiffy/(500000/HZ),
 		   (c->loops_per_jiffy/(5000/HZ)) % 100);
+	seq_printf(m, "lpj\t\t: %lu\n", c->loops_per_jiffy);
 
 #ifdef CONFIG_X86_64
 	if (c->x86_tlbsize > 0)
-- 
1.8.1.2


             reply	other threads:[~2013-03-01 16:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-01 16:38 Richard W.M. Jones [this message]
2013-03-01 16:46 ` [PATCH] x86: Expose loops_per_jiffy through /proc/cpuinfo Richard W.M. Jones
2013-03-01 17:06   ` Richard W.M. Jones

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=1362155923-884-1-git-send-email-rjones@redhat.com \
    --to=rjones@redhat.com \
    --cc=hpa@zytor.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=wangyun@linux.vnet.ibm.com \
    --cc=x86@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).