All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Korty <joe.korty-oXJCJecloQs@public.gmane.org>
To: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Cc: Michael Kerrisk
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] Display active jiffie timers in /proc/timer_list
Date: Tue, 25 Nov 2008 17:23:20 -0500	[thread overview]
Message-ID: <20081125222320.GA23612@tsunami.ccur.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0811252224430.3235-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>

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.


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



> >
> > @@ -139,6 +140,7 @@
> >               SEQ_printf(m, " clock %d:\n", i);
> >               print_base(m, cpu_base->clock_base + i, now);
> >       }
> > +
> 
> random whitespace change

Will fix.


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

> > -     pe = proc_create("timer_list", 0644, NULL, &timer_list_fops);
> > +     pe = proc_create("timer_list", 0444, NULL, &timer_list_fops);
> >       if (!pe)
> >               return -ENOMEM;
> >       return 0;
> 
> Correct, but unrelated $subject. Separate patch please.

Will do.

Thanks for the review,
Joe
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Joe Korty <joe.korty@ccur.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>
Subject: Re: [PATCH] Display active jiffie timers in /proc/timer_list
Date: Tue, 25 Nov 2008 17:23:20 -0500	[thread overview]
Message-ID: <20081125222320.GA23612@tsunami.ccur.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0811252224430.3235@localhost.localdomain>

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.


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



> >
> > @@ -139,6 +140,7 @@
> >               SEQ_printf(m, " clock %d:\n", i);
> >               print_base(m, cpu_base->clock_base + i, now);
> >       }
> > +
> 
> random whitespace change

Will fix.


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

> > -     pe = proc_create("timer_list", 0644, NULL, &timer_list_fops);
> > +     pe = proc_create("timer_list", 0444, NULL, &timer_list_fops);
> >       if (!pe)
> >               return -ENOMEM;
> >       return 0;
> 
> Correct, but unrelated $subject. Separate patch please.

Will do.

Thanks for the review,
Joe

  parent reply	other threads:[~2008-11-25 22:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-21 22:11 [PATCH] create /proc/timer-wheel-list Joe Korty
2008-11-22 17:34 ` Alexey Dobriyan
2008-11-23  1:59   ` Joe Korty
2008-11-23 10:04     ` Ingo Molnar
2008-11-24 19:11       ` Joe Korty
     [not found] ` <20081121221113.GA13566-jPwT5PJblzyhckIl5yWhCw@public.gmane.org>
2008-11-25 16:06   ` Michael Kerrisk
2008-11-25 16:06     ` Michael Kerrisk
2008-11-25 18:57     ` [PATCH] Display active jiffie timers in /proc/timer_list Joe Korty
     [not found]       ` <20081125185740.GA21806-jPwT5PJblzyhckIl5yWhCw@public.gmane.org>
2008-11-25 21:36         ` Thomas Gleixner
2008-11-25 21:36           ` Thomas Gleixner
     [not found]           ` <alpine.LFD.2.00.0811252224430.3235-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-11-25 22:23             ` Joe Korty [this message]
2008-11-25 22:23               ` Joe Korty
2008-11-25 22:53               ` Thomas Gleixner
2008-11-26 16:48       ` [PATCH] Display active jiffie timers in /proc/timer_list, v2 Joe Korty
     [not found]         ` <20081126164845.GA17394-jPwT5PJblzyhckIl5yWhCw@public.gmane.org>
2008-11-26 17:07           ` Greg KH
2008-11-26 17:07             ` Greg KH
     [not found]             ` <20081126170715.GA28422-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2008-11-26 17:34               ` Joe Korty
2008-11-26 17:34                 ` Joe Korty
     [not found]                 ` <20081126173410.GA17879-jPwT5PJblzyhckIl5yWhCw@public.gmane.org>
2008-11-26 17:39                   ` Greg KH
2008-11-26 17:39                     ` Greg KH
     [not found]                     ` <20081126173931.GA1636-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2008-11-26 21:06                       ` [PATCH] ABI Documentation for /proc/timer_list Joe Korty
2008-11-26 21:06                         ` Joe Korty
     [not found]                         ` <20081126210613.GA20529-jPwT5PJblzyhckIl5yWhCw@public.gmane.org>
2008-11-28 21:37                           ` Michael Kerrisk
2008-11-28 21:37                             ` Michael Kerrisk
     [not found]                             ` <cfd18e0f0811281337j57166b4cv54e05296a779252e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-12-01 18:11                               ` [PATCH] ABI Documentation for /proc/timer_list, v2 Joe Korty
2008-12-01 18:11                                 ` Joe Korty
2008-12-05 17:12                                 ` Randy Dunlap
     [not found]                                   ` <493960F2.6070102-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-12-05 19:01                                     ` Joe Korty
2008-12-05 19:01                                       ` Joe Korty

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=20081125222320.GA23612@tsunami.ccur.com \
    --to=joe.korty-oxjcjecloqs@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mingo-X9Un+BFzKDI@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.