On Tue, 10 Jul 2007, Dave McCracken wrote:
> On Tuesday 10 July 2007, Hugh Dickins wrote:
> >
> > Mapped private readonly yes, but vm_stat_account() says
> > if (file) {
> > mm->shared_vm += pages;
> > if ((flags & (VM_EXEC|VM_WRITE)) == VM_EXEC)
> > mm->exec_vm += pages;
>
> In that code shared_vm includes everything that's mmap()ed, including private
> mappings. But if you look at Herbert's patch he has the following change:
>
> if (file) {
> - mm->shared_vm += pages;
> + if (flags & VM_SHARED)
> + mm->shared_vm += pages;
> if ((flags & (VM_EXEC|VM_WRITE)) == VM_EXEC)
> mm->exec_vm += pages;
>
> This means that shared_vm now is truly only memory that's mapped VM_SHARED and
> does not include VM_EXEC memory. That necessitates the separate subtraction
> of exec_vm in the data calculations.
Ah, I just noticed at the beginning of the patch, and didn't look for
a balancing change - thanks. I'd strongly recommend that he not mess
around with these numbers, unless there's _very_ good reason: they're
not ideal, nothing ever will be, changing them around just causes pain.
shared_vm may not be a full description of what it counts, but it'll
do until you've a better name (readonly mappings share with the file
even when they're private).
Hugh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]