Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically bump memlock ulimit #298

Merged
merged 1 commit into from
Nov 30, 2015
Merged

Automatically bump memlock ulimit #298

merged 1 commit into from
Nov 30, 2015

Conversation

drzaeus77
Copy link
Collaborator

Instead of requiring the user to bump the ulimit in their shell before
starting a bcc script, try to setrlimit automatically when a failure
occurs. Since there is no getrusage for memlock limit, unfortunately we
have to brute force setting the limit. For now, just try bpf() once and
then try to set unlimited ulimit, then try bpf() again.

Fixes: #281
Signed-off-by: Brenden Blanco [email protected]

Instead of requiring the user to bump the ulimit in their shell before
starting a bcc script, try to setrlimit automatically when a failure
occurs. Since there is no getrusage for memlock limit, unfortunately we
have to brute force setting the limit. For now, just try bpf() once and
then try to set unlimited ulimit, then try bpf() again.

Fixes: #281
Signed-off-by: Brenden Blanco <[email protected]>
@4ast
Copy link
Member

4ast commented Nov 30, 2015

looks good to me.

drzaeus77 added a commit that referenced this pull request Nov 30, 2015
Automatically bump memlock ulimit
@drzaeus77 drzaeus77 merged commit 8a04fb3 into master Nov 30, 2015
AlexanderKurtz added a commit to AlexanderKurtz/alfwrapper that referenced this pull request Aug 30, 2017
After reading iovisor/bcc#279, iovisor/bcc#281, and iovisor/bcc#298 we
realized that the kernel counts eBPF maps towards the "locked memory"
(== non-swapable memory) which is typically limited to 64 KiB for
non-priviledged users (see the output of "ulimit -a" for details), so this
is necessary so that unpriviledged users can run this filter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants