[Libreoffice-commits] online.git: common/Seccomp.cpp kit/Kit.cpp loleaflet/admin.strings.js loleaflet/dist loleaflet/src wsd/Admin.cpp wsd/LOOLWSD.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Tue Jun 13 04:27:30 UTC 2017
common/Seccomp.cpp | 17 -----------
kit/Kit.cpp | 5 ---
loleaflet/admin.strings.js | 7 ++--
loleaflet/dist/admin/adminSettings.html | 43 +++++++++++++----------------
loleaflet/src/admin/AdminSocketSettings.js | 1
wsd/Admin.cpp | 14 ---------
wsd/LOOLWSD.cpp | 3 --
7 files changed, 23 insertions(+), 67 deletions(-)
New commits:
commit 44d8876f272abe50b563049eb605a45017a94e5d
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Tue Jun 13 00:22:42 2017 -0400
Remove data rlimit
Seems to have no effect, so gone in
favor of RLIMIT_AS (virtual memeory).
Change-Id: I210879ec9285f420c9f9839cdabf45c42d865fb3
Reviewed-on: https://gerrit.libreoffice.org/38720
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/common/Seccomp.cpp b/common/Seccomp.cpp
index 52fedb01..c8ac7b39 100644
--- a/common/Seccomp.cpp
+++ b/common/Seccomp.cpp
@@ -237,23 +237,6 @@ bool handleSetrlimitCommand(const std::vector<std::string>& tokens)
return true;
}
- else if (tokens[1] == "limit_data_mem_kb")
- {
- rlim_t lim = std::stoi(tokens[2]) * 1024;
- if (lim <= 0)
- lim = RLIM_INFINITY;
-
- rlimit rlim = { lim, lim };
- if (setrlimit(RLIMIT_DATA, &rlim) != 0)
- LOG_SYS("Failed to set RLIMIT_DATA to " << lim << " bytes.");
-
- if (getrlimit(RLIMIT_DATA, &rlim) == 0)
- LOG_INF("RLIMIT_DATA is " << rlim.rlim_max << " bytes after setting it to " << lim << " bytes.");
- else
- LOG_SYS("Failed to get RLIMIT_DATA.");
-
- return true;
- }
else if (tokens[1] == "limit_stack_mem_kb")
{
rlim_t lim = std::stoi(tokens[2]) * 1024;
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index b445c31f..edf4942f 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1772,11 +1772,6 @@ void lokit_main(const std::string& childRoot,
else
LOG_SYS("Failed to get RLIMIT_AS.");
- if (getrlimit(RLIMIT_DATA, &rlim) == 0)
- LOG_INF("RLIMIT_DATA is " << rlim.rlim_max << " bytes.");
- else
- LOG_SYS("Failed to get RLIMIT_DATA.");
-
if (getrlimit(RLIMIT_STACK, &rlim) == 0)
LOG_INF("RLIMIT_STACK is " << rlim.rlim_max << " bytes.");
else
diff --git a/loleaflet/admin.strings.js b/loleaflet/admin.strings.js
index 0850a61a..896dcbc3 100644
--- a/loleaflet/admin.strings.js
+++ b/loleaflet/admin.strings.js
@@ -32,10 +32,9 @@ l10nstrings.strMemoryStatsCachesize = _('Cache size of memory statistics');
l10nstrings.strMemoryStatsInterval = _('Time interval of memory statistics (in ms)');
l10nstrings.strCpuStatsCachesize = _('Cache size of CPU statistics');
l10nstrings.strCpuStatsInterval = _('Time interval of CPU statistics (in ms)');
-l10nstrings.strLimitVirtMemMb = _('Maximum Document process virtual memory (in MB)');
-l10nstrings.strLimitDataMemKb = _('Maximum Document process data memory (in KB)');
-l10nstrings.strLimitStackMemKb = _('Maximum Document process stack memory (in KB)');
-l10nstrings.strLimitFileSizeMb = _('Maximum file size allowed to write to disk (in MB)');
+l10nstrings.strLimitVirtMemMb = _('Maximum Document process virtual memory (in MB) - reduce only');
+l10nstrings.strLimitStackMemKb = _('Maximum Document process stack memory (in KB) - reduce only');
+l10nstrings.strLimitFileSizeMb = _('Maximum file size allowed to write to disk (in MB) - reduce only');
if (module) {
module.exports = l10nstrings;
diff --git a/loleaflet/dist/admin/adminSettings.html b/loleaflet/dist/admin/adminSettings.html
index 668c67d9..cbca6a3a 100644
--- a/loleaflet/dist/admin/adminSettings.html
+++ b/loleaflet/dist/admin/adminSettings.html
@@ -75,29 +75,26 @@
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h1 class="page-header"><script>document.write(l10nstrings.strSettings)</script></h1>
- <form id="admin_settings">
- <label for="mem_stats_size"><script>document.write(l10nstrings.strMemoryStatsCachesize)</script></label>
- <input type="text" id="mem_stats_size" name="Memory Stats Size"><br/>
- <label for="mem_stats_interval"><script>document.write(l10nstrings.strMemoryStatsInterval)</script></label>
- <input type="text" id="mem_stats_interval" name="Memory Stats Interval"><br/>
- <label for="cpu_stats_size"><script>document.write(l10nstrings.strCpuStatsCachesize)</script></label>
- <input type="text" id="cpu_stats_size" name="Cpu Stats Size"><br/>
- <label for="cpu_stats_interval"><script>document.write(l10nstrings.strCpuStatsInterval)</script></label>
- <input type="text" id="cpu_stats_interval" name="Cpu Stats Interval"><br/>
- <label for="limit_virt_mem_mb"><script>document.write(l10nstrings.strLimitVirtMemMb)</script></label>
- <input type="text" id="limit_virt_mem_mb" name="Max Document Virtual Memory MB"><br/>
- <label for="limit_data_mem_kb"><script>document.write(l10nstrings.strLimitDataMemKb)</script></label>
- <input type="text" id="limit_data_mem_kb" name="Max Document Data Memory KB"><br/>
- <label for="limit_stack_mem_kb"><script>document.write(l10nstrings.strLimitStackMemKb)</script></label>
- <input type="text" id="limit_stack_mem_kb" name="Max Document Stack Memory Kb"><br/>
- <label for="limit_file_size_mb"><script>document.write(l10nstrings.strLimitFileSizeMb)</script></label>
- <input type="text" id="limit_file_size_mb" name="Max File Write Size Mb"><br/>
- <script>document.write('<input type="submit" value="' + l10nstrings.strSave + '"/><br/>')</script>
- </form>
- <br />
- <input id="btnShutdown" type="submit" value="Shutdown"/>
- </div>
- </div>
+ <form id="admin_settings">
+ <label for="mem_stats_size"><script>document.write(l10nstrings.strMemoryStatsCachesize)</script></label>
+ <input type="text" id="mem_stats_size" name="Memory Stats Size"><br/>
+ <label for="mem_stats_interval"><script>document.write(l10nstrings.strMemoryStatsInterval)</script></label>
+ <input type="text" id="mem_stats_interval" name="Memory Stats Interval"><br/>
+ <label for="cpu_stats_size"><script>document.write(l10nstrings.strCpuStatsCachesize)</script></label>
+ <input type="text" id="cpu_stats_size" name="Cpu Stats Size"><br/>
+ <label for="cpu_stats_interval"><script>document.write(l10nstrings.strCpuStatsInterval)</script></label>
+ <input type="text" id="cpu_stats_interval" name="Cpu Stats Interval"><br/>
+ <label for="limit_virt_mem_mb"><script>document.write(l10nstrings.strLimitVirtMemMb)</script></label>
+ <input type="text" id="limit_virt_mem_mb" name="Max Document Virtual Memory MB"><br/>
+ <label for="limit_stack_mem_kb"><script>document.write(l10nstrings.strLimitStackMemKb)</script></label>
+ <input type="text" id="limit_stack_mem_kb" name="Max Document Stack Memory Kb"><br/>
+ <label for="limit_file_size_mb"><script>document.write(l10nstrings.strLimitFileSizeMb)</script></label>
+ <input type="text" id="limit_file_size_mb" name="Max File Write Size Mb"><br/>
+ <script>document.write('<input type="submit" value="' + l10nstrings.strSave + '"/><br/>')</script>
+ </form>
+ <br />
+ <input id="btnShutdown" type="submit" value="Shutdown"/>
+ </div>
</div>
</div>
</body>
diff --git a/loleaflet/src/admin/AdminSocketSettings.js b/loleaflet/src/admin/AdminSocketSettings.js
index 27c0be90..e44fe289 100644
--- a/loleaflet/src/admin/AdminSocketSettings.js
+++ b/loleaflet/src/admin/AdminSocketSettings.js
@@ -24,7 +24,6 @@ var AdminSocketSettings = AdminSocketBase.extend({
command += ' cpu_stats_size=' + cpuStatsSize;
command += ' cpu_stats_interval=' + cpuStatsInterval;
command += ' limit_virt_mem_mb=' + $('#limit_virt_mem_mb').val();
- command += ' limit_data_mem_kb=' + $('#limit_data_mem_kb').val();
command += ' limit_stack_mem_kb=' + $('#limit_stack_mem_kb').val();
command += ' limit_file_size_mb=' + $('#limit_file_size_mb').val();
socketSettings.send(command);
diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index ca1bc950..3d4a8fb6 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -174,7 +174,6 @@ void AdminSocketHandler::handleMessage(bool /* fin */, WSOpCode /* code */,
const DocProcSettings& docProcSettings = _admin->getDefDocProcSettings();
oss << "limit_virt_mem_mb=" << docProcSettings.LimitVirtMemMb << ' '
- << "limit_data_mem_kb=" << docProcSettings.LimitDataMemKb << ' '
<< "limit_stack_mem_kb=" << docProcSettings.LimitStackMemKb << ' '
<< "limit_file_size_mb=" << docProcSettings.LimitFileSizeMb << ' ';
@@ -241,25 +240,13 @@ void AdminSocketHandler::handleMessage(bool /* fin */, WSOpCode /* code */,
{
DocProcSettings docProcSettings = _admin->getDefDocProcSettings();
if (settingName == "limit_virt_mem_mb")
- {
docProcSettings.LimitVirtMemMb = settingVal;
- }
- else if (settingName == "limit_data_mem_kb")
- {
- docProcSettings.LimitDataMemKb = settingVal;
- }
else if (settingName == "limit_stack_mem_kb")
- {
docProcSettings.LimitStackMemKb = settingVal;
- }
else if (settingName == "limit_file_size_mb")
- {
docProcSettings.LimitFileSizeMb = settingVal;
- }
else
- {
LOG_ERR("Unknown limit: " << settingName);
- }
model.notify("settings " + settingName + '=' + std::to_string(settingVal));
_admin->setDefDocProcSettings(docProcSettings);
@@ -502,7 +489,6 @@ void Admin::notifyForkit()
{
std::ostringstream oss;
oss << "setconfig limit_virt_mem_mb " << _defDocProcSettings.LimitVirtMemMb << '\n'
- << "setconfig limit_data_mem_kb " << _defDocProcSettings.LimitDataMemKb << '\n'
<< "setconfig limit_stack_mem_kb " << _defDocProcSettings.LimitStackMemKb << '\n'
<< "setconfig limit_file_size_mb " << _defDocProcSettings.LimitFileSizeMb << '\n';
IoUtil::writeToPipe(_forKitWritePipe, oss.str());
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 0aead10a..a981d2e0 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -625,7 +625,6 @@ void LOOLWSD::initialize(Application& self)
{ "per_document.max_concurrency", "4" },
{ "per_document.idle_timeout_secs", "3600" },
{ "per_document.limit_virt_mem_mb", "0" },
- { "per_document.limit_data_mem_kb", "0" },
{ "per_document.limit_stack_mem_kb", "8000" },
{ "per_document.limit_file_size_mb", "50" },
{ "per_view.out_of_focus_timeout_secs", "60" },
@@ -809,7 +808,6 @@ void LOOLWSD::initialize(Application& self)
DocProcSettings docProcSettings;
docProcSettings.LimitVirtMemMb = getConfigValue<int>("per_document.limit_virt_mem_mb", 0);
- docProcSettings.LimitDataMemKb = getConfigValue<int>("per_document.limit_data_mem_kb", 0);
docProcSettings.LimitStackMemKb = getConfigValue<int>("per_document.limit_stack_mem_kb", 0);
docProcSettings.LimitFileSizeMb = getConfigValue<int>("per_document.limit_file_size_mb", 0);
Admin::instance().setDefDocProcSettings(docProcSettings);
@@ -1173,7 +1171,6 @@ bool LOOLWSD::createForKit()
const DocProcSettings& docProcSettings = Admin::instance().getDefDocProcSettings();
std::ostringstream ossRLimits;
ossRLimits << "limit_virt_mem_mb:" << docProcSettings.LimitVirtMemMb;
- ossRLimits << ";limit_data_mem_kb:" << docProcSettings.LimitDataMemKb;
ossRLimits << ";limit_stack_mem_kb:" << docProcSettings.LimitStackMemKb;
ossRLimits << ";limit_file_size_mb:" << docProcSettings.LimitFileSizeMb;
args.push_back("--rlimits=" + ossRLimits.str());
More information about the Libreoffice-commits
mailing list