* [RFC 00/21] Generic show_mem()
@ 2008-04-02 20:40 Johannes Weiner
2008-04-02 20:40 ` [RFC 01/22] Generic show_mem() implementation Johannes Weiner
` (22 more replies)
0 siblings, 23 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Hi.
Every arch implements its own show_mem() function. Most of them share
quite some code, some of them are completely identical.
This proposal implements a generic version of this functions and
migrates almost all architectures to use it.
I have only tested the x86_32 related part in lack of other archs.
As far as I understood the code, the generic version should work for
the architectures that used to iterate mem_map pfns, but I can not
tell for sure. Please give feedback.
Also, this series leaves ia64, arm, and sparc as is.
Tony, as far as I understand, ia64 jumps holes in the memory map with
vmemmap_find_next_valid_pfn(). Any idea if and how this could be
built into the generic show_mem() version?
Russell, I don't know if arm can be transformed. For now, it keeps
its arch-specific show_mem().
Dave, can sparc's version be simply migrated as well?
Hannes
arch/alpha/mm/init.c | 30 ------------------
arch/alpha/mm/numa.c | 35 ----------------------
arch/arm/mm/Kconfig | 3 ++
arch/avr32/mm/init.c | 39 ------------------------
arch/blackfin/mm/init.c | 27 -----------------
arch/cris/mm/init.c | 31 -------------------
arch/frv/mm/init.c | 31 -------------------
arch/h8300/mm/init.c | 28 -----------------
arch/ia64/Kconfig | 3 ++
arch/m32r/mm/init.c | 37 -----------------------
arch/m68k/mm/init.c | 31 -------------------
arch/m68knommu/mm/init.c | 28 -----------------
arch/mips/mm/Makefile | 3 +-
arch/mips/mm/pgtable.c | 37 -----------------------
arch/mn10300/mm/pgtable.c | 27 -----------------
arch/parisc/mm/init.c | 72 ---------------------------------------------
arch/powerpc/mm/mem.c | 40 -------------------------
arch/ppc/mm/init.c | 31 -------------------
arch/s390/mm/init.c | 36 ----------------------
arch/sh/mm/init.c | 41 -------------------------
arch/sparc/Kconfig | 3 ++
arch/sparc64/mm/init.c | 45 ----------------------------
arch/um/kernel/mem.c | 31 -------------------
arch/v850/kernel/setup.c | 30 ------------------
arch/x86/mm/init_64.c | 40 -------------------------
arch/x86/mm/pgtable_32.c | 48 ------------------------------
arch/xtensa/mm/init.c | 27 -----------------
mm/page_alloc.c | 53 +++++++++++++++++++++++++++++++++
28 files changed, 63 insertions(+), 824 deletions(-)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 01/22] Generic show_mem() implementation
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-03 7:55 ` Heiko Carstens
2008-04-03 12:18 ` Ralf Baechle
2008-04-02 20:40 ` [RFC 02/22] x86: Use generic show_mem() Johannes Weiner
` (21 subsequent siblings)
22 siblings, 2 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 729cdbd..efffa92 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -598,6 +598,9 @@ config ALPHA_LARGE_VMALLOC
Say N unless you know you need gobs and gobs of vmalloc space.
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
config VERBOSE_MCHECK
bool "Verbose Machine Checks"
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 76348f0..acad217 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -673,3 +673,6 @@ config OUTER_CACHE
config CACHE_L2X0
bool
select OUTER_CACHE
+
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index c75d708..81e3360 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -146,6 +146,9 @@ source "kernel/Kconfig.preempt"
config HAVE_ARCH_BOOTMEM_NODE
def_bool n
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
config ARCH_HAVE_MEMORY_PRESENT
def_bool n
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 589c6ac..a8cc977 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -526,6 +526,9 @@ config BFIN_SCRATCH_REG_CYCLES
endchoice
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
endmenu
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 9389d38..217c658 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -108,6 +108,9 @@ config OOM_REBOOT
source "kernel/Kconfig.preempt"
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source mm/Kconfig
endmenu
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index a5aac1b..c1a5aac 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -107,6 +107,9 @@ config HIGHPTE
with a lot of RAM, this can be wasteful of precious low memory.
Setting this option will put user-space page tables in high memory.
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
choice
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 085dc6e..70e63fc 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -22,6 +22,9 @@ config ZONE_DMA
bool
default y
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
config FPU
bool
default n
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 8fa3faf..b178caa 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -431,6 +431,9 @@ config HAVE_ARCH_NODEDATA_EXTENSION
def_bool y
depends on NUMA
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
config IA32_SUPPORT
bool "Support for Linux/x86 binaries"
help
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index de153de..2f51d8f 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -225,6 +225,9 @@ config ARCH_DISCONTIGMEM_ENABLE
depends on CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104
default y
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
config IRAM_START
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 65db226..53b36a8 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -396,6 +396,9 @@ config NODES_SHIFT
default "3"
depends on !SINGLE_MEMORY_CHUNK
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
endmenu
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 07eb4c4..7e921a3 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -671,6 +671,9 @@ config ROMKERNEL
endchoice
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
endmenu
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8724ed3..7c5a3c2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1736,6 +1736,9 @@ config NODES_SHIFT
default "6"
depends on NEED_MULTIPLE_NODES
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
config SMP
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index 6a6409a..a20b8f6 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -353,6 +353,9 @@ config MN10300_TTYSM2_CTS
endmenu
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
menu "Power management options"
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index bc7a19d..9ec4fcd 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -240,6 +240,9 @@ config NODES_SHIFT
default "3"
depends on NEED_MULTIPLE_NODES
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "kernel/Kconfig.preempt"
source "kernel/Kconfig.hz"
source "mm/Kconfig"
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 1189d8d..8950e0c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -350,6 +350,9 @@ config ARCH_SPARSEMEM_DEFAULT
config ARCH_POPULATES_NODE_MAP
def_bool y
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
config ARCH_MEMORY_PROBE
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index abc877f..db5e6a1 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -924,6 +924,9 @@ config HIGHMEM
config ARCH_POPULATES_NODE_MAP
def_bool y
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source kernel/Kconfig.hz
source kernel/Kconfig.preempt
source "mm/Kconfig"
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 1831833..6fb2b79 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -282,6 +282,9 @@ config WARN_STACK_SIZE
config ARCH_POPULATES_NODE_MAP
def_bool y
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
comment "Kernel preemption"
source "kernel/Kconfig.preempt"
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index 5fd2184..b74c4e7 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -138,6 +138,9 @@ config ARCH_MEMORY_PROBE
def_bool y
depends on MEMORY_HOTPLUG
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
choice
prompt "Kernel page size"
default PAGE_SIZE_8KB if X2TLB
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c40343c..8fc06c3 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -266,6 +266,9 @@ config SUNOS_EMUL
want to run SunOS binaries on an Ultra you must also say Y to
"Kernel support for 32-bit a.out binaries" above.
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
endmenu
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 463d1be..d74b027 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -267,6 +267,9 @@ config ARCH_SPARSEMEM_ENABLE
config ARCH_SPARSEMEM_DEFAULT
def_bool y
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
config ISA
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index dba8e05..f3b75af 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -86,6 +86,10 @@ config STATIC_LINK
2.75G) for UML.
source "arch/um/Kconfig.arch"
+
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
source "kernel/time/Kconfig"
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
index 4379f43..a4d8e72 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -56,6 +56,9 @@ config ARCH_HAS_ILOG2_U64
config ARCH_SUPPORTS_AOUT
def_bool y
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
# Turn off some random 386 crap that can affect device config
config ISA
bool
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6c70fed..47bb585 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -939,6 +939,9 @@ config ARCH_MEMORY_PROBE
def_bool X86_64
depends on MEMORY_HOTPLUG
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
config HIGHPTE
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 9fc8551..0e3b68c 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -163,6 +163,9 @@ config XTENSA_ISS_NETWORK
depends on XTENSA_PLATFORM_ISS
default y
+config HAVE_ARCH_SHOW_MEM
+ def_bool y
+
source "mm/Kconfig"
endmenu
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 402a504..0eef95f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -45,6 +45,7 @@
#include <linux/fault-inject.h>
#include <linux/page-isolation.h>
#include <linux/memcontrol.h>
+#include <linux/nmi.h>
#include <asm/tlbflush.h>
#include <asm/div64.h>
@@ -1889,6 +1890,58 @@ void show_free_areas(void)
show_swap_cache_info();
}
+#ifndef CONFIG_HAVE_ARCH_SHOW_MEM
+void show_mem(void)
+{
+ pg_data_t *pgdat;
+ int total = 0, reserved = 0, shared = 0, highmem = 0, swapcache = 0;
+
+ printk(KERN_INFO "Mem-Info:\n");
+ show_free_areas();
+
+ for_each_online_pgdat(pgdat) {
+ unsigned long i, flags;
+
+ pgdat_resize_lock(pgdat, &flags);
+ for (i = 0; i < pgdat->node_spanned_pages; i++) {
+ struct page *page;
+ unsigned long pfn = pgdat->node_start_pfn + i;
+
+ if (unlikely((i % MAX_ORDER_NR_PAGES) == 0))
+ touch_nmi_watchdog();
+
+ if (!pfn_valid(pfn))
+ continue;
+
+ page = pfn_to_page(pfn);
+
+ if (PageHighMem(page))
+ highmem++;
+
+ if (PageReserved(page))
+ reserved++;
+ else if (PageSwapCache(page))
+ swapcache++;
+ else if (page_count(page) > 1)
+ shared += page_count(page) - 1;
+
+ total++;
+ }
+ pgdat_resize_unlock(pgdat, &flags);
+ }
+
+ printk(KERN_INFO "%d pages RAM\n", total);
+#ifdef CONFIG_HIGHMEM
+ printk(KERN_INFO "%d pages HighMem\n", highmem);
+#endif
+ printk(KERN_INFO "%d pages reserved\n", reserved);
+ printk(KERN_INFO "%d pages shared\n", shared);
+#ifdef CONFIG_SWAP
+ printk(KERN_INFO "%d pages swapcache\n", swapcache);
+#endif
+}
+#endif /* !CONFIG_HAVE_ARCH_SHOW_MEM */
+
/*
* Builds allocation fallback zone lists.
*
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 02/22] x86: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
2008-04-02 20:40 ` [RFC 01/22] Generic show_mem() implementation Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-04 8:17 ` Ingo Molnar
2008-04-02 20:40 ` [RFC 03/22] sparc64: " Johannes Weiner
` (20 subsequent siblings)
22 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 47bb585..6c70fed 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -939,9 +939,6 @@ config ARCH_MEMORY_PROBE
def_bool X86_64
depends on MEMORY_HOTPLUG
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
config HIGHPTE
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index a02a14f..82f3b6d 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -60,46 +60,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
* around without checking the pgd every time.
*/
-void show_mem(void)
-{
- long i, total = 0, reserved = 0;
- long shared = 0, cached = 0;
- struct page *page;
- pg_data_t *pgdat;
-
- printk(KERN_INFO "Mem-info:\n");
- show_free_areas();
- printk(KERN_INFO "Free swap: %6ldkB\n",
- nr_swap_pages << (PAGE_SHIFT-10));
-
- for_each_online_pgdat(pgdat) {
- for (i = 0; i < pgdat->node_spanned_pages; ++i) {
- /*
- * This loop can take a while with 256 GB and
- * 4k pages so defer the NMI watchdog:
- */
- if (unlikely(i % MAX_ORDER_NR_PAGES == 0))
- touch_nmi_watchdog();
-
- if (!pfn_valid(pgdat->node_start_pfn + i))
- continue;
-
- page = pfn_to_page(pgdat->node_start_pfn + i);
- total++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (page_count(page))
- shared += page_count(page) - 1;
- }
- }
- printk(KERN_INFO "%lu pages of RAM\n", total);
- printk(KERN_INFO "%lu reserved pages\n", reserved);
- printk(KERN_INFO "%lu pages shared\n", shared);
- printk(KERN_INFO "%lu pages swap cached\n", cached);
-}
-
int after_bootmem;
static __init void *spp_getpage(void)
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
index 2f9e9af..ead7015 100644
--- a/arch/x86/mm/pgtable_32.c
+++ b/arch/x86/mm/pgtable_32.c
@@ -24,54 +24,6 @@
#include <asm/tlb.h>
#include <asm/tlbflush.h>
-void show_mem(void)
-{
- int total = 0, reserved = 0;
- int shared = 0, cached = 0;
- int highmem = 0;
- struct page *page;
- pg_data_t *pgdat;
- unsigned long i;
- unsigned long flags;
-
- printk(KERN_INFO "Mem-info:\n");
- show_free_areas();
- printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- for_each_online_pgdat(pgdat) {
- pgdat_resize_lock(pgdat, &flags);
- for (i = 0; i < pgdat->node_spanned_pages; ++i) {
- if (unlikely(i % MAX_ORDER_NR_PAGES == 0))
- touch_nmi_watchdog();
- page = pgdat_page_nr(pgdat, i);
- total++;
- if (PageHighMem(page))
- highmem++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (page_count(page))
- shared += page_count(page) - 1;
- }
- pgdat_resize_unlock(pgdat, &flags);
- }
- printk(KERN_INFO "%d pages of RAM\n", total);
- printk(KERN_INFO "%d pages of HIGHMEM\n", highmem);
- printk(KERN_INFO "%d reserved pages\n", reserved);
- printk(KERN_INFO "%d pages shared\n", shared);
- printk(KERN_INFO "%d pages swap cached\n", cached);
-
- printk(KERN_INFO "%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
- printk(KERN_INFO "%lu pages writeback\n",
- global_page_state(NR_WRITEBACK));
- printk(KERN_INFO "%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
- printk(KERN_INFO "%lu pages slab\n",
- global_page_state(NR_SLAB_RECLAIMABLE) +
- global_page_state(NR_SLAB_UNRECLAIMABLE));
- printk(KERN_INFO "%lu pages pagetables\n",
- global_page_state(NR_PAGETABLE));
-}
-
/*
* Associate a virtual page frame with a given physical page frame
* and protection flags for that frame.
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 03/22] sparc64: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
2008-04-02 20:40 ` [RFC 01/22] Generic show_mem() implementation Johannes Weiner
2008-04-02 20:40 ` [RFC 02/22] x86: Use generic show_mem() Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 04/22] avr32: " Johannes Weiner
` (19 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index d74b027..463d1be 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -267,9 +267,6 @@ config ARCH_SPARSEMEM_ENABLE
config ARCH_SPARSEMEM_DEFAULT
def_bool y
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
config ISA
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index f37078d..f6a86a2 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -391,51 +391,6 @@ void __kprobes flush_icache_range(unsigned long start, unsigned long end)
}
}
-void show_mem(void)
-{
- unsigned long total = 0, reserved = 0;
- unsigned long shared = 0, cached = 0;
- pg_data_t *pgdat;
-
- printk(KERN_INFO "Mem-info:\n");
- show_free_areas();
- printk(KERN_INFO "Free swap: %6ldkB\n",
- nr_swap_pages << (PAGE_SHIFT-10));
- for_each_online_pgdat(pgdat) {
- unsigned long i, flags;
-
- pgdat_resize_lock(pgdat, &flags);
- for (i = 0; i < pgdat->node_spanned_pages; i++) {
- struct page *page = pgdat_page_nr(pgdat, i);
- total++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (page_count(page))
- shared += page_count(page) - 1;
- }
- pgdat_resize_unlock(pgdat, &flags);
- }
-
- printk(KERN_INFO "%lu pages of RAM\n", total);
- printk(KERN_INFO "%lu reserved pages\n", reserved);
- printk(KERN_INFO "%lu pages shared\n", shared);
- printk(KERN_INFO "%lu pages swap cached\n", cached);
-
- printk(KERN_INFO "%lu pages dirty\n",
- global_page_state(NR_FILE_DIRTY));
- printk(KERN_INFO "%lu pages writeback\n",
- global_page_state(NR_WRITEBACK));
- printk(KERN_INFO "%lu pages mapped\n",
- global_page_state(NR_FILE_MAPPED));
- printk(KERN_INFO "%lu pages slab\n",
- global_page_state(NR_SLAB_RECLAIMABLE) +
- global_page_state(NR_SLAB_UNRECLAIMABLE));
- printk(KERN_INFO "%lu pages pagetables\n",
- global_page_state(NR_PAGETABLE));
-}
-
void mmu_info(struct seq_file *m)
{
if (tlb_type == cheetah)
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 04/22] avr32: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (2 preceding siblings ...)
2008-04-02 20:40 ` [RFC 03/22] sparc64: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 05/22] blackfin: " Johannes Weiner
` (18 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 81e3360..c75d708 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -146,9 +146,6 @@ source "kernel/Kconfig.preempt"
config HAVE_ARCH_BOOTMEM_NODE
def_bool n
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
config ARCH_HAVE_MEMORY_PRESENT
def_bool n
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c
index 480760b..3cbff55 100644
--- a/arch/avr32/mm/init.c
+++ b/arch/avr32/mm/init.c
@@ -37,45 +37,6 @@ unsigned long mmu_context_cache = NO_CONTEXT;
#define START_PFN (NODE_DATA(0)->bdata->node_boot_start >> PAGE_SHIFT)
#define MAX_LOW_PFN (NODE_DATA(0)->bdata->node_low_pfn)
-void show_mem(void)
-{
- int total = 0, reserved = 0, cached = 0;
- int slab = 0, free = 0, shared = 0;
- pg_data_t *pgdat;
-
- printk("Mem-info:\n");
- show_free_areas();
-
- for_each_online_pgdat(pgdat) {
- struct page *page, *end;
-
- page = pgdat->node_mem_map;
- end = page + pgdat->node_spanned_pages;
-
- do {
- total++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (PageSlab(page))
- slab++;
- else if (!page_count(page))
- free++;
- else
- shared += page_count(page) - 1;
- page++;
- } while (page < end);
- }
-
- printk ("%d pages of RAM\n", total);
- printk ("%d free pages\n", free);
- printk ("%d reserved pages\n", reserved);
- printk ("%d slab pages\n", slab);
- printk ("%d pages shared\n", shared);
- printk ("%d pages swap cached\n", cached);
-}
-
/*
* paging_init() sets up the page tables
*
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 05/22] blackfin: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (3 preceding siblings ...)
2008-04-02 20:40 ` [RFC 04/22] avr32: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 06/22] cris: " Johannes Weiner
` (17 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index a8cc977..589c6ac 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -526,9 +526,6 @@ config BFIN_SCRATCH_REG_CYCLES
endchoice
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
endmenu
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index ec3141f..4d5326e 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -53,33 +53,6 @@ static unsigned long empty_bad_page;
unsigned long empty_zero_page;
-void show_mem(void)
-{
- unsigned long i;
- int free = 0, total = 0, reserved = 0, shared = 0;
-
- int cached = 0;
- printk(KERN_INFO "Mem-info:\n");
- show_free_areas();
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map + i))
- reserved++;
- else if (PageSwapCache(mem_map + i))
- cached++;
- else if (!page_count(mem_map + i))
- free++;
- else
- shared += page_count(mem_map + i) - 1;
- }
- printk(KERN_INFO "%d pages of RAM\n", total);
- printk(KERN_INFO "%d free pages\n", free);
- printk(KERN_INFO "%d reserved pages\n", reserved);
- printk(KERN_INFO "%d pages shared\n", shared);
- printk(KERN_INFO "%d pages swap cached\n", cached);
-}
-
/*
* paging_init() continues the virtual memory environment setup which
* was begun by the code in arch/head.S.
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 06/22] cris: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (4 preceding siblings ...)
2008-04-02 20:40 ` [RFC 05/22] blackfin: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 07/22] frv: " Johannes Weiner
` (16 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 217c658..9389d38 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -108,9 +108,6 @@ config OOM_REBOOT
source "kernel/Kconfig.preempt"
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source mm/Kconfig
endmenu
diff --git a/arch/cris/mm/init.c b/arch/cris/mm/init.c
index 4207a2b..2fdd212 100644
--- a/arch/cris/mm/init.c
+++ b/arch/cris/mm/init.c
@@ -19,37 +19,6 @@ unsigned long empty_zero_page;
extern char _stext, _edata, _etext; /* From linkerscript */
extern char __init_begin, __init_end;
-void
-show_mem(void)
-{
- int i,free = 0,total = 0,cached = 0, reserved = 0, nonshared = 0;
- int shared = 0;
-
- printk("\nMem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map+i))
- reserved++;
- else if (PageSwapCache(mem_map+i))
- cached++;
- else if (!page_count(mem_map+i))
- free++;
- else if (page_count(mem_map+i) == 1)
- nonshared++;
- else
- shared += page_count(mem_map+i) - 1;
- }
- printk("%d pages of RAM\n",total);
- printk("%d free pages\n",free);
- printk("%d reserved pages\n",reserved);
- printk("%d pages nonshared\n",nonshared);
- printk("%d pages shared\n",shared);
- printk("%d pages swap cached\n",cached);
-}
-
void __init
mem_init(void)
{
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 07/22] frv: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (5 preceding siblings ...)
2008-04-02 20:40 ` [RFC 06/22] cris: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 08/22] h8300: " Johannes Weiner
` (15 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index c1a5aac..a5aac1b 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -107,9 +107,6 @@ config HIGHPTE
with a lot of RAM, this can be wasteful of precious low memory.
Setting this option will put user-space page tables in high memory.
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
choice
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index b841ecf..f7a16d3 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -60,37 +60,6 @@ unsigned long empty_zero_page;
/*****************************************************************************/
/*
- *
- */
-void show_mem(void)
-{
- unsigned long i;
- int free = 0, total = 0, reserved = 0, shared = 0;
-
- printk("\nMem-info:\n");
- show_free_areas();
- i = max_mapnr;
- while (i-- > 0) {
- struct page *page = &mem_map[i];
-
- total++;
- if (PageReserved(page))
- reserved++;
- else if (!page_count(page))
- free++;
- else
- shared += page_count(page) - 1;
- }
-
- printk("%d pages of RAM\n",total);
- printk("%d free pages\n",free);
- printk("%d reserved pages\n",reserved);
- printk("%d pages shared\n",shared);
-
-} /* end show_mem() */
-
-/*****************************************************************************/
-/*
* paging_init() continues the virtual memory environment setup which
* was begun by the code in arch/head.S.
* The parameters are pointers to where to stick the starting and ending
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 08/22] h8300: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (6 preceding siblings ...)
2008-04-02 20:40 ` [RFC 07/22] frv: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 09/22] m32r: " Johannes Weiner
` (14 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 70e63fc..085dc6e 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -22,9 +22,6 @@ config ZONE_DMA
bool
default y
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
config FPU
bool
default n
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index e4f4199..82cc54e 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -64,33 +64,6 @@ unsigned long empty_zero_page;
extern unsigned long rom_length;
-void show_mem(void)
-{
- unsigned long i;
- int free = 0, total = 0, reserved = 0, shared = 0;
- int cached = 0;
-
- printk("\nMem-info:\n");
- show_free_areas();
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map+i))
- reserved++;
- else if (PageSwapCache(mem_map+i))
- cached++;
- else if (!page_count(mem_map+i))
- free++;
- else
- shared += page_count(mem_map+i) - 1;
- }
- printk("%d pages of RAM\n",total);
- printk("%d free pages\n",free);
- printk("%d reserved pages\n",reserved);
- printk("%d pages shared\n",shared);
- printk("%d pages swap cached\n",cached);
-}
-
extern unsigned long memory_start;
extern unsigned long memory_end;
@@ -228,4 +201,3 @@ free_initmem()
(int)(addr - PAGE_SIZE));
#endif
}
-
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 09/22] m32r: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (7 preceding siblings ...)
2008-04-02 20:40 ` [RFC 08/22] h8300: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 10/22] m68k: " Johannes Weiner
` (13 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 2f51d8f..de153de 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -225,9 +225,6 @@ config ARCH_DISCONTIGMEM_ENABLE
depends on CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104
default y
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
config IRAM_START
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index bbd97c8..2a3e8b5 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -36,42 +36,6 @@ pgd_t swapper_pg_dir[1024];
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
-void show_mem(void)
-{
- int total = 0, reserved = 0;
- int shared = 0, cached = 0;
- int highmem = 0;
- struct page *page;
- pg_data_t *pgdat;
- unsigned long i;
-
- printk("Mem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
- for_each_online_pgdat(pgdat) {
- unsigned long flags;
- pgdat_resize_lock(pgdat, &flags);
- for (i = 0; i < pgdat->node_spanned_pages; ++i) {
- page = pgdat_page_nr(pgdat, i);
- total++;
- if (PageHighMem(page))
- highmem++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (page_count(page))
- shared += page_count(page) - 1;
- }
- pgdat_resize_unlock(pgdat, &flags);
- }
- printk("%d pages of RAM\n", total);
- printk("%d pages of HIGHMEM\n",highmem);
- printk("%d reserved pages\n",reserved);
- printk("%d pages shared\n",shared);
- printk("%d pages swap cached\n",cached);
-}
-
/*
* Cache of MMU context last used.
*/
@@ -252,4 +216,3 @@ void free_initrd_mem(unsigned long start, unsigned long end)
printk (KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
}
#endif
-
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 10/22] m68k: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (8 preceding siblings ...)
2008-04-02 20:40 ` [RFC 09/22] m32r: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-03 7:40 ` Geert Uytterhoeven
2008-04-02 20:40 ` [RFC 11/22] m68knommu: " Johannes Weiner
` (12 subsequent siblings)
22 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 53b36a8..65db226 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -396,9 +396,6 @@ config NODES_SHIFT
default "3"
depends on !SINGLE_MEMORY_CHUNK
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
endmenu
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index f42caa7..19eb3ae 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -70,37 +70,6 @@ void __init m68k_setup_node(int node)
void *empty_zero_page;
-void show_mem(void)
-{
- pg_data_t *pgdat;
- int free = 0, total = 0, reserved = 0, shared = 0;
- int cached = 0;
- int i;
-
- printk("\nMem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- for_each_online_pgdat(pgdat) {
- for (i = 0; i < pgdat->node_spanned_pages; i++) {
- struct page *page = pgdat->node_mem_map + i;
- total++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (!page_count(page))
- free++;
- else
- shared += page_count(page) - 1;
- }
- }
- printk("%d pages of RAM\n",total);
- printk("%d free pages\n",free);
- printk("%d reserved pages\n",reserved);
- printk("%d pages shared\n",shared);
- printk("%d pages swap cached\n",cached);
-}
-
extern void init_pointer_table(unsigned long ptable);
/* References to section boundaries */
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 11/22] m68knommu: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (9 preceding siblings ...)
2008-04-02 20:40 ` [RFC 10/22] m68k: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 12/22] mips: " Johannes Weiner
` (11 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 7e921a3..07eb4c4 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -671,9 +671,6 @@ config ROMKERNEL
endchoice
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
endmenu
diff --git a/arch/m68knommu/mm/init.c b/arch/m68knommu/mm/init.c
index 22e2a0d..345a92a 100644
--- a/arch/m68knommu/mm/init.c
+++ b/arch/m68knommu/mm/init.c
@@ -62,33 +62,6 @@ static unsigned long empty_bad_page;
unsigned long empty_zero_page;
-void show_mem(void)
-{
- unsigned long i;
- int free = 0, total = 0, reserved = 0, shared = 0;
- int cached = 0;
-
- printk(KERN_INFO "\nMem-info:\n");
- show_free_areas();
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map+i))
- reserved++;
- else if (PageSwapCache(mem_map+i))
- cached++;
- else if (!page_count(mem_map+i))
- free++;
- else
- shared += page_count(mem_map+i) - 1;
- }
- printk(KERN_INFO "%d pages of RAM\n",total);
- printk(KERN_INFO "%d free pages\n",free);
- printk(KERN_INFO "%d reserved pages\n",reserved);
- printk(KERN_INFO "%d pages shared\n",shared);
- printk(KERN_INFO "%d pages swap cached\n",cached);
-}
-
extern unsigned long memory_start;
extern unsigned long memory_end;
@@ -223,4 +196,3 @@ free_initmem()
(int)(addr - PAGE_SIZE));
#endif
}
-
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 12/22] mips: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (10 preceding siblings ...)
2008-04-02 20:40 ` [RFC 11/22] m68knommu: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-03 11:59 ` Ralf Baechle
2008-04-02 20:40 ` [RFC 13/22] mn10300: " Johannes Weiner
` (10 subsequent siblings)
22 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 7c5a3c2..8724ed3 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1736,9 +1736,6 @@ config NODES_SHIFT
default "6"
depends on NEED_MULTIPLE_NODES
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
config SMP
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile
index c6f832e..4796b35 100644
--- a/arch/mips/mm/Makefile
+++ b/arch/mips/mm/Makefile
@@ -3,8 +3,7 @@
#
obj-y += cache.o dma-default.o extable.o fault.o \
- init.o pgtable.o tlbex.o tlbex-fault.o \
- uasm.o
+ init.o tlbex.o tlbex-fault.o uasm.o
obj-$(CONFIG_32BIT) += ioremap.o pgtable-32.o
obj-$(CONFIG_64BIT) += pgtable-64.o
diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
deleted file mode 100644
index 57df1c3..0000000
--- a/arch/mips/mm/pgtable.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/swap.h>
-
-void show_mem(void)
-{
-#ifndef CONFIG_NEED_MULTIPLE_NODES /* XXX(hch): later.. */
- int pfn, total = 0, reserved = 0;
- int shared = 0, cached = 0;
- int highmem = 0;
- struct page *page;
-
- printk("Mem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- pfn = max_mapnr;
- while (pfn-- > 0) {
- if (!pfn_valid(pfn))
- continue;
- page = pfn_to_page(pfn);
- total++;
- if (PageHighMem(page))
- highmem++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (page_count(page))
- shared += page_count(page) - 1;
- }
- printk("%d pages of RAM\n", total);
- printk("%d pages of HIGHMEM\n", highmem);
- printk("%d reserved pages\n", reserved);
- printk("%d pages shared\n", shared);
- printk("%d pages swap cached\n", cached);
-#endif
-}
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 13/22] mn10300: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (11 preceding siblings ...)
2008-04-02 20:40 ` [RFC 12/22] mips: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 14/22] parisc: " Johannes Weiner
` (9 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index a20b8f6..6a6409a 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -353,9 +353,6 @@ config MN10300_TTYSM2_CTS
endmenu
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
menu "Power management options"
diff --git a/arch/mn10300/mm/pgtable.c b/arch/mn10300/mm/pgtable.c
index a477038..baffc58 100644
--- a/arch/mn10300/mm/pgtable.c
+++ b/arch/mn10300/mm/pgtable.c
@@ -27,33 +27,6 @@
#include <asm/tlb.h>
#include <asm/tlbflush.h>
-void show_mem(void)
-{
- unsigned long i;
- int free = 0, total = 0, reserved = 0, shared = 0;
-
- int cached = 0;
- printk(KERN_INFO "Mem-info:\n");
- show_free_areas();
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map + i))
- reserved++;
- else if (PageSwapCache(mem_map + i))
- cached++;
- else if (!page_count(mem_map + i))
- free++;
- else
- shared += page_count(mem_map + i) - 1;
- }
- printk(KERN_INFO "%d pages of RAM\n", total);
- printk(KERN_INFO "%d free pages\n", free);
- printk(KERN_INFO "%d reserved pages\n", reserved);
- printk(KERN_INFO "%d pages shared\n", shared);
- printk(KERN_INFO "%d pages swap cached\n", cached);
-}
-
/*
* Associate a large virtual page frame with a given physical page frame
* and protection flags for that frame. pfn is for the base of the page,
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 14/22] parisc: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (12 preceding siblings ...)
2008-04-02 20:40 ` [RFC 13/22] mn10300: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 15/22] powerpc: " Johannes Weiner
` (8 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 9ec4fcd..bc7a19d 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -240,9 +240,6 @@ config NODES_SHIFT
default "3"
depends on NEED_MULTIPLE_NODES
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "kernel/Kconfig.preempt"
source "kernel/Kconfig.hz"
source "mm/Kconfig"
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index eb80f5e..e8e9891 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -548,78 +548,6 @@ void __init mem_init(void)
unsigned long *empty_zero_page __read_mostly;
-void show_mem(void)
-{
- int i,free = 0,total = 0,reserved = 0;
- int shared = 0, cached = 0;
-
- printk(KERN_INFO "Mem-info:\n");
- show_free_areas();
- printk(KERN_INFO "Free swap: %6ldkB\n",
- nr_swap_pages<<(PAGE_SHIFT-10));
-#ifndef CONFIG_DISCONTIGMEM
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map+i))
- reserved++;
- else if (PageSwapCache(mem_map+i))
- cached++;
- else if (!page_count(&mem_map[i]))
- free++;
- else
- shared += page_count(&mem_map[i]) - 1;
- }
-#else
- for (i = 0; i < npmem_ranges; i++) {
- int j;
-
- for (j = node_start_pfn(i); j < node_end_pfn(i); j++) {
- struct page *p;
- unsigned long flags;
-
- pgdat_resize_lock(NODE_DATA(i), &flags);
- p = nid_page_nr(i, j) - node_start_pfn(i);
-
- total++;
- if (PageReserved(p))
- reserved++;
- else if (PageSwapCache(p))
- cached++;
- else if (!page_count(p))
- free++;
- else
- shared += page_count(p) - 1;
- pgdat_resize_unlock(NODE_DATA(i), &flags);
- }
- }
-#endif
- printk(KERN_INFO "%d pages of RAM\n", total);
- printk(KERN_INFO "%d reserved pages\n", reserved);
- printk(KERN_INFO "%d pages shared\n", shared);
- printk(KERN_INFO "%d pages swap cached\n", cached);
-
-
-#ifdef CONFIG_DISCONTIGMEM
- {
- struct zonelist *zl;
- int i, j, k;
-
- for (i = 0; i < npmem_ranges; i++) {
- for (j = 0; j < MAX_NR_ZONES; j++) {
- zl = NODE_DATA(i)->node_zonelists + j;
-
- printk("Zone list for zone %d on node %d: ", j, i);
- for (k = 0; zl->zones[k] != NULL; k++)
- printk("[%d/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name);
- printk("\n");
- }
- }
- }
-#endif
-}
-
-
static void __init map_pages(unsigned long start_vaddr, unsigned long start_paddr, unsigned long size, pgprot_t pgprot)
{
pgd_t *pg_dir;
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 15/22] powerpc: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (13 preceding siblings ...)
2008-04-02 20:40 ` [RFC 14/22] parisc: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 16/22] ppc: " Johannes Weiner
` (7 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8950e0c..1189d8d 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -350,9 +350,6 @@ config ARCH_SPARSEMEM_DEFAULT
config ARCH_POPULATES_NODE_MAP
def_bool y
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
config ARCH_MEMORY_PROBE
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index be5c506..fcbae37 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -164,46 +164,6 @@ walk_memory_resource(unsigned long start_pfn, unsigned long nr_pages, void *arg,
#endif /* CONFIG_MEMORY_HOTPLUG */
-void show_mem(void)
-{
- unsigned long total = 0, reserved = 0;
- unsigned long shared = 0, cached = 0;
- unsigned long highmem = 0;
- struct page *page;
- pg_data_t *pgdat;
- unsigned long i;
-
- printk("Mem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- for_each_online_pgdat(pgdat) {
- unsigned long flags;
- pgdat_resize_lock(pgdat, &flags);
- for (i = 0; i < pgdat->node_spanned_pages; i++) {
- if (!pfn_valid(pgdat->node_start_pfn + i))
- continue;
- page = pgdat_page_nr(pgdat, i);
- total++;
- if (PageHighMem(page))
- highmem++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (page_count(page))
- shared += page_count(page) - 1;
- }
- pgdat_resize_unlock(pgdat, &flags);
- }
- printk("%ld pages of RAM\n", total);
-#ifdef CONFIG_HIGHMEM
- printk("%ld pages of HIGHMEM\n", highmem);
-#endif
- printk("%ld reserved pages\n", reserved);
- printk("%ld pages shared\n", shared);
- printk("%ld pages swap cached\n", cached);
-}
-
/*
* Initialize the bootmem system and give it all the memory we
* have available. If we are using highmem, we only put the
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 16/22] ppc: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (14 preceding siblings ...)
2008-04-02 20:40 ` [RFC 15/22] powerpc: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 17/22] s390: " Johannes Weiner
` (6 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index db5e6a1..abc877f 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -924,9 +924,6 @@ config HIGHMEM
config ARCH_POPULATES_NODE_MAP
def_bool y
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source kernel/Kconfig.hz
source kernel/Kconfig.preempt
source "mm/Kconfig"
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index 7444df3..132031a 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -101,37 +101,6 @@ unsigned long __max_memory;
/* max amount of low RAM to map in */
unsigned long __max_low_memory = MAX_LOW_MEM;
-void show_mem(void)
-{
- int i,free = 0,total = 0,reserved = 0;
- int shared = 0, cached = 0;
- int highmem = 0;
-
- printk("Mem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageHighMem(mem_map+i))
- highmem++;
- if (PageReserved(mem_map+i))
- reserved++;
- else if (PageSwapCache(mem_map+i))
- cached++;
- else if (!page_count(mem_map+i))
- free++;
- else
- shared += page_count(mem_map+i) - 1;
- }
- printk("%d pages of RAM\n",total);
- printk("%d pages of HIGHMEM\n", highmem);
- printk("%d free pages\n",free);
- printk("%d reserved pages\n",reserved);
- printk("%d pages shared\n",shared);
- printk("%d pages swap cached\n",cached);
-}
-
/* Free up now-unused memory */
static void free_sec(unsigned long start, unsigned long end, const char *name)
{
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 17/22] s390: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (15 preceding siblings ...)
2008-04-02 20:40 ` [RFC 16/22] ppc: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-03 7:50 ` Heiko Carstens
2008-04-02 20:40 ` [RFC 18/22] sh: " Johannes Weiner
` (5 subsequent siblings)
22 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 6fb2b79..1831833 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -282,9 +282,6 @@ config WARN_STACK_SIZE
config ARCH_POPULATES_NODE_MAP
def_bool y
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
comment "Kernel preemption"
source "kernel/Kconfig.preempt"
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 8053245..27b94cb 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -42,42 +42,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
-void show_mem(void)
-{
- int i, total = 0, reserved = 0;
- int shared = 0, cached = 0;
- struct page *page;
-
- printk("Mem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
- i = max_mapnr;
- while (i-- > 0) {
- if (!pfn_valid(i))
- continue;
- page = pfn_to_page(i);
- total++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (page_count(page))
- shared += page_count(page) - 1;
- }
- printk("%d pages of RAM\n", total);
- printk("%d reserved pages\n", reserved);
- printk("%d pages shared\n", shared);
- printk("%d pages swap cached\n", cached);
-
- printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
- printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
- printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
- printk("%lu pages slab\n",
- global_page_state(NR_SLAB_RECLAIMABLE) +
- global_page_state(NR_SLAB_UNRECLAIMABLE));
- printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));
-}
-
static void __init setup_ro_region(void)
{
pgd_t *pgd;
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 18/22] sh: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (16 preceding siblings ...)
2008-04-02 20:40 ` [RFC 17/22] s390: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-03 11:41 ` Paul Mundt
2008-04-02 20:40 ` [RFC 19/22] um: " Johannes Weiner
` (4 subsequent siblings)
22 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index b74c4e7..5fd2184 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -138,9 +138,6 @@ config ARCH_MEMORY_PROBE
def_bool y
depends on MEMORY_HOTPLUG
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
choice
prompt "Kernel page size"
default PAGE_SIZE_8KB if X2TLB
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 53dde06..ff81bfd 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -25,47 +25,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
pgd_t swapper_pg_dir[PTRS_PER_PGD];
unsigned long cached_to_uncached = 0;
-void show_mem(void)
-{
- int total = 0, reserved = 0, free = 0;
- int shared = 0, cached = 0, slab = 0;
- pg_data_t *pgdat;
-
- printk("Mem-info:\n");
- show_free_areas();
-
- for_each_online_pgdat(pgdat) {
- unsigned long flags, i;
-
- pgdat_resize_lock(pgdat, &flags);
- for (i = 0; i < pgdat->node_spanned_pages; i++) {
- struct page *page = pgdat_page_nr(pgdat, i);
- total++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (PageSlab(page))
- slab++;
- else if (!page_count(page))
- free++;
- else
- shared += page_count(page) - 1;
- }
- pgdat_resize_unlock(pgdat, &flags);
- }
-
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- printk("%d pages of RAM\n", total);
- printk("%d free pages\n", free);
- printk("%d reserved pages\n", reserved);
- printk("%d slab pages\n", slab);
- printk("%d pages shared\n", shared);
- printk("%d pages swap cached\n", cached);
- printk(KERN_INFO "Total of %ld pages in page table cache\n",
- quicklist_total_size());
-}
-
#ifdef CONFIG_MMU
static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
{
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 19/22] um: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (17 preceding siblings ...)
2008-04-02 20:40 ` [RFC 18/22] sh: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-04 14:38 ` Jeff Dike
2008-04-02 20:40 ` [RFC 20/22] v850: " Johannes Weiner
` (3 subsequent siblings)
22 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index f3b75af..dba8e05 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -86,10 +86,6 @@ config STATIC_LINK
2.75G) for UML.
source "arch/um/Kconfig.arch"
-
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
source "kernel/time/Kconfig"
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 2eea1ff..e1c7d20 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -295,37 +295,6 @@ void free_initrd_mem(unsigned long start, unsigned long end)
}
#endif
-void show_mem(void)
-{
- int pfn, total = 0, reserved = 0;
- int shared = 0, cached = 0;
- int high_mem = 0;
- struct page *page;
-
- printk(KERN_INFO "Mem-info:\n");
- show_free_areas();
- printk(KERN_INFO "Free swap: %6ldkB\n",
- nr_swap_pages<<(PAGE_SHIFT-10));
- pfn = max_mapnr;
- while (pfn-- > 0) {
- page = pfn_to_page(pfn);
- total++;
- if (PageHighMem(page))
- high_mem++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (page_count(page))
- shared += page_count(page) - 1;
- }
- printk(KERN_INFO "%d pages of RAM\n", total);
- printk(KERN_INFO "%d pages of HIGHMEM\n", high_mem);
- printk(KERN_INFO "%d reserved pages\n", reserved);
- printk(KERN_INFO "%d pages shared\n", shared);
- printk(KERN_INFO "%d pages swap cached\n", cached);
-}
-
/* Allocate and free page tables. */
pgd_t *pgd_alloc(struct mm_struct *mm)
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 20/22] v850: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (18 preceding siblings ...)
2008-04-02 20:40 ` [RFC 19/22] um: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 21/22] xtensa: " Johannes Weiner
` (2 subsequent siblings)
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
index a4d8e72..4379f43 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -56,9 +56,6 @@ config ARCH_HAS_ILOG2_U64
config ARCH_SUPPORTS_AOUT
def_bool y
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
# Turn off some random 386 crap that can affect device config
config ISA
bool
diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c
index a0a8456..5751709 100644
--- a/arch/v850/kernel/setup.c
+++ b/arch/v850/kernel/setup.c
@@ -298,33 +298,3 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len)
free_area_init_node (0, NODE_DATA(0), zones_size,
ADDR_TO_PAGE (PAGE_OFFSET), 0);
}
-
-\f
-
-/* Taken from m68knommu */
-void show_mem(void)
-{
- unsigned long i;
- int free = 0, total = 0, reserved = 0, shared = 0;
- int cached = 0;
-
- printk(KERN_INFO "\nMem-info:\n");
- show_free_areas();
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map+i))
- reserved++;
- else if (PageSwapCache(mem_map+i))
- cached++;
- else if (!page_count(mem_map+i))
- free++;
- else
- shared += page_count(mem_map+i) - 1;
- }
- printk(KERN_INFO "%d pages of RAM\n",total);
- printk(KERN_INFO "%d free pages\n",free);
- printk(KERN_INFO "%d reserved pages\n",reserved);
- printk(KERN_INFO "%d pages shared\n",shared);
- printk(KERN_INFO "%d pages swap cached\n",cached);
-}
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 21/22] xtensa: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (19 preceding siblings ...)
2008-04-02 20:40 ` [RFC 20/22] v850: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 22/22] alpha: " Johannes Weiner
2008-04-03 23:45 ` [RFC 00/21] Generic show_mem() Johannes Weiner
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 0e3b68c..9fc8551 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -163,9 +163,6 @@ config XTENSA_ISS_NETWORK
depends on XTENSA_PLATFORM_ISS
default y
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
source "mm/Kconfig"
endmenu
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index 81d0560..303fa3e 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -280,33 +280,6 @@ void free_initmem(void)
(&__init_end - &__init_begin) >> 10);
}
-void show_mem(void)
-{
- int i, free = 0, total = 0, reserved = 0;
- int shared = 0, cached = 0;
-
- printk("Mem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map+i))
- reserved++;
- else if (PageSwapCache(mem_map+i))
- cached++;
- else if (!page_count(mem_map + i))
- free++;
- else
- shared += page_count(mem_map + i) - 1;
- }
- printk("%d pages of RAM\n", total);
- printk("%d reserved pages\n", reserved);
- printk("%d pages shared\n", shared);
- printk("%d pages swap cached\n",cached);
- printk("%d free pages\n", free);
-}
-
struct kmem_cache *pgtable_cache __read_mostly;
static void pgd_ctor(struct kmem_cache *cache, void* addr)
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* [RFC 22/22] alpha: Use generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (20 preceding siblings ...)
2008-04-02 20:40 ` [RFC 21/22] xtensa: " Johannes Weiner
@ 2008-04-02 20:40 ` Johannes Weiner
2008-04-03 23:45 ` [RFC 00/21] Generic show_mem() Johannes Weiner
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
ysato, takata, geert, ralf, kyle, paulus, schwidefsky, lethal,
jdike, miles, chris, rmk, tony.luck
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index efffa92..c91629f 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -598,9 +598,6 @@ config ALPHA_LARGE_VMALLOC
Say N unless you know you need gobs and gobs of vmalloc space.
-config HAVE_ARCH_SHOW_MEM
- def_bool y
-
config VERBOSE_MCHECK
bool "Verbose Machine Checks"
@@ -679,4 +676,3 @@ source "security/Kconfig"
source "crypto/Kconfig"
source "lib/Kconfig"
-
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 40c15e7..234e42b 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -94,36 +94,6 @@ __bad_page(void)
return pte_mkdirty(mk_pte(virt_to_page(EMPTY_PGE), PAGE_SHARED));
}
-#ifndef CONFIG_DISCONTIGMEM
-void
-show_mem(void)
-{
- long i,free = 0,total = 0,reserved = 0;
- long shared = 0, cached = 0;
-
- printk("\nMem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map+i))
- reserved++;
- else if (PageSwapCache(mem_map+i))
- cached++;
- else if (!page_count(mem_map+i))
- free++;
- else
- shared += page_count(mem_map + i) - 1;
- }
- printk("%ld pages of RAM\n",total);
- printk("%ld free pages\n",free);
- printk("%ld reserved pages\n",reserved);
- printk("%ld pages shared\n",shared);
- printk("%ld pages swap cached\n",cached);
-}
-#endif
-
static inline unsigned long
load_PCB(struct pcb_struct *pcb)
{
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
index 10ab783..a460645 100644
--- a/arch/alpha/mm/numa.c
+++ b/arch/alpha/mm/numa.c
@@ -359,38 +359,3 @@ void __init mem_init(void)
mem_stress();
#endif
}
-
-void
-show_mem(void)
-{
- long i,free = 0,total = 0,reserved = 0;
- long shared = 0, cached = 0;
- int nid;
-
- printk("\nMem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- for_each_online_node(nid) {
- unsigned long flags;
- pgdat_resize_lock(NODE_DATA(nid), &flags);
- i = node_spanned_pages(nid);
- while (i-- > 0) {
- struct page *page = nid_page_nr(nid, i);
- total++;
- if (PageReserved(page))
- reserved++;
- else if (PageSwapCache(page))
- cached++;
- else if (!page_count(page))
- free++;
- else
- shared += page_count(page) - 1;
- }
- pgdat_resize_unlock(NODE_DATA(nid), &flags);
- }
- printk("%ld pages of RAM\n",total);
- printk("%ld free pages\n",free);
- printk("%ld reserved pages\n",reserved);
- printk("%ld pages shared\n",shared);
- printk("%ld pages swap cached\n",cached);
-}
--
1.5.2.2
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 10/22] m68k: Use generic show_mem()
2008-04-02 20:40 ` [RFC 10/22] m68k: " Johannes Weiner
@ 2008-04-03 7:40 ` Geert Uytterhoeven
2008-04-03 12:58 ` Johannes Weiner
0 siblings, 1 reply; 53+ messages in thread
From: Geert Uytterhoeven @ 2008-04-03 7:40 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
The new version no longer prints
> - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
and
> - printk("%d free pages\n",free);
on m68k.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 17/22] s390: Use generic show_mem()
2008-04-02 20:40 ` [RFC 17/22] s390: " Johannes Weiner
@ 2008-04-03 7:50 ` Heiko Carstens
2008-04-03 13:00 ` Johannes Weiner
0 siblings, 1 reply; 53+ messages in thread
From: Heiko Carstens @ 2008-04-03 7:50 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
> diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
> index 8053245..27b94cb 100644
> --- a/arch/s390/mm/init.c
> +++ b/arch/s390/mm/init.c
> @@ -42,42 +42,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
> char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
>
> - printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
> - printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
> - printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
> - printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
> - printk("%lu pages slab\n",
> - global_page_state(NR_SLAB_RECLAIMABLE) +
> - global_page_state(NR_SLAB_UNRECLAIMABLE));
> - printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));
These are all missing in the generic implementation.
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-02 20:40 ` [RFC 01/22] Generic show_mem() implementation Johannes Weiner
@ 2008-04-03 7:55 ` Heiko Carstens
2008-04-03 12:48 ` Sam Ravnborg
2008-04-03 12:18 ` Ralf Baechle
1 sibling, 1 reply; 53+ messages in thread
From: Heiko Carstens @ 2008-04-03 7:55 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
> diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
> index 729cdbd..efffa92 100644
> --- a/arch/alpha/Kconfig
> +++ b/arch/alpha/Kconfig
> @@ -598,6 +598,9 @@ config ALPHA_LARGE_VMALLOC
>
> Say N unless you know you need gobs and gobs of vmalloc space.
>
> +config HAVE_ARCH_SHOW_MEM
> + def_bool y
> +
> config VERBOSE_MCHECK
> bool "Verbose Machine Checks"
>
> diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> index 76348f0..acad217 100644
> --- a/arch/arm/mm/Kconfig
> +++ b/arch/arm/mm/Kconfig
> @@ -673,3 +673,6 @@ config OUTER_CACHE
> config CACHE_L2X0
> bool
> select OUTER_CACHE
> +
> +config HAVE_ARCH_SHOW_MEM
> + def_bool y
These are all not necessary. Better add some global Kconfig option that
gets selected by an arch if it wants the generic implementation.
e.g. we currently have this in arch/s390/Kconfig:
config S390
def_bool y
select HAVE_OPROFILE
select HAVE_KPROBES
select HAVE_KRETPROBES
just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
specific patches.
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 18/22] sh: Use generic show_mem()
2008-04-02 20:40 ` [RFC 18/22] sh: " Johannes Weiner
@ 2008-04-03 11:41 ` Paul Mundt
2008-04-03 13:08 ` Johannes Weiner
0 siblings, 1 reply; 53+ messages in thread
From: Paul Mundt @ 2008-04-03 11:41 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, ralf, kyle, paulus,
schwidefsky, jdike, miles, chris, rmk, tony.luck
On Wed, Apr 02, 2008 at 10:40:24PM +0200, Johannes Weiner wrote:
> - printk(KERN_INFO "Total of %ld pages in page table cache\n",
> - quicklist_total_size());
> -}
> -
NACK. The quicklists are also absent from the generic implementation.
Doing things generically is nice and all, but please do not go around
removing all of the different implementations and consolidating on the
simplest point of commonality you could come up with. Either combine
everything in to a generic show_mem() that doesn't sacrifice
functionality, or only convert the platforms that are identical.
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 12/22] mips: Use generic show_mem()
2008-04-02 20:40 ` [RFC 12/22] mips: " Johannes Weiner
@ 2008-04-03 11:59 ` Ralf Baechle
0 siblings, 0 replies; 53+ messages in thread
From: Ralf Baechle @ 2008-04-03 11:59 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
On Wed, Apr 02, 2008 at 10:40:18PM +0200, Johannes Weiner wrote:
> Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Ralf
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-02 20:40 ` [RFC 01/22] Generic show_mem() implementation Johannes Weiner
2008-04-03 7:55 ` Heiko Carstens
@ 2008-04-03 12:18 ` Ralf Baechle
1 sibling, 0 replies; 53+ messages in thread
From: Ralf Baechle @ 2008-04-03 12:18 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
On Wed, Apr 02, 2008 at 10:40:07PM +0200, Johannes Weiner wrote:
> Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
And also Acked-By: Ralf Baechle <ralf@linux-mips.org>.
Btw, the MIPS part of your patch is not a plain switch from arch to generic
code as the patch comments seem to imply - the arch version was broken for
some configs ...
Ralf
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-03 7:55 ` Heiko Carstens
@ 2008-04-03 12:48 ` Sam Ravnborg
2008-04-03 13:30 ` Johannes Weiner
2008-04-03 14:49 ` Johannes Weiner
0 siblings, 2 replies; 53+ messages in thread
From: Sam Ravnborg @ 2008-04-03 12:48 UTC (permalink / raw)
To: Heiko Carstens
Cc: Johannes Weiner, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, geert,
ralf, kyle, paulus, schwidefsky, lethal, jdike, miles, chris,
rmk, tony.luck
On Thu, Apr 03, 2008 at 09:55:45AM +0200, Heiko Carstens wrote:
> > diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
> > index 729cdbd..efffa92 100644
> > --- a/arch/alpha/Kconfig
> > +++ b/arch/alpha/Kconfig
> > @@ -598,6 +598,9 @@ config ALPHA_LARGE_VMALLOC
> >
> > Say N unless you know you need gobs and gobs of vmalloc space.
> >
> > +config HAVE_ARCH_SHOW_MEM
> > + def_bool y
> > +
> > config VERBOSE_MCHECK
> > bool "Verbose Machine Checks"
> >
> > diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> > index 76348f0..acad217 100644
> > --- a/arch/arm/mm/Kconfig
> > +++ b/arch/arm/mm/Kconfig
> > @@ -673,3 +673,6 @@ config OUTER_CACHE
> > config CACHE_L2X0
> > bool
> > select OUTER_CACHE
> > +
> > +config HAVE_ARCH_SHOW_MEM
> > + def_bool y
>
> These are all not necessary. Better add some global Kconfig option that
> gets selected by an arch if it wants the generic implementation.
>
> e.g. we currently have this in arch/s390/Kconfig:
>
> config S390
> def_bool y
> select HAVE_OPROFILE
> select HAVE_KPROBES
> select HAVE_KRETPROBES
>
> just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
> specific patches.
Seconded.
See Documentation/kbuild/kconfig-language.txt for a few more hints
how to do it.
Sam
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 10/22] m68k: Use generic show_mem()
2008-04-03 7:40 ` Geert Uytterhoeven
@ 2008-04-03 12:58 ` Johannes Weiner
2008-04-03 13:39 ` Geert Uytterhoeven
0 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 12:58 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
Hi Geert,
Geert Uytterhoeven <geert@linux-m68k.org> writes:
> The new version no longer prints
>
>> - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
>
show_mem()
show_free_areas()
show_swap_cache_info()
printk("Free swap = %lukB\n", nr_swap_pages << (PAGE_SHIFT - 10));
> and
>
>> - printk("%d free pages\n",free);
>
> on m68k.
show_free_areas() prints global_page_state(NR_FREE_PAGES). Isn't this
the same?
Thanks,
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 17/22] s390: Use generic show_mem()
2008-04-03 7:50 ` Heiko Carstens
@ 2008-04-03 13:00 ` Johannes Weiner
2008-04-03 17:58 ` Heiko Carstens
0 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 13:00 UTC (permalink / raw)
To: Heiko Carstens
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
Hi,
Heiko Carstens <heiko.carstens@de.ibm.com> writes:
>> diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
>> index 8053245..27b94cb 100644
>> --- a/arch/s390/mm/init.c
>> +++ b/arch/s390/mm/init.c
>> @@ -42,42 +42,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
>> pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
>> char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
>>
>> - printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
>> - printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
>> - printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
>> - printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
>> - printk("%lu pages slab\n",
>> - global_page_state(NR_SLAB_RECLAIMABLE) +
>> - global_page_state(NR_SLAB_UNRECLAIMABLE));
>> - printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));
>
> These are all missing in the generic implementation.
These are all duplicates from show_free_areas().
Thanks,
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 18/22] sh: Use generic show_mem()
2008-04-03 11:41 ` Paul Mundt
@ 2008-04-03 13:08 ` Johannes Weiner
0 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 13:08 UTC (permalink / raw)
To: Paul Mundt
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, ralf, kyle, paulus,
schwidefsky, jdike, miles, chris, rmk, tony.luck
Hi Paul,
Paul Mundt <lethal@linux-sh.org> writes:
> On Wed, Apr 02, 2008 at 10:40:24PM +0200, Johannes Weiner wrote:
>> - printk(KERN_INFO "Total of %ld pages in page table cache\n",
>> - quicklist_total_size());
>> -}
>> -
>
> NACK. The quicklists are also absent from the generic implementation.
> Doing things generically is nice and all, but please do not go around
> removing all of the different implementations and consolidating on the
> simplest point of commonality you could come up with. Either combine
> everything in to a generic show_mem() that doesn't sacrifice
> functionality, or only convert the platforms that are identical.
Sorry, I made it an RFC because I was not quite sure if the generic pfn
walker is valid on all affected architectures. If it is okay, I will
send a patch-set meant for application that does not miss any output.
Thanks,
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-03 12:48 ` Sam Ravnborg
@ 2008-04-03 13:30 ` Johannes Weiner
2008-04-03 14:49 ` Johannes Weiner
1 sibling, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 13:30 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Heiko Carstens, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, geert,
ralf, kyle, paulus, schwidefsky, lethal, jdike, miles, chris,
rmk, tony.luck
Hi,
Sam Ravnborg <sam@ravnborg.org> writes:
>> > +
>> > +config HAVE_ARCH_SHOW_MEM
>> > + def_bool y
>>
>> These are all not necessary. Better add some global Kconfig option that
>> gets selected by an arch if it wants the generic implementation.
>>
>> e.g. we currently have this in arch/s390/Kconfig:
>>
>> config S390
>> def_bool y
>> select HAVE_OPROFILE
>> select HAVE_KPROBES
>> select HAVE_KRETPROBES
>>
>> just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
>> specific patches.
> Seconded.
> See Documentation/kbuild/kconfig-language.txt for a few more hints
> how to do it.
Yes, I will rework the patches. Thanks.
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 10/22] m68k: Use generic show_mem()
2008-04-03 12:58 ` Johannes Weiner
@ 2008-04-03 13:39 ` Geert Uytterhoeven
2008-04-03 15:10 ` Johannes Weiner
0 siblings, 1 reply; 53+ messages in thread
From: Geert Uytterhoeven @ 2008-04-03 13:39 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
On Thu, 3 Apr 2008, Johannes Weiner wrote:
> Geert Uytterhoeven <geert@linux-m68k.org> writes:
> > The new version no longer prints
> >
> >> - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
> >
>
> show_mem()
> show_free_areas()
> show_swap_cache_info()
> printk("Free swap = %lukB\n", nr_swap_pages << (PAGE_SHIFT - 10));
>
> > and
> >
> >> - printk("%d free pages\n",free);
> >
> > on m68k.
>
> show_free_areas() prints global_page_state(NR_FREE_PAGES). Isn't this
> the same?
Thanks, good to know...
So I suggest to add an additional (first) step to the consolidation: remove all
duplicates.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-03 12:48 ` Sam Ravnborg
2008-04-03 13:30 ` Johannes Weiner
@ 2008-04-03 14:49 ` Johannes Weiner
2008-04-03 18:12 ` Sam Ravnborg
1 sibling, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 14:49 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Heiko Carstens, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, geert,
ralf, kyle, paulus, schwidefsky, lethal, jdike, miles, chris,
rmk, tony.luck
Hi,
Sam Ravnborg <sam@ravnborg.org> writes:
>> e.g. we currently have this in arch/s390/Kconfig:
>>
>> config S390
>> def_bool y
>> select HAVE_OPROFILE
>> select HAVE_KPROBES
>> select HAVE_KRETPROBES
>>
>> just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
>> specific patches.
> Seconded.
> See Documentation/kbuild/kconfig-language.txt for a few more hints
> how to do it.
After more thinking about it, wouldn't it be better to have
HAVE_ARCH_SHOW_MEM in mm/Kconfig and let archs with their own show_mem()
select it? Because there are far more archs that use the generic
version than those having their own.
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 10/22] m68k: Use generic show_mem()
2008-04-03 13:39 ` Geert Uytterhoeven
@ 2008-04-03 15:10 ` Johannes Weiner
2008-04-03 16:07 ` Hugh Dickins
0 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 15:10 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck, akpm
Hi,
Geert Uytterhoeven <geert@linux-m68k.org> writes:
> So I suggest to add an additional (first) step to the consolidation: remove all
> duplicates.
I shall do that. Problem is, I had a patch-series removing only parts
of the duplication (shame on me) and not all of these patches are yet in
the subsystem trees and still partially in -mm. None of them have hit
mainline yet. Suggestions?
The earlier patch-series was called `remove redundant output from
show_mem()'.
Sorry for the wasted time. These cleanups already took more energy than
they are worth it, I guess... :/
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 10/22] m68k: Use generic show_mem()
2008-04-03 15:10 ` Johannes Weiner
@ 2008-04-03 16:07 ` Hugh Dickins
2008-04-03 16:17 ` Johannes Weiner
2008-04-03 19:13 ` Geert Uytterhoeven
0 siblings, 2 replies; 53+ messages in thread
From: Hugh Dickins @ 2008-04-03 16:07 UTC (permalink / raw)
To: Johannes Weiner
Cc: Geert Uytterhoeven, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, ralf,
kyle, paulus, schwidefsky, lethal, jdike, miles, chris, rmk,
tony.luck, akpm
On Thu, 3 Apr 2008, Johannes Weiner wrote:
>
> Sorry for the wasted time. These cleanups already took more energy than
> they are worth it, I guess... :/
Please do persist, I for one appreciate your efforts on this:
something I wanted to do years ago but never yet got around to.
Thank you!
Hugh
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 10/22] m68k: Use generic show_mem()
2008-04-03 16:07 ` Hugh Dickins
@ 2008-04-03 16:17 ` Johannes Weiner
2008-04-03 19:13 ` Geert Uytterhoeven
1 sibling, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 16:17 UTC (permalink / raw)
To: Hugh Dickins
Cc: Geert Uytterhoeven, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, ralf,
kyle, paulus, schwidefsky, lethal, jdike, miles, chris, rmk,
tony.luck, akpm
Hi,
Hugh Dickins <hugh@veritas.com> writes:
> On Thu, 3 Apr 2008, Johannes Weiner wrote:
>>
>> Sorry for the wasted time. These cleanups already took more energy than
>> they are worth it, I guess... :/
>
> Please do persist, I for one appreciate your efforts on this:
> something I wanted to do years ago but never yet got around to.
>
> Thank you!
> Hugh
Thanks a lot!
I will do a removal of redundant output for every show_mem() based on my
prior patches first and then give the generic version another shot.
Thanks for all your comments so far.
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 17/22] s390: Use generic show_mem()
2008-04-03 13:00 ` Johannes Weiner
@ 2008-04-03 17:58 ` Heiko Carstens
2008-04-03 22:37 ` Johannes Weiner
0 siblings, 1 reply; 53+ messages in thread
From: Heiko Carstens @ 2008-04-03 17:58 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
On Thu, Apr 03, 2008 at 03:00:22PM +0200, Johannes Weiner wrote:
> Hi,
>
> Heiko Carstens <heiko.carstens@de.ibm.com> writes:
>
> >> diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
> >> index 8053245..27b94cb 100644
> >> --- a/arch/s390/mm/init.c
> >> +++ b/arch/s390/mm/init.c
> >> @@ -42,42 +42,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
> >> pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
> >> char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
> >>
> >> - printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
> >> - printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
> >> - printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
> >> - printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
> >> - printk("%lu pages slab\n",
> >> - global_page_state(NR_SLAB_RECLAIMABLE) +
> >> - global_page_state(NR_SLAB_UNRECLAIMABLE));
> >> - printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));
> >
> > These are all missing in the generic implementation.
>
> These are all duplicates from show_free_areas().
In this case ignore my comment ;)
Btw. your patch regarding the removal of show_free_areas() from
s390's arch code will be merged during the next merge window.
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-03 14:49 ` Johannes Weiner
@ 2008-04-03 18:12 ` Sam Ravnborg
2008-04-03 22:33 ` Johannes Weiner
0 siblings, 1 reply; 53+ messages in thread
From: Sam Ravnborg @ 2008-04-03 18:12 UTC (permalink / raw)
To: Johannes Weiner
Cc: Heiko Carstens, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, geert,
ralf, kyle, paulus, schwidefsky, lethal, jdike, miles, chris,
rmk, tony.luck
On Thu, Apr 03, 2008 at 04:49:42PM +0200, Johannes Weiner wrote:
> Hi,
>
> Sam Ravnborg <sam@ravnborg.org> writes:
>
> >> e.g. we currently have this in arch/s390/Kconfig:
> >>
> >> config S390
> >> def_bool y
> >> select HAVE_OPROFILE
> >> select HAVE_KPROBES
> >> select HAVE_KRETPROBES
> >>
> >> just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
> >> specific patches.
> > Seconded.
> > See Documentation/kbuild/kconfig-language.txt for a few more hints
> > how to do it.
>
> After more thinking about it, wouldn't it be better to have
> HAVE_ARCH_SHOW_MEM in mm/Kconfig and let archs with their own show_mem()
> select it? Because there are far more archs that use the generic
> version than those having their own.
Positive logic is almost always simpler to grasp.
And the usual way to do this is to let arch's select what they
use.
We do not want to have a situation where in most cases we select
a generic version but in some oddball case we select to have
a local version.
Sam
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 10/22] m68k: Use generic show_mem()
2008-04-03 16:07 ` Hugh Dickins
2008-04-03 16:17 ` Johannes Weiner
@ 2008-04-03 19:13 ` Geert Uytterhoeven
1 sibling, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2008-04-03 19:13 UTC (permalink / raw)
To: Hugh Dickins
Cc: Johannes Weiner, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, ralf,
kyle, paulus, schwidefsky, lethal, jdike, miles, chris, rmk,
tony.luck, akpm
On Thu, 3 Apr 2008, Hugh Dickins wrote:
> On Thu, 3 Apr 2008, Johannes Weiner wrote:
> > Sorry for the wasted time. These cleanups already took more energy than
> > they are worth it, I guess... :/
>
> Please do persist, I for one appreciate your efforts on this:
> something I wanted to do years ago but never yet got around to.
Ack. Don't be disappointed by our comments!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-03 18:12 ` Sam Ravnborg
@ 2008-04-03 22:33 ` Johannes Weiner
2008-04-04 21:35 ` Sam Ravnborg
0 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 22:33 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Heiko Carstens, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, geert,
ralf, kyle, paulus, schwidefsky, lethal, jdike, miles, chris,
rmk, tony.luck
Hi,
Sam Ravnborg <sam@ravnborg.org> writes:
> On Thu, Apr 03, 2008 at 04:49:42PM +0200, Johannes Weiner wrote:
>> Hi,
>>
>> Sam Ravnborg <sam@ravnborg.org> writes:
>>
>> >> e.g. we currently have this in arch/s390/Kconfig:
>> >>
>> >> config S390
>> >> def_bool y
>> >> select HAVE_OPROFILE
>> >> select HAVE_KPROBES
>> >> select HAVE_KRETPROBES
>> >>
>> >> just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
>> >> specific patches.
>> > Seconded.
>> > See Documentation/kbuild/kconfig-language.txt for a few more hints
>> > how to do it.
>>
>> After more thinking about it, wouldn't it be better to have
>> HAVE_ARCH_SHOW_MEM in mm/Kconfig and let archs with their own show_mem()
>> select it? Because there are far more archs that use the generic
>> version than those having their own.
>
> Positive logic is almost always simpler to grasp.
> And the usual way to do this is to let arch's select what they
> use.
> We do not want to have a situation where in most cases we select
> a generic version but in some oddball case we select to have
> a local version.
I can not follow you. Of course the arch selects what they use. But
they should not _all_ have to be flagged with an extra select. So what
default-value are you arguing for?
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 17/22] s390: Use generic show_mem()
2008-04-03 17:58 ` Heiko Carstens
@ 2008-04-03 22:37 ` Johannes Weiner
2008-04-04 7:39 ` Heiko Carstens
0 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 22:37 UTC (permalink / raw)
To: Heiko Carstens
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
Hi,
Heiko Carstens <heiko.carstens@de.ibm.com> writes:
> On Thu, Apr 03, 2008 at 03:00:22PM +0200, Johannes Weiner wrote:
>> Hi,
>>
>> Heiko Carstens <heiko.carstens@de.ibm.com> writes:
>>
>> >> diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
>> >> index 8053245..27b94cb 100644
>> >> --- a/arch/s390/mm/init.c
>> >> +++ b/arch/s390/mm/init.c
>> >> @@ -42,42 +42,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
>> >> pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
>> >> char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
>> >>
>> >> - printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
>> >> - printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
>> >> - printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
>> >> - printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
>> >> - printk("%lu pages slab\n",
>> >> - global_page_state(NR_SLAB_RECLAIMABLE) +
>> >> - global_page_state(NR_SLAB_UNRECLAIMABLE));
>> >> - printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));
>> >
>> > These are all missing in the generic implementation.
>>
>> These are all duplicates from show_free_areas().
>
> In this case ignore my comment ;)
> Btw. your patch regarding the removal of show_free_areas() from
> s390's arch code will be merged during the next merge window.
Okay.
Do you mean the removal of
printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT
- 10));
in show_mem()? This was my last patch series about.
Can I add your Acked-by for _this_ series?
Thanks,
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 00/21] Generic show_mem()
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
` (21 preceding siblings ...)
2008-04-02 20:40 ` [RFC 22/22] alpha: " Johannes Weiner
@ 2008-04-03 23:45 ` Johannes Weiner
22 siblings, 0 replies; 53+ messages in thread
From: Johannes Weiner @ 2008-04-03 23:45 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, mingo, davem, hskinnemoen, cooloney, starvik, dhowells,
takata, geert, ralf, kyle, paulus, schwidefsky, lethal, jdike,
miles, chris, rmk, tony.luck
Hi,
most of the feedback I got now was about information displaying that I
allegedly have simply dropped. This was only true in one case where I
missed the quicklist cache, the other droppings were redundant
information (already displayed in show_free_areas() for example).
Geert suggested that I should boil down show_mem() first for each arch
and then unify it but I would prefer unifying it first and listing
removed redundancy in the changelog of every arch-specific removal. Any
objections on this?
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 17/22] s390: Use generic show_mem()
2008-04-03 22:37 ` Johannes Weiner
@ 2008-04-04 7:39 ` Heiko Carstens
0 siblings, 0 replies; 53+ messages in thread
From: Heiko Carstens @ 2008-04-04 7:39 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, ralf, kyle, paulus,
schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
> > Btw. your patch regarding the removal of show_free_areas() from
> > s390's arch code will be merged during the next merge window.
>
> Okay.
>
> Do you mean the removal of
>
> printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT
> - 10));
>
> in show_mem()? This was my last patch series about.
Yes.
> Can I add your Acked-by for _this_ series?
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 02/22] x86: Use generic show_mem()
2008-04-02 20:40 ` [RFC 02/22] x86: Use generic show_mem() Johannes Weiner
@ 2008-04-04 8:17 ` Ingo Molnar
0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2008-04-04 8:17 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, davem, hskinnemoen, cooloney, starvik,
dhowells, ysato, takata, geert, ralf, kyle, paulus, schwidefsky,
lethal, jdike, miles, chris, rmk, tony.luck
* Johannes Weiner <hannes@saeurebad.de> wrote:
> -config HAVE_ARCH_SHOW_MEM
> - def_bool y
> -void show_mem(void)
> -{
nice work!
Acked-by: Ingo Molnar <mingo@elte.hu>
Ingo
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 19/22] um: Use generic show_mem()
2008-04-02 20:40 ` [RFC 19/22] um: " Johannes Weiner
@ 2008-04-04 14:38 ` Jeff Dike
0 siblings, 0 replies; 53+ messages in thread
From: Jeff Dike @ 2008-04-04 14:38 UTC (permalink / raw)
To: Johannes Weiner
Cc: linux-kernel, linux-mm, mingo, davem, hskinnemoen, cooloney,
starvik, dhowells, ysato, takata, geert, ralf, kyle, paulus,
schwidefsky, lethal, miles, chris, rmk, tony.luck
On Wed, Apr 02, 2008 at 10:40:25PM +0200, Johannes Weiner wrote:
> Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
This looks fine for UML.
Jeff
--
Work email - jdike at linux dot intel dot com
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-03 22:33 ` Johannes Weiner
@ 2008-04-04 21:35 ` Sam Ravnborg
2008-04-04 23:10 ` Johannes Weiner
0 siblings, 1 reply; 53+ messages in thread
From: Sam Ravnborg @ 2008-04-04 21:35 UTC (permalink / raw)
To: Johannes Weiner
Cc: Heiko Carstens, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, geert,
ralf, kyle, paulus, schwidefsky, lethal, jdike, miles, chris,
rmk, tony.luck
On Fri, Apr 04, 2008 at 12:33:42AM +0200, Johannes Weiner wrote:
> Hi,
>
> Sam Ravnborg <sam@ravnborg.org> writes:
>
> > On Thu, Apr 03, 2008 at 04:49:42PM +0200, Johannes Weiner wrote:
> >> Hi,
> >>
> >> Sam Ravnborg <sam@ravnborg.org> writes:
> >>
> >> >> e.g. we currently have this in arch/s390/Kconfig:
> >> >>
> >> >> config S390
> >> >> def_bool y
> >> >> select HAVE_OPROFILE
> >> >> select HAVE_KPROBES
> >> >> select HAVE_KRETPROBES
> >> >>
> >> >> just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
> >> >> specific patches.
> >> > Seconded.
> >> > See Documentation/kbuild/kconfig-language.txt for a few more hints
> >> > how to do it.
> >>
> >> After more thinking about it, wouldn't it be better to have
> >> HAVE_ARCH_SHOW_MEM in mm/Kconfig and let archs with their own show_mem()
> >> select it? Because there are far more archs that use the generic
> >> version than those having their own.
> >
> > Positive logic is almost always simpler to grasp.
> > And the usual way to do this is to let arch's select what they
> > use.
> > We do not want to have a situation where in most cases we select
> > a generic version but in some oddball case we select to have
> > a local version.
>
> I can not follow you. Of course the arch selects what they use. But
> they should not _all_ have to be flagged with an extra select. So what
> default-value are you arguing for?
The normal pattern is to let arch select the generic implmentation they
use.
Just because the majority does use the generic version should not
make us start to use the inverse logic as in your case.
So I want all archs that uses the generic show_mem() to
do an explicit:
config MYARCH
select HAVE_GENERIC_SHOWMEM
Sam
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-04 21:35 ` Sam Ravnborg
@ 2008-04-04 23:10 ` Johannes Weiner
2008-04-05 7:51 ` Heiko Carstens
0 siblings, 1 reply; 53+ messages in thread
From: Johannes Weiner @ 2008-04-04 23:10 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Heiko Carstens, linux-kernel, linux-mm, mingo, davem,
hskinnemoen, cooloney, starvik, dhowells, ysato, takata, geert,
ralf, kyle, paulus, schwidefsky, lethal, jdike, miles, chris,
rmk, tony.luck
Hi Sam,
Sam Ravnborg <sam@ravnborg.org> writes:
>> >> After more thinking about it, wouldn't it be better to have
>> >> HAVE_ARCH_SHOW_MEM in mm/Kconfig and let archs with their own show_mem()
>> >> select it? Because there are far more archs that use the generic
>> >> version than those having their own.
>> >
>> > Positive logic is almost always simpler to grasp.
>> > And the usual way to do this is to let arch's select what they
>> > use.
>> > We do not want to have a situation where in most cases we select
>> > a generic version but in some oddball case we select to have
>> > a local version.
>>
>> I can not follow you. Of course the arch selects what they use. But
>> they should not _all_ have to be flagged with an extra select. So what
>> default-value are you arguing for?
> The normal pattern is to let arch select the generic implmentation they
> use.
> Just because the majority does use the generic version should not
> make us start to use the inverse logic as in your case.
>
> So I want all archs that uses the generic show_mem() to
> do an explicit:
>
> config MYARCH
> select HAVE_GENERIC_SHOWMEM
>
> Sam
What is the rationale behind this? It is not a function the arch should
select at all because it is VM code. The remaining arch-specific
versions are meant to be removed too.
It would be like forcing all architectures to select HAVE_GENERIC_PRINTK
just because one architecture oopses on printk() and needs to replace it
with its own version.
Hannes
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-04 23:10 ` Johannes Weiner
@ 2008-04-05 7:51 ` Heiko Carstens
2008-04-05 9:04 ` Ralf Baechle
0 siblings, 1 reply; 53+ messages in thread
From: Heiko Carstens @ 2008-04-05 7:51 UTC (permalink / raw)
To: Johannes Weiner
Cc: Sam Ravnborg, linux-kernel, linux-mm, mingo, davem, hskinnemoen,
cooloney, starvik, dhowells, ysato, takata, geert, ralf, kyle,
paulus, schwidefsky, lethal, jdike, miles, chris, rmk, tony.luck
> >> I can not follow you. Of course the arch selects what they use. But
> >> they should not _all_ have to be flagged with an extra select. So what
> >> default-value are you arguing for?
> > The normal pattern is to let arch select the generic implmentation they
> > use.
> > Just because the majority does use the generic version should not
> > make us start to use the inverse logic as in your case.
> >
> > So I want all archs that uses the generic show_mem() to
> > do an explicit:
> >
> > config MYARCH
> > select HAVE_GENERIC_SHOWMEM
> >
> > Sam
>
> What is the rationale behind this? It is not a function the arch should
> select at all because it is VM code. The remaining arch-specific
> versions are meant to be removed too.
>
> It would be like forcing all architectures to select HAVE_GENERIC_PRINTK
> just because one architecture oopses on printk() and needs to replace it
> with its own version.
Positive logic and consistency with the CONFIG_HAVE_WHATEVER is the reason.
But you can solve this problem with no ifdefs and config options at all,
since you may as well just use __attribute__((weak)) for the generic
implementation.
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-05 7:51 ` Heiko Carstens
@ 2008-04-05 9:04 ` Ralf Baechle
2008-04-05 17:52 ` Heiko Carstens
0 siblings, 1 reply; 53+ messages in thread
From: Ralf Baechle @ 2008-04-05 9:04 UTC (permalink / raw)
To: Heiko Carstens
Cc: Johannes Weiner, Sam Ravnborg, linux-kernel, linux-mm, mingo,
davem, hskinnemoen, cooloney, starvik, dhowells, ysato, takata,
geert, kyle, paulus, schwidefsky, lethal, jdike, miles, chris,
rmk, tony.luck
On Sat, Apr 05, 2008 at 09:51:08AM +0200, Heiko Carstens wrote:
> But you can solve this problem with no ifdefs and config options at all,
> since you may as well just use __attribute__((weak)) for the generic
> implementation.
Which may result in the version of the function getting linked in but
staying unreferenced.
Ralf
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [RFC 01/22] Generic show_mem() implementation
2008-04-05 9:04 ` Ralf Baechle
@ 2008-04-05 17:52 ` Heiko Carstens
0 siblings, 0 replies; 53+ messages in thread
From: Heiko Carstens @ 2008-04-05 17:52 UTC (permalink / raw)
To: Ralf Baechle
Cc: Johannes Weiner, Sam Ravnborg, linux-kernel, linux-mm, mingo,
davem, hskinnemoen, cooloney, starvik, dhowells, ysato, takata,
geert, kyle, paulus, schwidefsky, lethal, jdike, miles, chris,
rmk, tony.luck
On Sat, Apr 05, 2008 at 10:04:03AM +0100, Ralf Baechle wrote:
> On Sat, Apr 05, 2008 at 09:51:08AM +0200, Heiko Carstens wrote:
>
> > But you can solve this problem with no ifdefs and config options at all,
> > since you may as well just use __attribute__((weak)) for the generic
> > implementation.
>
> Which may result in the version of the function getting linked in but
> staying unreferenced.
Oh, I assumed ld would support -dead_strip in the meantime to get rid of
unreferenced functions. Looks like it still doesn't.
^ permalink raw reply [flat|nested] 53+ messages in thread
end of thread, other threads:[~2008-04-05 17:52 UTC | newest]
Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-02 20:40 [RFC 00/21] Generic show_mem() Johannes Weiner
2008-04-02 20:40 ` [RFC 01/22] Generic show_mem() implementation Johannes Weiner
2008-04-03 7:55 ` Heiko Carstens
2008-04-03 12:48 ` Sam Ravnborg
2008-04-03 13:30 ` Johannes Weiner
2008-04-03 14:49 ` Johannes Weiner
2008-04-03 18:12 ` Sam Ravnborg
2008-04-03 22:33 ` Johannes Weiner
2008-04-04 21:35 ` Sam Ravnborg
2008-04-04 23:10 ` Johannes Weiner
2008-04-05 7:51 ` Heiko Carstens
2008-04-05 9:04 ` Ralf Baechle
2008-04-05 17:52 ` Heiko Carstens
2008-04-03 12:18 ` Ralf Baechle
2008-04-02 20:40 ` [RFC 02/22] x86: Use generic show_mem() Johannes Weiner
2008-04-04 8:17 ` Ingo Molnar
2008-04-02 20:40 ` [RFC 03/22] sparc64: " Johannes Weiner
2008-04-02 20:40 ` [RFC 04/22] avr32: " Johannes Weiner
2008-04-02 20:40 ` [RFC 05/22] blackfin: " Johannes Weiner
2008-04-02 20:40 ` [RFC 06/22] cris: " Johannes Weiner
2008-04-02 20:40 ` [RFC 07/22] frv: " Johannes Weiner
2008-04-02 20:40 ` [RFC 08/22] h8300: " Johannes Weiner
2008-04-02 20:40 ` [RFC 09/22] m32r: " Johannes Weiner
2008-04-02 20:40 ` [RFC 10/22] m68k: " Johannes Weiner
2008-04-03 7:40 ` Geert Uytterhoeven
2008-04-03 12:58 ` Johannes Weiner
2008-04-03 13:39 ` Geert Uytterhoeven
2008-04-03 15:10 ` Johannes Weiner
2008-04-03 16:07 ` Hugh Dickins
2008-04-03 16:17 ` Johannes Weiner
2008-04-03 19:13 ` Geert Uytterhoeven
2008-04-02 20:40 ` [RFC 11/22] m68knommu: " Johannes Weiner
2008-04-02 20:40 ` [RFC 12/22] mips: " Johannes Weiner
2008-04-03 11:59 ` Ralf Baechle
2008-04-02 20:40 ` [RFC 13/22] mn10300: " Johannes Weiner
2008-04-02 20:40 ` [RFC 14/22] parisc: " Johannes Weiner
2008-04-02 20:40 ` [RFC 15/22] powerpc: " Johannes Weiner
2008-04-02 20:40 ` [RFC 16/22] ppc: " Johannes Weiner
2008-04-02 20:40 ` [RFC 17/22] s390: " Johannes Weiner
2008-04-03 7:50 ` Heiko Carstens
2008-04-03 13:00 ` Johannes Weiner
2008-04-03 17:58 ` Heiko Carstens
2008-04-03 22:37 ` Johannes Weiner
2008-04-04 7:39 ` Heiko Carstens
2008-04-02 20:40 ` [RFC 18/22] sh: " Johannes Weiner
2008-04-03 11:41 ` Paul Mundt
2008-04-03 13:08 ` Johannes Weiner
2008-04-02 20:40 ` [RFC 19/22] um: " Johannes Weiner
2008-04-04 14:38 ` Jeff Dike
2008-04-02 20:40 ` [RFC 20/22] v850: " Johannes Weiner
2008-04-02 20:40 ` [RFC 21/22] xtensa: " Johannes Weiner
2008-04-02 20:40 ` [RFC 22/22] alpha: " Johannes Weiner
2008-04-03 23:45 ` [RFC 00/21] Generic show_mem() Johannes Weiner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox