Messages in this thread | | | Date | Thu, 21 Feb 2019 10:22:13 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH v2 1/3] x86/cpufeatures: Enumerate user wait instructions |
| |
On Wed, Feb 20, 2019 at 10:37:27PM -0800, Andy Lutomirski wrote: > On Wed, Feb 20, 2019 at 7:44 PM Tao Xu <tao3.xu@intel.com> wrote:
> > +static ssize_t umwait_enable_c0_2_show(struct device *dev, > > + struct device_attribute *attr, > > + char *buf) > > +{ > > + return sprintf(buf, "%d\n", umwait_enable_c0_2); > > I realize that it's traditional to totally ignore races in sysfs and > such, but it's a bad tradition. Please either READ_ONCE it with a > comment or take the mutex.
Note that when using READ_ONCE(), the other side must use WRITE_ONCE(). Mixed usage is not valid.
| |