* Puzzled by __vm_enough_memory with OVERCOMMIT_NEVER
@ 2009-04-16 21:12 VomLehn
0 siblings, 0 replies; only message in thread
From: VomLehn @ 2009-04-16 21:12 UTC (permalink / raw)
To: Linux Memory Management Mailing List
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>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-16 21:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-16 21:12 Puzzled by __vm_enough_memory with OVERCOMMIT_NEVER VomLehn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox