linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: akpm@linux-foundation.org
Cc: mm-commits@vger.kernel.org,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Nathan Zimmer <nzimmer@sgi.com>
Subject: Re: mmotm 2013-02-19-17-20 uploaded
Date: Thu, 21 Feb 2013 01:25:29 -0800	[thread overview]
Message-ID: <5125E809.4060407@codeaurora.org> (raw)
In-Reply-To: <20130220012122.870BB31C11E@corp2gmr1-1.hot.corp.google.com>

On 2/19/2013 5:21 PM, akpm@linux-foundation.org wrote:
> * timer_list-split-timer_list_show_tickdevices.patch
> * timer_list-convert-timer-list-to-be-a-proper-seq_file.patch
> * timer_list-convert-timer-list-to-be-a-proper-seq_file-fix.patch
> * timer_list-convert-timer-list-to-be-a-proper-seq_file-v2.patch
> * timer_list-convert-timer-list-to-be-a-proper-seq_file-v2-fix.patch
> * timer_list-convert-timer-list-to-be-a-proper-seq_file-fix-fix.patch

These commits seem to break the timer list on devices with maxcpus !=
nr_cpu_ids, which is possible if you specify maxcpus on the kernel
command line. I no longer see the percpu devices that I normally have
after the broadcast device.

I also notice what looks like an extra newline inserted in the output
between the percpu devices and the broadcast device, which may not be
intentional. There are also some more spelling mistakes in the comments.
Can we fold in this fix on top of the others (hopefully not white-space
damaged)?

diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index 9904e48..e3cb935 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -244,7 +244,6 @@ static void timer_list_show_tickdevices_header(struct seq_file *m)
 #endif
 	SEQ_printf(m, "\n");
 #endif
-	SEQ_printf(m, "\n");
 }
 #endif
 
@@ -275,7 +274,7 @@ static int timer_list_show(struct seq_file *m, void *v)
 }
 
 /*
- * This itererator really needs some explnation since it is offset and has
+ * This iterator really needs some explanation since it is offset and has
  * two passes, one of which is controlled by a config option.
  * In a hotplugged system some cpus, including cpu 0, may be missing so we have
  * to use cpumask_* to iterate over the cpus.
@@ -283,7 +282,7 @@ static int timer_list_show(struct seq_file *m, void *v)
  * It returns 1 for the header position.
  * For cpu 0 it returns 2 and the final possible cpu would be nr_cpu_ids + 1.
  * On the second pass:
- * It returnes nr_cpu_ids + 1 for the second header position.
+ * It returns nr_cpu_ids + 1 for the second header position.
  * For cpu 0 it returns nr_cpu_ids + 2
  * The final possible cpu would be nr_cpu_ids + nr_cpu_ids + 2.
  */
@@ -300,8 +299,12 @@ static void *timer_list_start(struct seq_file *file, loff_t *offset)
 			n = cpumask_next(n - 1, cpu_online_mask);
 		else
 			n = cpumask_first(cpu_online_mask);
-		*offset = n + 1;
-		return (void *)(unsigned long)(n + 2);
+		if (n < nr_cpu_ids) {
+			*offset = n + 1;
+			return (void *)(unsigned long)(n + 2);
+		} else {
+			*offset = n = nr_cpu_ids + 1;
+		}
 	}
 
 #ifdef CONFIG_GENERIC_CLOCKEVENTS
@@ -314,8 +317,10 @@ static void *timer_list_start(struct seq_file *file, loff_t *offset)
 			n = cpumask_next(n - 1, cpu_online_mask);
 		else
 			n = cpumask_first(cpu_online_mask);
-		*offset = n + 2 + nr_cpu_ids;
-		return (void *)(unsigned long)(n + 3 + nr_cpu_ids);
+		if (n < nr_cpu_ids) {
+			*offset = n + 2 + nr_cpu_ids;
+			return (void *)(unsigned long)(n + 3 + nr_cpu_ids);
+		}
 	}
 #endif
 

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


  parent reply	other threads:[~2013-02-21  9:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20  1:21 mmotm 2013-02-19-17-20 uploaded akpm
2013-02-20 16:41 ` since-3.8 branch opened for mm git tree (was: mmotm 2013-02-19-17-20 uploaded) Michal Hocko
2013-02-21  9:25 ` Stephen Boyd [this message]
2013-02-21 18:18   ` mmotm 2013-02-19-17-20 uploaded Nathan Zimmer
2013-02-21 18:27     ` Stephen Boyd
2013-02-21 18:35       ` Nathan Zimmer
2013-02-21 19:31         ` Stephen Boyd
2013-02-26 23:33           ` [PATCH v3 0/2] timer_list: Fix /proc/timer_list failure on 4096 cpus Nathan Zimmer
2013-02-26 23:33             ` [PATCH v3 1/2] timer_list: split timer_list_show_tickdevices() Nathan Zimmer
2013-02-27 19:37               ` Stephen Boyd
2013-02-27 19:56                 ` Nathan Zimmer
2013-02-28  1:05                 ` Nathan Zimmer
2013-02-26 23:33             ` [PATCH v3 2/2] timer_list: convert timer list to be a proper seq_file 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=5125E809.4060407@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=nzimmer@sgi.com \
    /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).