From: Andrew Morton <akpm@linux-foundation.org>
To: Nathan Zimmer <nzimmer@sgi.com>
Cc: linux-kernel@vger.kernel.org, John Stultz <johnstul@us.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Stephen Boyd <sboyd@codeaurora.org>
Subject: Re: [PATCH 2/2] timer_list: convert timer list to be a proper seq_file
Date: Wed, 27 Mar 2013 12:14:12 -0700 [thread overview]
Message-ID: <20130327121412.f589d0cc105843284e1d8eb5@linux-foundation.org> (raw)
In-Reply-To: <1364345790-14577-3-git-send-email-nzimmer@sgi.com>
On Tue, 26 Mar 2013 19:56:30 -0500 Nathan Zimmer <nzimmer@sgi.com> wrote:
> When running with 4096 cores attemping to read /proc/timer_list will fail
> with an ENOMEM condition. On a sufficantly large systems the total amount
> of data is more then 4mb, so it won't fit into a single buffer. The
> failure can also occur on smaller systems when memory fragmentation is
> high as reported by Dave Jones.
>
> Convert /proc/timer_list to a proper seq_file with its own iterator. This
> is a little more complex given that we have to make two passes with two
> separate headers.
>
> sysrq_timer_list_show also needed to be updated to reflect the fact that
> now timer_list_show only does one cpu at at time.
>
> ...
>
> --- a/kernel/time/timer_list.c
> +++ b/kernel/time/timer_list.c
> @@ -20,6 +20,13 @@
>
> #include <asm/uaccess.h>
>
> +
> +struct timer_list_iter {
> + int cpu;
> + bool second_pass;
> + u64 now;
> +};
> +
> typedef void (*print_fn_t)(struct seq_file *m, unsigned int *classes);
>
> DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);
> @@ -247,43 +254,101 @@ static void timer_list_show_tickdevices_header(struct seq_file *m)
> }
> #endif
>
> -static int timer_list_show(struct seq_file *m, void *v)
> +static inline void timer_list_header(struct seq_file *m, u64 now)
There's really no point in the explicit inline directive - modern gcc's
basically ignore it anyway.
> {
> - u64 now = ktime_to_ns(ktime_get());
> - int cpu;
> -
> SEQ_printf(m, "Timer List Version: v0.7\n");
> SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES);
> SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now);
> SEQ_printf(m, "\n");
> +}
>
> ...
>
> +void sysrq_timer_list_show(void)
> +{
> + u64 now = ktime_to_ns(ktime_get());
> + int cpu;
> +
> + timer_list_header(NULL, now);
>
> for_each_online_cpu(cpu)
hm, it seems this code is taking the optimistic approach to CPU hotplug.
> - print_cpu(m, cpu, now);
> + print_cpu(NULL, cpu, now);
next prev parent reply other threads:[~2013-03-27 19:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <alpine.LFD.2.02.1303251651200.22263@ionos>
2013-03-27 0:56 ` [PATCH v5 0/2] timer_list: Fix /proc/timer_list failure on 4096 cpus Nathan Zimmer
2013-03-27 0:56 ` [PATCH 1/2] timer_list: split timer_list_show_tickdevices Nathan Zimmer
2013-04-17 19:57 ` [tip:timers/core] timer_list: Split timer_list_show_tickdevices tip-bot for Nathan Zimmer
2013-03-27 0:56 ` [PATCH 2/2] timer_list: convert timer list to be a proper seq_file Nathan Zimmer
2013-03-27 19:14 ` Andrew Morton [this message]
2013-03-27 20:05 ` Thomas Gleixner
2013-04-17 19:58 ` [tip:timers/core] timer_list: Convert " tip-bot for Nathan Zimmer
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=20130327121412.f589d0cc105843284e1d8eb5@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nzimmer@sgi.com \
--cc=sboyd@codeaurora.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®