-
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
Add kpreempt_disable/enable around CPU_SEQID uses to fix kernel BUG warnings #6239
Conversation
1208c91
to
ea52ad9
Compare
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.
The code looks good, but we'll want to drop the slightly misleading comment (explained inline). Also when you refresh this please add your signed-off-by to the commit message so we can merge it.
module/zfs/dmu_object.c
Outdated
/* | ||
* Pick the current CPU. We need to disable preemption to ensure that | ||
* we don't get interrupted (and pick the wrong CPU). | ||
*/ |
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 this case it isn't really about picking the wrong cpu, it's about using the current cpu as a hint to minimize lock contention. The code is written is such a way that it's safe for this function to be rescheduled at any time to a different cpu. I'd suggest dropping the comment here to avoid any confusion.
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.
fixed
ea52ad9
to
418aa38
Compare
In zfs/dmu_object and icp/core/kcf_sched, the CPU_SEQID macro should be surrounded by `kpreempt_disable` and `kpreempt_enable` calls to avoid a Linux kernel BUG warning. Signed-off-by: Morgan Jones <me@numin.it>
418aa38
to
cea8810
Compare
@numinit were you able to verify this resolved the warnings. |
Yes, this resolves the warnings for me. Removing the testing WIP label. |
@numinit great, thanks for the confirmation. Will merge. |
Description
In
zfs/dmu_object
andicp/core/kcf_sched
, theCPU_SEQID
macro should be surrounded bykpreempt_disable
andkpreempt_enable
calls to avoid a Linux kernel BUG warning.Motivation and Context
Remediating frequent (but mostly harmless) Linux kernel BUG warnings during use of the ZFS 0.7 release candidate (see #6232)
How Has This Been Tested?
Compiled and installed the module. The system affected by #6232 no longer gets these BUG warnings in its dmesg.
Types of changes
Checklist:
Signed-off-by
.