From: VomLehn <dvomlehn@cisco.com>
To: Linux Memory Management Mailing List <linux-mm@kvack.org>
Subject: Puzzled by __vm_enough_memory with OVERCOMMIT_NEVER
Date: Thu, 16 Apr 2009 14:12:49 -0700 [thread overview]
Message-ID: <20090416211249.GA9828@cuplxvomd02.corp.sa.net> (raw)
The function __vm_enough_memory in mm/mmap.c has a piece of code for
handling the case of disabled overcommit that has puzzled me for a while
and looks like it may be causing a problem:
/* Don't let a single process grow too big:
leave 3% of the size of this process for other processes */
if (mm)
allowed -= mm->total_vm / 32;
At this point, it seems like total_vm does not yet include the pages
we are trying to add, so this is limiting a single process to no more than
97% of its *old* size rather than its new size. So, this seems to make more
sense:
if (mm)
allowed -= (mm->total_vm + pages)/ 32;
Even then, it seems like the real way to do this would be simply to lop off
3% of the total available virtual memory, and use:
allowed -= allowed / 32;
Or, perhaps I'm missing something.
--
David VomLehn
--
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>
reply other threads:[~2009-04-16 21:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090416211249.GA9828@cuplxvomd02.corp.sa.net \
--to=dvomlehn@cisco.com \
--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