llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Paul Heidekrüger" <paul.heidekrueger@in.tum.de>
Cc: paulmck@kernel.org, will@kernel.org, boqun.feng@gmail.com,
	stern@rowland.harvard.edu, parri.andrea@gmail.com,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
	elver@google.com, charalampos.mainas@gmail.com,
	pramod.bhatotia@in.tum.de
Subject: Re: Potentially Broken Address Dependency via test_bit() When Compiling With Clang
Date: Wed, 27 Oct 2021 14:34:29 +0200	[thread overview]
Message-ID: <20211027123429.GE174730@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20211027121747.GI174703@worktop.programming.kicks-ass.net>

On Wed, Oct 27, 2021 at 02:17:48PM +0200, Peter Zijlstra wrote:
> On Wed, Oct 27, 2021 at 12:19:48PM +0200, Paul Heidekrüger wrote:
> I would personally not consider this a dependend load. The result
> depends on two loads, but there is no actual ordering between them.
> 
>   r1 = *x
>   r2 = *y
>   b = 1 & (r1 >> r2);
> 
> (more or less)

melver pointed out on IRC that I missed the whole BIT_WORD(nr) thing.
And with that restored this should indeed be an address dependency.

Still, I wasn't actually expecting test_bit() to be one. Nice find.

  parent reply	other threads:[~2021-10-27 12:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 10:19 Potentially Broken Address Dependency via test_bit() When Compiling With Clang Paul Heidekrüger
2021-10-27 11:56 ` David Laight
2021-10-27 12:17 ` Peter Zijlstra
2021-10-27 12:24   ` Marco Elver
2021-10-27 12:34   ` Peter Zijlstra [this message]
2021-10-27 14:27 ` Alan Stern
2021-10-28 12:37   ` Paul Heidekrüger
2021-10-28 14:34     ` Alan Stern
2021-11-02 18:35       ` Paul Heidekrüger
2021-11-02 19:01         ` Alan Stern
2021-11-04 18:16           ` Paul E. McKenney

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=20211027123429.GE174730@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=boqun.feng@gmail.com \
    --cc=charalampos.mainas@gmail.com \
    --cc=elver@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=parri.andrea@gmail.com \
    --cc=paul.heidekrueger@in.tum.de \
    --cc=paulmck@kernel.org \
    --cc=pramod.bhatotia@in.tum.de \
    --cc=stern@rowland.harvard.edu \
    --cc=will@kernel.org \
    /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).