lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0811252330140.3235@localhost.localdomain>
Date:	Tue, 25 Nov 2008 23:53:02 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Joe Korty <joe.korty@...r.com>
cc:	Michael Kerrisk <mtk.manpages@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>
Subject: Re: [PATCH] Display active jiffie timers in /proc/timer_list



On Tue, 25 Nov 2008, Joe Korty wrote:

> On Tue, Nov 25, 2008 at 04:36:48PM -0500, Thomas Gleixner wrote:
> > > --- 2.6.28-rc6.orig/kernel/timer.c    2008-11-25 11:59:07.000000000 -0500
> > > +++ 2.6.28-rc6/kernel/timer.c 2008-11-25 13:49:05.000000000 -0500
> > > +#if defined(CONFIG_PROC_FS) || defined(CONFIG_MAGIC_SYSRQ)
> > 
> > This belongs into kernel/time/timer_list.c and there is no need to
> > copy that code around.
> 
> Everything to do with jiffy timer implementation is static
> local to kernel/timer.c, and not available to code in
> kernel/time/timer_list.c or anywhere else.  I consider that
> localization to be a rather nice feature of kernel/timer.c,
> and I wasn't willing to globalize it just for a debug
> data dump.
>
> Also, other features implement their 'show' functions
> elsewhere, for example, show_interrupts.  So doing the
> same thing here is certainly not out of line.

I prefer a global variable over duplicate code and stuff which I have
to find out from random places.

show_interrupts is arch specific. timers are not.
 
> > > +void print_cpu_jtimers(struct seq_file *m, int cpu)
> > > +{
> > > +     int i;
> > > +     struct tvec_base *base = per_cpu(tvec_bases, cpu);
> > > +
> > > +     SEQ_printf(m, "active jiffie timers:\n");
> > > +     spin_lock_irq(&base->lock);
> > 
> > Yuck. We really do _NOT_ stop everything just to print timers. Check
> > the hrtimer print code in timer_list.c
> 
> I'm not sure there is a safe way to reference the timers without
> holding the lock.  But I will look into this and see what can
> be done.
 
You can't do a real snapshot of the timer wheel. All you can do is
walk it carefully and make a copy of the timer_list structure and then
print it. The timer wheel can be pretty full and we definitely do not
want to stop a CPU fully just to print debug information.

> > >               P_ns(idle_expires);
> > > -             SEQ_printf(m, "jiffies: %Lu\n",
> > > +             SEQ_printf(m, "jiffies: %llu (0x%llx)\n",
> > > +                        (unsigned long long)jiffies,
> > >                          (unsigned long long)jiffies);
> > 
> > The exact purpose of this change ?
> 
> In the 'active jiffie timer' section I print timer_jiffies
> etc in hex format.  It's probably just me, but I found that
> to be easier to read than the rather longer decimal format.
> So this change was to get a hex version of the global jiffies
> out, for easy comparison to values appearing in that section.
> 
> Certainly everything can be changed to decimal, if that is
> the consensus.

We want a consistent format for all the printouts.
 
Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ