mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
vmalloc: show vmalloced areas via /proc/vmallocinfo
Implement a new proc file that allows the display of the currently allocated vmalloc memory. It allows to see the users of vmalloc. That is important if vmalloc space is scarce (i386 for example). And it's going to be important for the compound page fallback to vmalloc. Many of the current users can be switched to use compound pages with fallback. This means that the number of users of vmalloc is reduced and page tables no longer necessary to access the memory. /proc/vmallocinfo allows to review how that reduction occurs. If memory becomes fragmented and larger order allocations are no longer possible then /proc/vmallocinfo allows to see which compound page allocations fell back to virtual compound pages. That is important for new users of virtual compound pages. Such as order 1 stack allocation etc that may fallback to virtual compound pages in the future. /proc/vmallocinfo permissions are made readable-only-by-root to avoid possible information leakage. [[email protected]: coding-style fixes] [[email protected]: CONFIG_MMU=n build fix] Signed-off-by: Christoph Lameter <[email protected]> Reviewed-by: KOSAKI Motohiro <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Arjan van de Ven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b454456841
commit
a10aa57987
3 changed files with 94 additions and 1 deletions
|
|
@ -456,6 +456,20 @@ static const struct file_operations proc_slabstats_operations = {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
static int vmalloc_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return seq_open(file, &vmalloc_op);
|
||||
}
|
||||
|
||||
static const struct file_operations proc_vmalloc_operations = {
|
||||
.open = vmalloc_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release,
|
||||
};
|
||||
#endif
|
||||
|
||||
static int show_stat(struct seq_file *p, void *v)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -868,6 +882,9 @@ void __init proc_misc_init(void)
|
|||
#ifdef CONFIG_DEBUG_SLAB_LEAK
|
||||
create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_MMU
|
||||
proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations);
|
||||
#endif
|
||||
create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations);
|
||||
create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops);
|
||||
|
|
|
|||
Loading…
Reference in a new issue