-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
QAT related bug fixes #9303
QAT related bug fixes #9303
Conversation
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.
Thanks for running this down, this looks good to me.
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 looks right to me. I would want @wli5's opinion here if he has a minute, just to confirm that there isn't a deeper reason for the wait_for_completion_interruptible_timeout()
@@ -403,11 +403,7 @@ qat_compress_impl(qat_compress_dir_t dir, char *src, int src_len, | |||
} | |||
|
|||
/* we now wait until the completion of the operation. */ | |||
if (!wait_for_completion_interruptible_timeout(&complete, | |||
QAT_TIMEOUT_MS)) { |
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.
Can we remove QAT_TIMEOUT_MS
?
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.
it's done, thanks.
Codecov Report
@@ Coverage Diff @@
## master #9303 +/- ##
==========================================
- Coverage 79.14% 79.1% -0.05%
==========================================
Files 401 401
Lines 122077 122063 -14
==========================================
- Hits 96617 96557 -60
- Misses 25460 25506 +46
Continue to review full report at Codecov.
|
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.
Looks good, thanks! Just one small nit.
bcopy(op_data.pDigestResult, digest_buf, ZIO_DATA_MAC_LEN); | ||
/* if dir is QAT_ENCRYPT, save pDigestResult to digest_buf */ | ||
if (dir == QAT_ENCRYPT) | ||
bcopy(op_data.pDigestResult, digest_buf, ZIO_DATA_MAC_LEN); |
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.
nit: I missed this on my first read through, but it would be less redundant to move the bcopy
in to the existing if (dir == QAT_ENCRYPT)
just two lines down.
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.
It's done, thanks
1. Fix issue: Kernel BUG with QAT during decompression #9276. Now it is uninterruptible for a specific given QAT request, but Ctrl-C interrupt still works in user-space process. 2. Copy the digest result to the buffer only when doing encryption, and vise-versa for decryption. Signed-off-by: Chengfei Zhu <chengfeix.zhu@intel.com>
1. Fix issue: Kernel BUG with QAT during decompression openzfs#9276. Now it is uninterruptible for a specific given QAT request, but Ctrl-C interrupt still works in user-space process. 2. Copy the digest result to the buffer only when doing encryption, and vise-versa for decryption. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chengfei Zhu <chengfeix.zhu@intel.com> Closes openzfs#9276 Closes openzfs#9303
1. Fix issue: Kernel BUG with QAT during decompression openzfs#9276. Now it is uninterruptible for a specific given QAT request, but Ctrl-C interrupt still works in user-space process. 2. Copy the digest result to the buffer only when doing encryption, and vise-versa for decryption. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chengfei Zhu <chengfeix.zhu@intel.com> Closes openzfs#9276 Closes openzfs#9303
1. Fix issue: Kernel BUG with QAT during decompression openzfs#9276. Now it is uninterruptible for a specific given QAT request, but Ctrl-C interrupt still works in user-space process. 2. Copy the digest result to the buffer only when doing encryption, and vise-versa for decryption. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chengfei Zhu <chengfeix.zhu@intel.com> Closes openzfs#9276 Closes openzfs#9303
1. Fix issue: Kernel BUG with QAT during decompression openzfs#9276. Now it is uninterruptible for a specific given QAT request, but Ctrl-C interrupt still works in user-space process. 2. Copy the digest result to the buffer only when doing encryption, and vise-versa for decryption. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chengfei Zhu <chengfeix.zhu@intel.com> Closes openzfs#9276 Closes openzfs#9303
1. Fix issue: Kernel BUG with QAT during decompression openzfs#9276. Now it is uninterruptible for a specific given QAT request, but Ctrl-C interrupt still works in user-space process. 2. Copy the digest result to the buffer only when doing encryption, and vise-versa for decryption. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chengfei Zhu <chengfeix.zhu@intel.com> Closes openzfs#9276 Closes openzfs#9303
1. Fix issue: Kernel BUG with QAT during decompression openzfs#9276. Now it is uninterruptible for a specific given QAT request, but Ctrl-C interrupt still works in user-space process. 2. Copy the digest result to the buffer only when doing encryption, and vise-versa for decryption. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chengfei Zhu <chengfeix.zhu@intel.com> Closes openzfs#9276 Closes openzfs#9303
1. Fix issue: Kernel BUG with QAT during decompression #9276. Now it is uninterruptible for a specific given QAT request, but Ctrl-C interrupt still works in user-space process. 2. Copy the digest result to the buffer only when doing encryption, and vise-versa for decryption. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chengfei Zhu <chengfeix.zhu@intel.com> Closes #9276 Closes #9303
Motivation and Context
pressing Ctrl+C to abort the command. Kernel BUG with QAT during decompression #9276
As wait_for_completion_interruptible_timeout() is interruptible. the
fuction
qat_compress_impl()
will return when pressing Ctrl + C.it will free the memory resources that have been allocated.
When the callback function
qat_dc_callback
is called, it will accessthe memory that has been freed.
QAT encryption&checksum have the same issue.
Description
wait_for_completion_interruptible_timeout()
towait_for_completion()
to make each QAT call uninterruptible,but Ctrl-C interrupt still works in user-space process.
and vise-versa for decryption.
How Has This Been Tested?
When reading a file with dd from a dataset with QAT enabled,
press Ctrl+C to abort the command, the kernel don't not crash.
Types of changes
Checklist:
Signed-off-by
.