lkml.org 
[lkml]   [2008]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 03/22 -v2] alpha: Use generic show_mem()
Remove arch-specific show_mem() in favor of the generic version.

This also removes the following redundant information display:

- free pages, printed by show_free_areas()
- pages in swapcache, printed by show_swap_cache_info()

where show_mem() calls show_free_areas(), which calls
show_swap_cache_info().

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
CC: Richard Henderson <rth@twiddle.net>
---

Index: tree-linus/arch/alpha/Kconfig
===================================================================
--- tree-linus.orig/arch/alpha/Kconfig
+++ tree-linus/arch/alpha/Kconfig
@@ -7,7 +7,6 @@ config ALPHA
default y
select HAVE_IDE
select HAVE_OPROFILE
- select HAVE_ARCH_SHOW_MEM
help
The Alpha is a 64-bit general-purpose processor designed and
marketed by the Digital Equipment Corporation of blessed memory,
Index: tree-linus/arch/alpha/mm/init.c
===================================================================
--- tree-linus.orig/arch/alpha/mm/init.c
+++ tree-linus/arch/alpha/mm/init.c
@@ -94,35 +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();
- 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)
{
Index: tree-linus/arch/alpha/mm/numa.c
===================================================================
--- tree-linus.orig/arch/alpha/mm/numa.c
+++ tree-linus/arch/alpha/mm/numa.c
@@ -359,37 +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();
- 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);
-}
--



\
 
 \ /
  Last update: 2008-04-04 15:03    [W:0.779 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site