From d700c5c3f95accebcaf8d3ac8e81ebc2f14397f1 Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Wed, 6 Apr 2022 17:22:52 +0800 Subject: [PATCH] Revert "mm/memblock: show memblock reserved with size information" This reverts commit 1fc0ecb55feaa9c5850123755681e7f13e81d01f. Signed-off-by: Jianqun Xu Change-Id: I4ea80186ac8e80c882aee85a15a8e9898a52d433 --- mm/Kconfig | 7 ------ mm/Makefile | 1 - mm/memblock_debugfs.c | 52 ------------------------------------------- 3 files changed, 60 deletions(-) delete mode 100644 mm/memblock_debugfs.c diff --git a/mm/Kconfig b/mm/Kconfig index 9e7ad31e1aff..4788d59e5d36 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -63,13 +63,6 @@ config SPARSEMEM_MANUAL endchoice -config MEMBLOCK_DEBUGFS - bool "Memblock debugfs for reserved memory" - depends on DEBUG_FS && ARCH_KEEP_MEMBLOCK - help - Extend memblock debugfs to show size of each memblock, and shows the - result of total size by KiB format. - config DISCONTIGMEM def_bool y depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL diff --git a/mm/Makefile b/mm/Makefile index d1a819711e9f..d072cadb4299 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -62,7 +62,6 @@ CFLAGS_page_alloc.o += -DDYNAMIC_DEBUG_MODULE obj-y += page-alloc.o obj-y += init-mm.o obj-y += memblock.o -obj-$(CONFIG_MEMBLOCK_DEBUGFS) += memblock_debugfs.o ifdef CONFIG_MMU obj-$(CONFIG_ADVISE_SYSCALLS) += madvise.o diff --git a/mm/memblock_debugfs.c b/mm/memblock_debugfs.c deleted file mode 100644 index 4ee5d1de4add..000000000000 --- a/mm/memblock_debugfs.c +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Debugfs for reserved memory blocks. - * - * Copyright (C) 2022 Rockchip Electronics Co. Ltd. - */ - -#include -#include -#include -#include - -#define K(size) ((unsigned long)((size) >> 10)) - -static int memblock_debugfs_show(struct seq_file *m, void *private) -{ - struct memblock_type *type = m->private; - struct memblock_region *reg; - int i; - phys_addr_t end; - unsigned long z = 0, t = 0; - - for (i = 0; i < type->cnt; i++) { - reg = &type->regions[i]; - end = reg->base + reg->size - 1; - z = (unsigned long)reg->size; - t += z; - - seq_printf(m, "%4d: ", i); - seq_printf(m, "%pa..%pa (%10lu %s)\n", ®->base, &end, - (z >= 1024) ? (K(z)) : z, - (z >= 1024) ? "KiB" : "Bytes"); - } - seq_printf(m, "Total: %lu KiB\n", K(t)); - - return 0; -} -DEFINE_SHOW_ATTRIBUTE(memblock_debugfs); - -static int __init memblock_debugfs_init(void) -{ - struct dentry *root = debugfs_lookup("memblock", NULL); - - if (!root) - return -EPROBE_DEFER; - - debugfs_create_file("reserved_size", 0444, root, - &memblock.reserved, &memblock_debugfs_fops); - - return 0; -} -late_initcall(memblock_debugfs_init);