Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106234
b: refs/heads/master
c: 8dad322
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Weiner authored and Linus Torvalds committed Jul 26, 2008
1 parent 77fa82d commit 2aa295d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 85 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47221222a59a565e11954c078a2cf6a07a7e690e
refs/heads/master: 8dad322f5449010c14990dd6934878f576b2ee60
37 changes: 0 additions & 37 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,43 +86,6 @@ early_param("gbpages", parse_direct_gbpages_on);
* 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();
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)
Expand Down
47 changes: 0 additions & 47 deletions trunk/arch/x86/mm/pgtable_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,53 +20,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();
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.
Expand Down

0 comments on commit 2aa295d

Please sign in to comment.