Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: sandbox/linux/suid/process_util_linux.c

Issue 49843002: cros: Remove unused low memory margin code from sandbox and zygote (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/suid/common/sandbox.h ('k') | sandbox/linux/suid/sandbox.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/suid/process_util_linux.c
diff --git a/sandbox/linux/suid/process_util_linux.c b/sandbox/linux/suid/process_util_linux.c
index 5e6b33b60f914ff13ff98aa4df3e1bf9d427d3a0..78c27ef507547be18baae8c8a1b0b50ce402da2e 100644
--- a/sandbox/linux/suid/process_util_linux.c
+++ b/sandbox/linux/suid/process_util_linux.c
@@ -24,10 +24,6 @@
static const int kMaxOomScore = 1000;
static const int kMaxOldOomScore = 15;
-// Kernel pseudo-file that allows setting of the low memory margin.
-static const char kLowMemMarginFile[] =
- "/sys/kernel/mm/chromeos-low_mem/margin";
-
// NOTE: This is not the only version of this function in the source:
// the base library (in process_util_linux.cc) also has its own C++ version.
bool AdjustOOMScore(pid_t process, int score) {
@@ -77,30 +73,3 @@ bool AdjustOOMScore(pid_t process, int score) {
close(fd);
return (bytes_written == len);
}
-
-bool AdjustLowMemoryMargin(int64_t margin_mb) {
- int file_descriptor = open(kLowMemMarginFile, O_WRONLY);
- if (file_descriptor < 0)
- return false;
-
- // Only allow those values which are reasonable, to prevent mischief.
- char value[21];
- switch (margin_mb) {
- case -1L:
- snprintf(value, sizeof(value), "off");
- break;
- case 0L:
- case 25L:
- case 50L:
- case 100L:
- case 200L:
- snprintf(value, sizeof(value), "%lld", (long long int)margin_mb);
- break;
- default:
- return false;
- }
-
- bool success = (write(file_descriptor, value, strlen(value)) >= 0);
- close(file_descriptor);
- return success;
-}
« no previous file with comments | « sandbox/linux/suid/common/sandbox.h ('k') | sandbox/linux/suid/sandbox.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698