Skip to content

Commit

Permalink
Revert "mm: vmscan: Add a debug file for shrinkers"
Browse files Browse the repository at this point in the history
Kernel panic when type "cat /sys/kernel/debug/shrinker"

Unable to handle kernel paging request at virtual address 0af37d40
pgd = d4dec000
[0af37d40] *pgd=00000000
Internal error: Oops: 5 [ztemt#1] PREEMPT SMP ARM
[<c0bb8f24>] (_raw_spin_lock) from [<c020aa08>] (list_lru_count_one+0x14/0x28)
[<c020aa08>] (list_lru_count_one) from [<c02309a8>] (super_cache_count+0x40/0xa0)
[<c02309a8>] (super_cache_count) from [<c01f6ab0>] (debug_shrinker_show+0x50/0x90)
[<c01f6ab0>] (debug_shrinker_show) from [<c024fa5c>] (seq_read+0x1ec/0x48c)
[<c024fa5c>] (seq_read) from [<c022e8f8>] (__vfs_read+0x20/0xd0)
[<c022e8f8>] (__vfs_read) from [<c022f0d0>] (vfs_read+0x7c/0x104)
[<c022f0d0>] (vfs_read) from [<c022f974>] (SyS_read+0x44/0x9c)
[<c022f974>] (SyS_read) from [<c0107580>] (ret_fast_syscall+0x0/0x3c)
Code: e1a04000 e3a00001 ebd66b39 f594f000 (e1943f9f)
---[ end trace 60c74014a63a9688 ]---
Kernel panic - not syncing: Fatal exception

shrink_control.nid is used but not initialzed, same for
shrink_control.memcg.

This reverts commit b0e7a582b2264cdf75874dcd8df915b6b4427755.

Change-Id: I108de88fa4baaef99a53c4e4c6a1d8c4b4804157
Reported-by: Xiaowen Liu <[email protected]>
Signed-off-by: Dmitry Shmidt <[email protected]>
Git-commit: ad95c12f66df9efae04b15d5c4d0d0ba56ab2620
Git-repo: https://source.codeaurora.org/quic/la/kernel/msm-4.4.git
Signed-off-by: Vinayak Menon <[email protected]>
  • Loading branch information
Dmitry Shmidt authored and Gerrit - the friendly Code Review server committed Mar 28, 2017
1 parent 8a50c66 commit b1987fe
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <linux/oom.h>
#include <linux/prefetch.h>
#include <linux/printk.h>
#include <linux/debugfs.h>

#include <asm/tlbflush.h>
#include <asm/div64.h>
Expand Down Expand Up @@ -200,39 +199,6 @@ static unsigned long get_lru_size(struct lruvec *lruvec, enum lru_list lru)
return zone_page_state(lruvec_zone(lruvec), NR_LRU_BASE + lru);
}

struct dentry *debug_file;

static int debug_shrinker_show(struct seq_file *s, void *unused)
{
struct shrinker *shrinker;
struct shrink_control sc;

sc.gfp_mask = -1;
sc.nr_to_scan = 0;

down_read(&shrinker_rwsem);
list_for_each_entry(shrinker, &shrinker_list, list) {
int num_objs;

num_objs = shrinker->count_objects(shrinker, &sc);
seq_printf(s, "%pf %d\n", shrinker->scan_objects, num_objs);
}
up_read(&shrinker_rwsem);
return 0;
}

static int debug_shrinker_open(struct inode *inode, struct file *file)
{
return single_open(file, debug_shrinker_show, inode->i_private);
}

static const struct file_operations debug_shrinker_fops = {
.open = debug_shrinker_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

/*
* Add a shrinker callback to be called from the vm.
*/
Expand Down Expand Up @@ -262,15 +228,6 @@ int register_shrinker(struct shrinker *shrinker)
}
EXPORT_SYMBOL(register_shrinker);

static int __init add_shrinker_debug(void)
{
debugfs_create_file("shrinker", 0644, NULL, NULL,
&debug_shrinker_fops);
return 0;
}

late_initcall(add_shrinker_debug);

/*
* Remove one
*/
Expand Down

0 comments on commit b1987fe

Please sign in to comment.