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

HugeTLB and mlock support? #4

Closed
dovahcrow opened this issue Nov 8, 2022 · 3 comments · Fixed by #5
Closed

HugeTLB and mlock support? #4

dovahcrow opened this issue Nov 8, 2022 · 3 comments · Fixed by #5

Comments

@dovahcrow
Copy link
Contributor

dovahcrow commented Nov 8, 2022

Hi, I'm trying to add hugetlb and mlock support for the shared memory region to further increase the performance at https://github.com/dovahcrow/shmem-ipc. I can create a PR if you want to make these changes into the main repo.

Note that the implementation is not finished: I am stuck at using set_len to increase the size of the memfd (https://github.com/dovahcrow/shmem-ipc/blob/master/src/mem.rs#L81): it always returns EINVAL, and I haven't found a solution yet. By reading the Linux source code, it turned out hugetlb does not need set_len!

Any suggestion is welcomed!

@diwic
Copy link
Owner

diwic commented Nov 8, 2022

Sounds interesting! What performance gains do you expect from this?

Also, I guess both will be configurable and turned off by default? At least mlock should be opt-in. Maybe hugetlb would depend on the buffer size or something, I'm not very familiar with hugetlb and what pros and cons that has.

@dovahcrow
Copy link
Contributor Author

Yep, they are optional in my implementation. I didn't test the performance gain. These two just seems to me a quite standard way to have high-performance shmem

@diwic
Copy link
Owner

diwic commented Nov 8, 2022

If you already have an implementation I'd be happy to review it.

diwic added a commit to diwic/memmap2-rs that referenced this issue Nov 9, 2022
More specifically to be able to add mlock support to shmem-ipc,
but let's add all the others while we're at it.

diwic/shmem-ipc#4
diwic added a commit to diwic/memmap2-rs that referenced this issue Nov 9, 2022
More specifically to be able to add mlock support to shmem-ipc.

diwic/shmem-ipc#4
@diwic diwic closed this as completed in #5 Nov 22, 2022
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 a pull request may close this issue.

2 participants