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

blog: Add GSoC'24 blog on debugging mimalloc port #448

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

huyang531
Copy link
Contributor

Signed-off-by: Yang Hu [email protected]

@StefanJum
Copy link
Member

@huyang531 I see this is marked as draft. Any reason for that?

@huyang531 huyang531 marked this pull request as ready for review August 6, 2024 04:27
@huyang531
Copy link
Contributor Author

huyang531 commented Aug 6, 2024

@huyang531 I see this is marked as draft. Any reason for that?

Not really. I just marked this as ready for review.

Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @huyang531, see the inlines.

Also @razvanvirtan @RaduNichita please do a content check.


## Current Progress

Following porting the multithreaded `cache-scratch` stress test in [the last blog post](https://unikraft.org/blog/2024-07-12-unikraft-gsoc-test-mimalloc-on-unikraft), this past three weeks I have been debugging the it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Following porting the multithreaded `cache-scratch` stress test in [the last blog post](https://unikraft.org/blog/2024-07-12-unikraft-gsoc-test-mimalloc-on-unikraft), this past three weeks I have been debugging the it.
Following porting the multithreaded `cache-scratch` stress test in [the last blog post](https://unikraft.org/blog/2024-07-12-unikraft-gsoc-test-mimalloc-on-unikraft), this past three weeks I have been debugging the it.

This is unclear to me, can you rephrase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

### Debugging `pthread`

The [first error we ran into](https://unikraft.org/blog/2024-07-12-unikraft-gsoc-test-mimalloc-on-unikraft#testing) was a memory corruption error with the `pthread` interface.
After investigating the `pthread_join()` calls, I found that the threads were never even created correctly at all because `pthread_create()` uses the POSIX `mmap` system call, which never existed as we did not turn on virtual memory support (i.e., `ukvmem` alongside `posix-mmap`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should go that deep into technical details

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote the blog in sort of chronological order - it was because of thispthread bug that I turned on virtual memory support, hence the rest. I have shortened the paragraph but still kept it here.

In order to resolve the abovementioned issues, I still have much to study about Unikraft's virtual memory management subsystem, its boot process, and how *mimalloc* works under the hood - and I will focus on just that in the following weeks.

Hopefully, with those issues fixed, we could finally get the `cache-scratch` test running on multiple cores.
Once that is done, I will get back on track with my "global" TODO list:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mention what ideas do you have for benchmarking?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have written much about benchmarking (i.e., which benchmarks I would use, what they are for, etc.) in my last blog post so I didn't elaborate here. I will attach a link to my last blog post

Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Stefan Jumarea [email protected]
Approved-by: Stefan Jumarea [email protected]

@StefanJum StefanJum merged commit 264b208 into unikraft:main Aug 11, 2024
2 checks passed
@huyang531 huyang531 deleted the gsoc-blog-3 branch August 15, 2024 00:52
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.

3 participants