public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@fifo99.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: npiggin@suse.de, riel@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [16/21] HWPOISON: The high level memory error handler in the VM v7
Date: Fri, 11 Sep 2009 13:58:04 -0700	[thread overview]
Message-ID: <1252702684.28368.21.camel@desktop> (raw)
In-Reply-To: <20090911193346.GE32562@basil.fritz.box>

On Fri, 2009-09-11 at 21:33 +0200, Andi Kleen wrote:
> > The rest of your patches are totally clean, except this one .. It has
> > some warning, but one error in the second ifdef block above ..
> 
> That's intentional, fixing it would require a bare , on a single line
> which would be far uglier what is there today. I refuse to make code
> ugly just to work around checkpatch.pl


Like the following is clean, and I don't see why it would work. Although
I only compile tested it.

--

Order the seq_printfs so they can more easily (and cleanly) be added
to and ifdef'ed.

Cc: npiggin@suse.de
Cc: riel@redhat.com
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Signed-off-by: Daniel Walker <dwalker@fifo99.com>
---
 fs/proc/meminfo.c |   83 +++++++++++++++++++++++++---------------------------
 1 files changed, 40 insertions(+), 43 deletions(-)

diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 78faedc..8309f1a 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -65,41 +65,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 		"Active(file):   %8lu kB\n"
 		"Inactive(file): %8lu kB\n"
 		"Unevictable:    %8lu kB\n"
-		"Mlocked:        %8lu kB\n"
-#ifdef CONFIG_HIGHMEM
-		"HighTotal:      %8lu kB\n"
-		"HighFree:       %8lu kB\n"
-		"LowTotal:       %8lu kB\n"
-		"LowFree:        %8lu kB\n"
-#endif
-#ifndef CONFIG_MMU
-		"MmapCopy:       %8lu kB\n"
-#endif
-		"SwapTotal:      %8lu kB\n"
-		"SwapFree:       %8lu kB\n"
-		"Dirty:          %8lu kB\n"
-		"Writeback:      %8lu kB\n"
-		"AnonPages:      %8lu kB\n"
-		"Mapped:         %8lu kB\n"
-		"Slab:           %8lu kB\n"
-		"SReclaimable:   %8lu kB\n"
-		"SUnreclaim:     %8lu kB\n"
-		"PageTables:     %8lu kB\n"
-#ifdef CONFIG_QUICKLIST
-		"Quicklists:     %8lu kB\n"
-#endif
-		"NFS_Unstable:   %8lu kB\n"
-		"Bounce:         %8lu kB\n"
-		"WritebackTmp:   %8lu kB\n"
-		"CommitLimit:    %8lu kB\n"
-		"Committed_AS:   %8lu kB\n"
-		"VmallocTotal:   %8lu kB\n"
-		"VmallocUsed:    %8lu kB\n"
-		"VmallocChunk:   %8lu kB\n"
-#ifdef CONFIG_MEMORY_FAILURE
-		"HardwareCorrupted: %8lu kB\n"
-#endif
-		,
+		"Mlocked:        %8lu kB\n",
 		K(i.totalram),
 		K(i.freeram),
 		K(i.bufferram),
@@ -112,16 +78,35 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 		K(pages[LRU_ACTIVE_FILE]),
 		K(pages[LRU_INACTIVE_FILE]),
 		K(pages[LRU_UNEVICTABLE]),
-		K(global_page_state(NR_MLOCK)),
+		K(global_page_state(NR_MLOCK)));
+
 #ifdef CONFIG_HIGHMEM
+	seq_printf(m,
+		"HighTotal:      %8lu kB\n"
+		"HighFree:       %8lu kB\n"
+		"LowTotal:       %8lu kB\n"
+		"LowFree:        %8lu kB\n",
 		K(i.totalhigh),
 		K(i.freehigh),
 		K(i.totalram-i.totalhigh),
-		K(i.freeram-i.freehigh),
+		K(i.freeram-i.freehigh));
 #endif
 #ifndef CONFIG_MMU
-		K((unsigned long) atomic_long_read(&mmap_pages_allocated)),
+	seq_printf(m,
+		"MmapCopy:       %8lu kB\n",
+		K((unsigned long) atomic_long_read(&mmap_pages_allocated)));
 #endif
+	seq_printf(m,
+		"SwapTotal:      %8lu kB\n"
+		"SwapFree:       %8lu kB\n"
+		"Dirty:          %8lu kB\n"
+		"Writeback:      %8lu kB\n"
+		"AnonPages:      %8lu kB\n"
+		"Mapped:         %8lu kB\n"
+		"Slab:           %8lu kB\n"
+		"SReclaimable:   %8lu kB\n"
+		"SUnreclaim:     %8lu kB\n"
+		"PageTables:     %8lu kB\n",
 		K(i.totalswap),
 		K(i.freeswap),
 		K(global_page_state(NR_FILE_DIRTY)),
@@ -132,10 +117,21 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 				global_page_state(NR_SLAB_UNRECLAIMABLE)),
 		K(global_page_state(NR_SLAB_RECLAIMABLE)),
 		K(global_page_state(NR_SLAB_UNRECLAIMABLE)),
-		K(global_page_state(NR_PAGETABLE)),
+		K(global_page_state(NR_PAGETABLE)));
 #ifdef CONFIG_QUICKLIST
-		K(quicklist_total_size()),
+	seq_printf(m,
+		"Quicklists:     %8lu kB\n"
+		K(quicklist_total_size()));
 #endif
+	seq_printf(m,
+		"NFS_Unstable:   %8lu kB\n"
+		"Bounce:         %8lu kB\n"
+		"WritebackTmp:   %8lu kB\n"
+		"CommitLimit:    %8lu kB\n"
+		"Committed_AS:   %8lu kB\n"
+		"VmallocTotal:   %8lu kB\n"
+		"VmallocUsed:    %8lu kB\n"
+		"VmallocChunk:   %8lu kB\n",
 		K(global_page_state(NR_UNSTABLE_NFS)),
 		K(global_page_state(NR_BOUNCE)),
 		K(global_page_state(NR_WRITEBACK_TEMP)),
@@ -143,11 +139,12 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 		K(committed),
 		(unsigned long)VMALLOC_TOTAL >> 10,
 		vmi.used >> 10,
-		vmi.largest_chunk >> 10
+		vmi.largest_chunk >> 10);
 #ifdef CONFIG_MEMORY_FAILURE
-		,atomic_long_read(&mce_bad_pages) << (PAGE_SHIFT - 10)
+	seq_printf(m,
+		"HardwareCorrupted: %8lu kB\n",
+		atomic_long_read(&mce_bad_pages) << (PAGE_SHIFT - 10));
 #endif
-		);
 
 	hugetlb_report_meminfo(m);
 
-- 
1.5.6.3




  parent reply	other threads:[~2009-09-11 20:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 18:48 [PATCH] [0/21] HWPOISON: Intro Andi Kleen
2009-09-11 18:48 ` [PATCH] [1/21] HWPOISON: Add page flag for poisoned pages Andi Kleen
2009-09-11 18:48 ` [PATCH] [2/21] HWPOISON: Export some rmap vma locking to outside world Andi Kleen
2009-09-11 18:48 ` [PATCH] [3/21] HWPOISON: Add support for poison swap entries v2 Andi Kleen
2009-09-11 18:48 ` [PATCH] [4/21] HWPOISON: Add new SIGBUS error codes for hardware poison signals Andi Kleen
2009-09-11 18:48 ` [PATCH] [5/21] HWPOISON: Add basic support for poisoned pages in fault handler v3 Andi Kleen
2009-09-11 18:48 ` [PATCH] [6/21] HWPOISON: Add various poison checks in mm/memory.c v2 Andi Kleen
2009-09-11 18:48 ` [PATCH] [7/21] HWPOISON: x86: Add VM_FAULT_HWPOISON handling to x86 page fault handler v2 Andi Kleen
2009-09-11 18:48 ` [PATCH] [8/21] HWPOISON: Use bitmask/action code for try_to_unmap behaviour Andi Kleen
2009-09-11 18:48 ` [PATCH] [9/21] HWPOISON: Handle hardware poisoned pages in try_to_unmap Andi Kleen
2009-09-11 18:48 ` [PATCH] [10/21] HWPOISON: check and isolate corrupted free pages v2 Andi Kleen
2009-09-11 18:48 ` [PATCH] [11/21] HWPOISON: Refactor truncate to allow direct truncating of page v2 Andi Kleen
2009-09-11 18:48 ` [PATCH] [12/21] HWPOISON: Add invalidate_inode_page Andi Kleen
2009-09-11 18:48 ` [PATCH] [13/21] HWPOISON: Define a new error_remove_page address space op for async truncation Andi Kleen
2009-09-11 18:48 ` [PATCH] [14/21] HWPOISON: shmem: call set_page_dirty() with locked page Andi Kleen
2009-09-11 20:24   ` Peter Zijlstra
2009-09-11 21:56     ` Andi Kleen
2009-09-11 18:48 ` [PATCH] [15/21] HWPOISON: Add PR_MCE_KILL prctl to control early kill behaviour per process Andi Kleen
2009-09-11 18:48 ` [PATCH] [16/21] HWPOISON: The high level memory error handler in the VM v7 Andi Kleen
2009-09-11 19:25   ` Daniel Walker
2009-09-11 19:33     ` Andi Kleen
2009-09-11 19:38       ` Daniel Walker
2009-09-11 20:58       ` Daniel Walker [this message]
2009-09-11 21:57         ` Andi Kleen
2009-09-11 22:01           ` Daniel Walker
2009-09-11 18:48 ` [PATCH] [17/21] HWPOISON: Enable .remove_error_page for migration aware file systems Andi Kleen
2009-09-11 18:48 ` [PATCH] [18/21] HWPOISON: Enable error_remove_page for NFS Andi Kleen
2009-09-11 18:48 ` [PATCH] [19/21] HWPOISON: Add madvise() based injector for hardware poisoned pages v4 Andi Kleen
2009-09-11 18:48 ` [PATCH] [20/21] HWPOISON: Add simple debugfs interface to inject hwpoison on arbitary PFNs Andi Kleen
2009-09-11 18:48 ` [PATCH] [21/21] HWPOISON: Enable error_remove_page on btrfs Andi Kleen

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=1252702684.28368.21.camel@desktop \
    --to=dwalker@fifo99.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    --cc=riel@redhat.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