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

vfn/support: introduce rwlock and convert mutex to rwlock for IOMMU look-up #30

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

minwooim
Copy link
Collaborator

No description provided.

@minwooim minwooim requested a review from birkelund December 24, 2024 00:44
@minwooim minwooim added the enhancement New feature or request label Dec 24, 2024
@minwooim
Copy link
Collaborator Author

I guess pr / check-patch (pull_request) Failing after 2s failure can be ignored since the newly added file vfn/support/rwlock.h just followed the existing style of vfn/support/mutex.h.

@birkelund
Copy link
Collaborator

Awesome stuff! What a Christmas present!

Add support pthread_rwlock_t to vfn/support like existing mutex support.
This patch is a prep patch for the following patches introducing
improvement of thread scalability when looking up the IOMMU page table
in multiple threads.

Signed-off-by: Minwoo Im <[email protected]>
The mapping table managed for IOMMU page table is a skiplist protected
by mutex with @map->lock. This has led performance impact with multiple
threads looking up the page table at the same time, especially when
manipulating PRP or SGL data structures per I/O.

Application might optimize their own IOMMU-related paths like they
prepare the bulk of memory buffers at the beginning time and map them to
IOMMU at that time.  After that, they can do I/Os based on pre-mapped
memory buffers without inserting or deleting entries from page tables.

To improve performance scalability, convert existing mutex @map->lock to
read-write lock which leads to great performance on read(look-up)-most
scenarios.

Signed-off-by: Minwoo Im <[email protected]>
@birkelund birkelund added the approved Approved for device testing label Jan 6, 2025
This has been used in nowhere.

Signed-off-by: Minwoo Im <[email protected]>
@birkelund birkelund merged commit f89e95f into main Jan 6, 2025
25 of 26 checks passed
@birkelund birkelund deleted the rwlock branch January 6, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for device testing enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants