-
Notifications
You must be signed in to change notification settings - Fork 141
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
Sanity test suite #71
Conversation
0a33407
to
1be645a
Compare
@pakmarkthub now that the other PR of yours has been merged into the upstream invalidate branch, could you please rebase your dev-sanity-unittest tree? |
…ted invalidation_one_process test case
…not interfere with each other
…nix socket does not work
…lidation_fork_access_after_cumemfree
…ible with libcheck from version 0.9.8
…ssociated resources
…" clean up to gdrdrv, and added *.swp to .gitignore
… "C" to gdrapi_internal.h
1be645a
to
c801763
Compare
@drossetti Rebased. Please take a look. |
I've executed the
Few comments:
I still have to go through the entire code |
Thank you @e-ago. dmesg is a good catch. I should use gdr_dbg instead of gdr_err to suppress the message. By the way, this is the expected behavior because "sanity" verifies that Process A cannot spy on Process B via gdrcopy. |
@e-ago I have fixed the code according to your comments. Please take a look. |
memset(copy_buf, 0xA5, size * sizeof(*copy_buf)); | ||
|
||
print_dbg("check 2: gdr_copy_to_bar() + read back via cuMemcpy D->H\n"); | ||
gdr_copy_to_bar(buf_ptr, init_buf, size); |
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.
In check 1
test you already set the value of buf_ptr
with the same values ininit_buf
. Maybe you can cleanup buf_ptr
before copying again init_buf
values with a different method (as you do for copy_buf
)
compare_buf(init_buf, copy_buf, size - extra_off); | ||
memset(copy_buf, 0xA5, size * sizeof(*copy_buf)); | ||
|
||
extra_off = 11; |
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.
Did you chose 11 to not use an aligned value?
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.
Davide wrote this test. I guess that is his intention.
@@ -339,7 +339,7 @@ static int gdrdrv_release(struct inode *inode, struct file *filp) | |||
} | |||
// Check that the caller is the same process that did gdrdrv_open | |||
if (info->pid != task_pid(current)) { | |||
gdr_err("filp is not opened by the current process\n"); | |||
gdr_dbg("filp is not opened by the current process\n"); |
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 should prevent the dmesg messages I was observing
ASSERT_EQ(gdr_close(g), 0); | ||
|
||
print_dbg("Trying to read buf_ptr[0] after gdr_close\n"); | ||
expecting_exception_signal = true; |
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.
What about a memory barrier here (and in the next tests at this point) to prevent any reordering?
@e-ago I updated the code. Please take a look. |
Merged |
This PR depends on PR #60. DO NOT merge it before merging PR #60.
This change: