From: Hugh Dickins Date: Tue, 17 May 2005 04:53:09 +0000 (-0700) Subject: [PATCH] fix impossible VmallocChunk X-Git-Tag: v2.6.12-rc5~164 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64d13c00cf1f7c3d2c1ff449e2a0500ab568d319;p=linux-2.6 [PATCH] fix impossible VmallocChunk VmallocTotal: 34359738367 kB VmallocUsed: 266288 kB VmallocChunk: 18014366299193295 kB is unsettling - x86_64 and some other architectures keep a separate address range for modules in vmalloc's vmlist, which /proc/meminfo should pass over. Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/proc/mmu.c b/fs/proc/mmu.c index a7041038ad..25d2d9c6e3 100644 --- a/fs/proc/mmu.c +++ b/fs/proc/mmu.c @@ -50,13 +50,23 @@ void get_vmalloc_info(struct vmalloc_info *vmi) read_lock(&vmlist_lock); for (vma = vmlist; vma; vma = vma->next) { + unsigned long addr = (unsigned long) vma->addr; + + /* + * Some archs keep another range for modules in vmlist + */ + if (addr < VMALLOC_START) + continue; + if (addr >= VMALLOC_END) + break; + vmi->used += vma->size; - free_area_size = (unsigned long) vma->addr - prev_end; + free_area_size = addr - prev_end; if (vmi->largest_chunk < free_area_size) vmi->largest_chunk = free_area_size; - prev_end = vma->size + (unsigned long) vma->addr; + prev_end = vma->size + addr; } if (VMALLOC_END - prev_end > vmi->largest_chunk)