Commit 411973b4 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove show_buffers()

Remove show_buffers().  It really has nothing to show any more.  just
buffermem_pages() - move that out into the callers.

There's a lot of duplication in this code.  better approach would be to
remove all the duplicated code out in the architectures and implement
generic show_memory_state().  Later.
parent 8dcf47bd
......@@ -139,7 +139,7 @@ show_mem(void)
printk("%ld reserved pages\n",reserved);
printk("%ld pages shared\n",shared);
printk("%ld pages swap cached\n",cached);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
#endif
......
......@@ -426,5 +426,5 @@ show_mem(void)
printk("%ld pages shared\n",shared);
printk("%ld pages swap cached\n",cached);
printk("%ld pages in page table cache\n",pgtable_cache_size);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
......@@ -101,7 +101,7 @@ void show_mem(void)
printk("%d slab pages\n", slab);
printk("%d pages shared\n", shared);
printk("%d pages swap cached\n", cached);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
struct node_info {
......
......@@ -183,7 +183,7 @@ show_mem(void)
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
printk("%ld pages in page table cache\n",pgtable_cache_size);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
/*
......
......@@ -95,7 +95,7 @@ void show_mem(void)
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
/* References to section boundaries */
......
......@@ -156,7 +156,6 @@ static void receive_chars(struct tty_struct *tty, struct pt_regs *regs)
continue;
} else if ( seen_esc == 2 ) {
if ( ch == 'P' ) show_state(); /* F1 key */
if ( ch == 'Q' ) show_buffers(); /* F2 key */
#ifdef CONFIG_KDB
if ( ch == 'S' )
kdb(KDB_REASON_KEYBOARD, 0, (kdb_eframe_t) regs);
......
......@@ -200,7 +200,7 @@ show_mem(void)
pgdat = pgdat->node_next;
} while (pgdat);
printk("Total of %ld pages in page table cache\n", pgtable_cache_size);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
printk("%d free buffer pages\n", nr_free_buffer_pages());
}
#else /* !CONFIG_DISCONTIGMEM */
......@@ -220,7 +220,7 @@ show_mem(void)
printk("%d pages shared\n", shared);
printk("%d pages swap cached\n", cached);
printk("%ld pages in page table cache\n", pgtable_cache_size);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
#endif /* !CONFIG_DISCONTIGMEM */
}
......
......@@ -109,7 +109,7 @@ void show_mem(void)
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
printk("%ld pages in page table cache\n",pgtable_cache_size);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
extern void init_pointer_table(unsigned long ptable);
......
......@@ -137,7 +137,7 @@ void show_mem(void)
printk("%d pages swap cached\n",cached);
printk("%ld pages in page table cache\n",pgtable_cache_size);
printk("%d free pages\n", free);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
/* References to section boundaries */
......
......@@ -341,7 +341,7 @@ void show_mem(void)
printk("%d pages swap cached\n",cached);
printk("%ld pages in page table cache\n", pgtable_cache_size);
printk("%d free pages\n", free);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
#ifndef CONFIG_DISCONTIGMEM
......
......@@ -155,7 +155,7 @@ void show_mem(void)
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
void set_pte_phys (unsigned long vaddr, unsigned long phys)
......
......@@ -142,7 +142,7 @@ void show_mem(void)
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
void si_meminfo(struct sysinfo *val)
......
......@@ -138,7 +138,7 @@ void show_mem(void)
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
void si_meminfo(struct sysinfo *val)
......
......@@ -89,7 +89,7 @@ void show_mem(void)
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
printk("%ld pages in page table cache\n",pgtable_cache_size);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
/* References to section boundaries */
......
......@@ -89,7 +89,7 @@ void show_mem(void)
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
printk("%ld pages in page table cache\n",pgtable_cache_size);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
/* References to section boundaries */
......
......@@ -73,7 +73,7 @@ void show_mem(void)
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
/* References to section boundaries */
......
......@@ -84,7 +84,7 @@ void show_mem(void)
if (sparc_cpu_model == sun4m || sparc_cpu_model == sun4d)
printk("%ld entries in page dir cache\n",pgd_cache_size);
#endif
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
extern pgprot_t protection_map[16];
......
......@@ -334,7 +334,7 @@ void show_mem(void)
#ifndef CONFIG_SMP
printk("%d entries in page dir cache\n",pgd_cache_size);
#endif
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
void mmu_info(struct seq_file *m)
......
......@@ -69,7 +69,7 @@ void show_mem(void)
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
show_buffers();
printk("%ld buffermem pages\n", nr_buffermem_pages());
}
/* References to section boundaries */
......
......@@ -423,7 +423,8 @@ static _INLINE_ void receive_chars(struct sgi_serial *info, struct pt_regs *regs
show_state();
return;
} else if (ch == 2) {
show_buffers();
printk("%ld buffermem pages\n",
nr_buffermem_pages());
return;
}
}
......
......@@ -2164,14 +2164,6 @@ int try_to_free_buffers(struct page *page)
}
EXPORT_SYMBOL(try_to_free_buffers);
/* ================== Debugging =================== */
void show_buffers(void)
{
printk("Buffer memory: %6dkB\n",
atomic_read(&buffermem_pages) << (PAGE_SHIFT-10));
}
int block_sync_page(struct page *page)
{
run_task_queue(&tq_disk);
......
......@@ -1586,8 +1586,6 @@ extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *);
extern struct file_operations simple_dir_operations;
extern struct inode_operations simple_dir_inode_operations;
extern void show_buffers(void);
#ifdef CONFIG_BLK_DEV_INITRD
extern unsigned int real_root_dev;
#endif
......
......@@ -98,6 +98,7 @@ extern int nr_swap_pages;
extern unsigned int nr_free_pages(void);
extern unsigned int nr_free_buffer_pages(void);
extern unsigned int nr_free_pagecache_pages(void);
extern unsigned long nr_buffermem_pages(void);
extern int nr_active_pages;
extern int nr_inactive_pages;
extern atomic_t nr_async_pages;
......
......@@ -562,6 +562,11 @@ unsigned int nr_free_highpages (void)
}
#endif
unsigned long nr_buffermem_pages(void)
{
return atomic_read(&buffermem_pages);
}
/*
* Accumulate the page_state information across all CPUs.
* The result is unavoidably approximate - it can change
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment