[Devel] [PATCH rh7 02/11] ub: zap show_ub_mem

Vladimir Davydov vdavydov at parallels.com
Wed May 20 02:00:39 PDT 2015


It is called by the showmem sysctl. Hell knows why it was added and who
would ever used it. Anyways, all this info is in memcg now, so zap it.
If anyone needs it one day, which I doubt, it will have to be
reimplemented in the scope of memcg.

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 drivers/tty/sysrq.c  |    7 -------
 include/bc/vmpages.h |    3 ---
 kernel/bc/vm_pages.c |   29 -----------------------------
 3 files changed, 39 deletions(-)

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 069928f0a814..fe0b813ee215 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -313,13 +313,6 @@ static struct sysrq_key_op sysrq_ftrace_dump_op = {
 
 static void sysrq_handle_showmem(int key)
 {
-	struct user_beancounter *ub;
-
-	rcu_read_lock();
-	for_each_beancounter(ub)
-		show_ub_mem(ub);
-	rcu_read_unlock();
-
 	show_mem(0);
 }
 static struct sysrq_key_op sysrq_showmem_op = {
diff --git a/include/bc/vmpages.h b/include/bc/vmpages.h
index 4833ef8a08bf..bf63b885441c 100644
--- a/include/bc/vmpages.h
+++ b/include/bc/vmpages.h
@@ -47,7 +47,4 @@ UB_DECLARE_FUNC(int, ub_lockedshm_charge(struct shmem_inode_info *shi,
 UB_DECLARE_VOID_FUNC(ub_lockedshm_uncharge(struct shmem_inode_info *shi,
 			unsigned long size))
 
-void __show_ub_mem(struct user_beancounter *ub);
-void show_ub_mem(struct user_beancounter *ub);
-
 #endif /* __UB_PAGES_H_ */
diff --git a/kernel/bc/vm_pages.c b/kernel/bc/vm_pages.c
index bc1a1d7c7fff..b1eedd29e17f 100644
--- a/kernel/bc/vm_pages.c
+++ b/kernel/bc/vm_pages.c
@@ -270,35 +270,6 @@ static void __exit fini_vmguar_notifier(void)
 module_init(init_vmguar_notifier);
 module_exit(fini_vmguar_notifier);
 
-static void __show_one_resource(const char *name, struct ubparm *parm)
-{
-	if (parm->limit == UB_MAXVALUE)
-		printk("%s: %lu / inf [%lu] ", name,
-				parm->held, parm->failcnt);
-	else
-		printk("%s: %lu / %lu [%lu] ", name,
-				parm->held, parm->limit, parm->failcnt);
-}
-
-void __show_ub_mem(struct user_beancounter *ub)
-{
-	__show_one_resource("RAM", ub->ub_parms + UB_PHYSPAGES);
-	__show_one_resource("SWAP", ub->ub_parms + UB_SWAPPAGES);
-	__show_one_resource("KMEM", ub->ub_parms + UB_KMEMSIZE);
-	__show_one_resource("DCSZ", ub->ub_parms + UB_DCACHESIZE);
-	__show_one_resource("OOMG", ub->ub_parms + UB_OOMGUARPAGES);
-
-	printk("Dirty %lu Wback %lu\n",
-			ub_stat_get(ub, dirty_pages),
-			ub_stat_get(ub, writeback_pages));
-}
-
-void show_ub_mem(struct user_beancounter *ub)
-{
-	printk(KERN_INFO "UB-%s-Mem-Info:\n", ub->ub_name);
-	__show_ub_mem(ub);
-}
-
 #ifdef CONFIG_PROC_FS
 static int bc_vmaux_show(struct seq_file *f, void *v)
 {
-- 
1.7.10.4




More information about the Devel mailing list