linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: Expose loops_per_jiffy through /proc/cpuinfo.
@ 2013-03-01 16:38 Richard W.M. Jones
  2013-03-01 16:46 ` Richard W.M. Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Richard W.M. Jones @ 2013-03-01 16:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: rjones, tglx, mingo, hpa, x86, len.brown, wangyun

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: Expose loops_per_jiffy through /proc/cpuinfo.
  2013-03-01 16:38 [PATCH] x86: Expose loops_per_jiffy through /proc/cpuinfo Richard W.M. Jones
@ 2013-03-01 16:46 ` Richard W.M. Jones
  2013-03-01 17:06   ` Richard W.M. Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Richard W.M. Jones @ 2013-03-01 16:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, mingo, hpa, x86, len.brown, wangyun


Ignore this patch, it's obviously wrong.  Too late in the afternoon ...

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: Expose loops_per_jiffy through /proc/cpuinfo.
  2013-03-01 16:46 ` Richard W.M. Jones
@ 2013-03-01 17:06   ` Richard W.M. Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Richard W.M. Jones @ 2013-03-01 17:06 UTC (permalink / raw)
  To: linux-kernel

On Fri, Mar 01, 2013 at 04:46:43PM +0000, Richard W.M. Jones wrote:
> Ignore this patch, it's obviously wrong.  Too late in the afternoon ...

Actually, NOT wrong.  You can't get HZ from userspace, so
exporting loops_per_jiffy like this is necessary.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-01 17:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-01 16:38 [PATCH] x86: Expose loops_per_jiffy through /proc/cpuinfo Richard W.M. Jones
2013-03-01 16:46 ` Richard W.M. Jones
2013-03-01 17:06   ` Richard W.M. Jones

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).