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

Validate system shared memory region size when registering a region #7093

Merged
merged 6 commits into from
Apr 11, 2024

Conversation

rmccorm4
Copy link
Contributor

@rmccorm4 rmccorm4 commented Apr 10, 2024

This PR:

  • Validate System SHM region size during registration
  • Add system shm registration tests

Deferred to separate PRs:

  • Validate CUDA SHM region size
    • need to investigate the right way to query device pointer allocated size from cuIPC handle
  • Validate System SHM file/user permissions
    • need a test to validate the existing code would fail with bad permissions when container is setup with a non-root user (ex: shm_open)

ref: DLIS-6198

@rmccorm4
Copy link
Contributor Author

Added tests for system shm registration to L0_shared_memory.

  • Tests fail locally before server-side changes, and pass after server-side changes ✅

nnshah1
nnshah1 previously approved these changes Apr 11, 2024
Copy link
Contributor

@nnshah1 nnshah1 left a comment

Choose a reason for hiding this comment

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

LGTM

@nnshah1
Copy link
Contributor

nnshah1 commented Apr 11, 2024

@rmccorm4 , @fpetrini15

Small, non blocking items:

I also thought while reading that GetSharedMemoryRegionSize was more intuitive than Info as we weren't getting more information. At the moment - I'm hoping permissions are checked when we actual do the map for reading / writing and don't need to be checked independently. If we do have to do more checks we could update it then. Also the comment says metadata, maybe GetSharedMemoryRegionMetadata ?

Another small tweak could be to wrap the validation into a function: CheckRegionSize()

struct stat sb -> struct stat file_status?

sb wasn't immediately clear to me - it's not used very much

These are all minor - and non blocking.

Tabrizian
Tabrizian previously approved these changes Apr 11, 2024
@rmccorm4 rmccorm4 dismissed stale reviews from Tabrizian and nnshah1 via 255311b April 11, 2024 17:06
@rmccorm4 rmccorm4 requested review from nnshah1 and Tabrizian April 11, 2024 17:08
Copy link
Contributor

@fpetrini15 fpetrini15 left a comment

Choose a reason for hiding this comment

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

TM,LG! 🚀

@rmccorm4 rmccorm4 merged commit 6b97652 into main Apr 11, 2024
3 checks passed
@rmccorm4 rmccorm4 deleted the rmccmormick-shm-registration branch April 11, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants