From: Hugh Dickins <hugh@veritas.com>
To: Dave McCracken <dave.mccracken@oracle.com>
Cc: herbert.van.den.bergh@oracle.com, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] include private data mappings in RLIMIT_DATA limit
Date: Tue, 10 Jul 2007 20:42:59 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0707102030150.2063@blonde.wat.veritas.com> (raw)
In-Reply-To: <200707101412.19785.dave.mccracken@oracle.com>
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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-07-10 19:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-10 0:43 Herbert van den Bergh
2007-07-10 0:54 ` Dave McCracken
2007-07-10 16:58 ` Hugh Dickins
2007-07-10 17:19 ` Dave McCracken
2007-07-10 18:06 ` Hugh Dickins
2007-07-10 19:12 ` Dave McCracken
2007-07-10 19:42 ` Hugh Dickins [this message]
2007-07-10 20:09 ` Herbert van den Bergh
2007-07-13 19:18 ` Hugh Dickins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0707102030150.2063@blonde.wat.veritas.com \
--to=hugh@veritas.com \
--cc=akpm@linux-foundation.org \
--cc=dave.mccracken@oracle.com \
--cc=herbert.van.den.bergh@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox