-
Notifications
You must be signed in to change notification settings - Fork 7
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
Changes to support mmap reads on Broker #57
base: main
Are you sure you want to change the base?
Conversation
bef45cc
to
a776a0a
Compare
src/utils/read_all.c
Outdated
void * allocate_aligned(size_t size) { | ||
size_t alignment = getpagesize(); | ||
int malloc_offset = (size + alignment) % alignment; | ||
void* mem = malloc(size + alignment); | ||
return (char*) mem + malloc_offset; | ||
} |
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.
I do not think that this will guarantee that the address is a multiple of alignment, while the size of the usable block is. In addition, i am wondering if it would be safe to use such an address with munmap()
.
We can instead rely on posix_memalign()
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.
I left some comments but I know you will be on vacation. So, I can make changes if you agree with my comments.
@@ -37,8 +46,13 @@ ssize_t write_all (int fd, const void *buf, size_t len) | |||
return count; | |||
} | |||
|
|||
ssize_t read_all (int fd, void **bufp) | |||
ssize_t read_all (const char* filename, void **bufp) |
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.
This interface probably should take a page aligned memory address as an input for the UCX managed memory. So, the allocation would happen outside of this function.
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.
That is the buffer bufp. Once we do the UCX, we can move allocation there.
cc2f91e
to
3e9a46c
Compare
@JaeseungYeom do u want me to work on this? |
Need to check the following before continuing:
|
Changes to support mmaped reads on broker.