lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130227205629.GA8429@localhost.localdomain>
Date:	Wed, 27 Feb 2013 15:56:30 -0500
From:	Andrew Shewmaker <agshew@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [RFC PATCH v2 1/2] mm: tuning hardcoded reserved memory

The following patches are against the mmtom git tree as of February 27th.

The first patch only affects OVERCOMMIT_NEVER mode, entirely removing 
the 3% reserve for other user processes.

The second patch affects both OVERCOMMIT_GUESS and OVERCOMMIT_NEVER 
modes, replacing the hardcoded 3% reserve for the root user with a 
tunable knob.

Signed-off-by: Andrew Shewmaker <agshew@...il.com>

---

__vm_enough_memory reserves 3% of free pages with the default 
overcommit mode and 6% when overcommit is disabled. These hardcoded 
values have become less reasonable as memory sizes have grown.

On scientific clusters, systems are generally dedicated to one user. 
Also, overcommit is sometimes disabled in order to prevent a long 
running job from suddenly failing days or weeks into a calculation.
In this case, a user wishing to allocate as much memory as possible 
to one process may be prevented from using, for example, around 7GB 
out of 128GB.

The effect is less, but still significant when a user starts a job 
with one process per core. I have repeatedly seen a set of processes 
requesting the same amount of memory fail because one of them could  
not allocate the amount of memory a user would expect to be able to 
allocate.

diff --git a/mm/mmap.c b/mm/mmap.c
index d1e4124..5993f33 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -182,11 +182,6 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
 		allowed -= allowed / 32;
 	allowed += total_swap_pages;
 
-	/* 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;
-
 	if (percpu_counter_read_positive(&vm_committed_as) < allowed)
 		return 0;
 error:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ