-
Notifications
You must be signed in to change notification settings - Fork 806
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
Memory map: mmap+memcopy instead pread+pwrite #11484
base: master
Are you sure you want to change the base?
Conversation
Thanks for making the PR against the master branch. Should #10832 be closed? |
Yes #10832 should be closed. As per the comment, it has been merged into the master branch. |
[approve ci] |
@monkuta Please run |
Changes have been made. (6df2474) |
@monkuta Do you have benchmarking number without and with this change? |
@bryancall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making this PR. Why is it that the stripe mutex is needed for mmap I/O when it's not needed for syscall I/O?
src/iocore/aio/AIO.cc
Outdated
#endif | ||
} else { | ||
#ifdef AIO_FAULT_INJECTION | ||
err = aioFaultInjection.pwrite(a->aio_fildes, (static_cast<char *>(a->aio_buf)) + res, a->aio_nbytes - res, | ||
a->aio_offset + res); | ||
#else | ||
#if TS_USE_MMAP | ||
ink_assert((static_cast<char const *>(a->aio_fildes.first) + a->aio_offset + a->aio_nbytes) <= a->aio_fildes.last); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto here
Allows for only-in-memory caching for usecases where such behavior is needed (i.e. Live Video caching). It maps storage directly into user space memory, so reads and writes are being done by a memcpy (without calls to io).
To build:
cmake -B build -DENABLE_HWLOC=ON -DENABLE_MMAP=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
cmake --build build -j
cmake --install build