Skip to content

Commit

Permalink
[PATCH] fix impossible VmallocChunk
Browse files Browse the repository at this point in the history
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 <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed May 17, 2005
1 parent baae956 commit 64d13c0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions fs/proc/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 64d13c0

Please sign in to comment.