X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fproc%2Fmmu.c;h=8ae221dfd0101ea3048de30bbf3444a89f147ea0;hb=e58b7dab272ecee09cd7bafb89d6b224cd17bbe3;hp=a7041038ad56108ef45f195bedf109dbbb7ddb24;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=linux-2.6 diff --git a/fs/proc/mmu.c b/fs/proc/mmu.c index a7041038ad..8ae221dfd0 100644 --- a/fs/proc/mmu.c +++ b/fs/proc/mmu.c @@ -8,27 +8,10 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include +#include #include -#include -#include #include "internal.h" void get_vmalloc_info(struct vmalloc_info *vmi) @@ -50,13 +33,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)