From: Jonas Malaco <jonas@protocubo.io>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (nzxt-kraken2) mark and order concurrent accesses
Date: Tue, 30 Mar 2021 14:53:02 -0300 [thread overview]
Message-ID: <20210330175302.ihsmijnidxjhmcqa@calvin.localdomain> (raw)
In-Reply-To: <38c76eb1-808a-1c9a-2494-208270a66e14@roeck-us.net>
On Tue, Mar 30, 2021 at 03:51:21AM -0700, Guenter Roeck wrote:
> [ ... ]
>
> Then please explain why _this_ use of time_after() is wrong but all
> others in the kernel are not. Also, please note that we are not
> concerned with code generation by the compiler as long as the
> generated code is correct (and I don't see any indication that
> it isn't).
The accesses to priv->temp_input[], ->fan_input[] and ->updated (where
this relates to your question about time_after()) are not wrong, but
undefined.
But if we are not concerned with code that is currently generated
correctly, which indeed is the case in the five arch x compiler
combinations I tested, then there simply is no point to this patch.
Thanks for going through this with me,
Jonas
P.S. Admittedly from a sample way too small, but in the kernel
time_after(jiffies, x) calls do not generally appear to involve an
expression x with a data race. And there are a few calls where
READ_ONCE() is indeed used in x.
prev parent reply other threads:[~2021-03-30 17:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-29 8:22 [PATCH] hwmon: (nzxt-kraken2) mark and order concurrent accesses Jonas Malaco
2021-03-29 21:53 ` Guenter Roeck
2021-03-30 0:21 ` Jonas Malaco
2021-03-30 1:01 ` Guenter Roeck
2021-03-30 3:16 ` Jonas Malaco
2021-03-30 5:43 ` Guenter Roeck
2021-03-30 6:27 ` Jonas Malaco
2021-03-30 10:51 ` Guenter Roeck
2021-03-30 17:53 ` Jonas Malaco [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210330175302.ihsmijnidxjhmcqa@calvin.localdomain \
--to=jonas@protocubo.io \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).