Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mxqd: remove RLIMIT_AS and RLIMIT_RSS
Remove RLIMIT_AS, because we to limit physical memory usage, not virtual
memory for file-backed mappings.

Remove RLIMIT_RSS, because this limit has no effect since Linux 2.4.30.
  • Loading branch information
donald committed Apr 2, 2022
1 parent cdfab91 commit c7c6544
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions mxqd.c
Expand Up @@ -930,21 +930,11 @@ static int init_child_process(struct mxq_group_list *glist, struct mxq_job *job)
rlim.rlim_cur = group->job_memory*1024*1024;
rlim.rlim_max = group->job_memory*1024*1024;

res = setrlimit(RLIMIT_AS, &rlim);
if (res == -1)
mx_log_err("job=%s(%d):%lu:%lu setrlimit(RLIMIT_AS, ...) failed: %m",
group->user_name, group->user_uid, group->group_id, job->job_id);

res = setrlimit(RLIMIT_DATA, &rlim);
if (res == -1)
mx_log_err("job=%s(%d):%lu:%lu setrlimit(RLIMIT_DATA, ...) failed: %m",
group->user_name, group->user_uid, group->group_id, job->job_id);

res = setrlimit(RLIMIT_RSS, &rlim);
if (res == -1)
mx_log_err("job=%s(%d):%lu:%lu setrlimit(RLIMIT_RSS, ...) failed: %m",
group->user_name, group->user_uid, group->group_id, job->job_id);

/* disable core files */
rlim.rlim_cur = 0;
rlim.rlim_cur = 0;
Expand Down

0 comments on commit c7c6544

Please sign in to comment.