-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add split lock #140
Add split lock #140
Conversation
splitlock/sl_test.c
Outdated
free(line); | ||
fclose(fp); | ||
if (!ret) { | ||
printf("Fail: no split_lock_detect in /proc/cpuinfo\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.
Hi Tony,
How do you think changing his message to this:
"[ERR] no split_lock_detect in /proc/cpuinfo"
"split_lock_dect [FAIL]"
Split this message into two lines: one for the detailed information and the other for the result.
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.
Will modify it with split_lock_dect [FAIL]
splitlock/sl_test.c
Outdated
ret = 0; | ||
pclose(fp); | ||
|
||
printf("split lock detection:%d\n", ret); |
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.
split_lock_dect [PASS]
split_lock_dect [FAIL]
1, I believe signal catching is necessary to determine whether this test has passed or not.
2 From my perspective, it's insufficient to rely on reading "split lock detection" in dmesg to confirm the success of this test, as it could have been previously dumped.
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.
Will move dmesg check to the test script. When the default of split_lock_detect is on or it is set as warn, #AC will be triggered and output to dmesg. But if it is set as fatal, kernel will send SIGBUS on user-space, no #AC message is output.
{ | ||
printf("Caught SIGBUS/#AC due to split locked access\n"); | ||
|
||
exit(-1); |
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.
confirm the exit code -1 or 0 ?
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.
catch_sigbus is a void function, it is to handle user space SIGBUS which is sent by kernel. For test purpose, print out a message is enough. To mark it is abnormal, use non zero is OK, whatever it is 1 or -1.
635e74e
to
93b809b
Compare
This test app will use "lock addl" instruction to trigger #AC in hardware and kernel. Signed-off-by: Tony Zhu <[email protected]>
This test includes two test items, the first one will check cpuinfo, the second one will call split lock test to trigger an execption. Signed-off-by: Tony Zhu <[email protected]>
This document introduces what is split lock and how to test it in user mode. Signed-off-by: Tony Zhu <[email protected]>
93b809b
to
d10af05
Compare
A split lock is any atomic operation whose operand crosses two cache lines.
Add split test including test application, test items and the document.