All of lore.kernel.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Stephane Eranian <eranian@google.com>,
	linux-kernel@vger.kernel.org, tony.luck@intel.com,
	reinette.chatre@intel.com, fenghua.yu@intel.com,
	peternewman@google.com, james.morse@arm.com, babu.moger@amd.com,
	ananth.narayan@amd.com, vschneid@redhat.com,
	Nathan Chancellor <nathan@kernel.org>,
	clang-built-linux <llvm@lists.linux.dev>,
	Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-toolchains@vger.kernel.org
Subject: Re: [PATCH] x86/resctrl: avoid compiler optimization in __resctrl_sched_in
Date: Tue, 7 Mar 2023 12:43:16 -0600	[thread overview]
Message-ID: <20230307184315.GS25951@gate.crashing.org> (raw)
In-Reply-To: <20230307113545.GB2017917@hirez.programming.kicks-ass.net>

Hi!

On Tue, Mar 07, 2023 at 12:35:45PM +0100, Peter Zijlstra wrote:
> So per that summary, I'm going to nit-pick and state we very much want
> CSE. CSE good. What we don't want it violating store-load ordering.

So you need to describe exactly what you *do* want.  There is no way to
forbid most otherwise valid things.  But you can express pretty much all
dependencies.

> Oh, geez, what a twisty tale that... So Linus knew back in '09 that "p"
> was icky, but it sorta was the only thing and it 'worked' -- until now
> :/

The "p" constraint is just like any other address_constraint, in most
aspects.  Since this is very specific to "p", that limits what is going
on to really just one thing.

For "p", after reload, strict_memory_address_addr_space_p is used.  That
is, targetm.addr_space.legitimate_address_p with strict set to true.  On
x86 that limits what registers can be used?  So I guess that made things
accidentally work before?

> So ideally we'd get something that respects the whole store-load
> ordering but still allows agressive CSE. And works for both toolchains.
> Small ask, I know :-)

Well, what is the ordering you need respected, *exactly*?


Segher

  parent reply	other threads:[~2023-03-07 20:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 23:11 [PATCH] x86/resctrl: avoid compiler optimization in __resctrl_sched_in Stephane Eranian
2023-03-03 23:17 ` Luck, Tony
2023-03-06 12:01 ` Peter Zijlstra
2023-03-07  0:16   ` Nick Desaulniers
2023-03-07 21:56     ` Bill Wendling
2023-03-07 11:35     ` Peter Zijlstra
2023-03-07 17:48       ` Linus Torvalds
2023-03-07 18:43       ` Segher Boessenkool [this message]
2023-03-07 20:43         ` Jakub Jelinek
2023-03-07 20:54           ` Linus Torvalds
2023-03-07 21:06             ` Linus Torvalds
2023-03-07 21:35               ` Luck, Tony
2023-03-07 21:58                 ` Nick Desaulniers
2023-03-08  6:13               ` Stephane Eranian
2023-03-08 23:25                 ` Linus Torvalds
2023-03-08 16:02               ` Moger, Babu
2023-03-07 21:11             ` Luck, Tony
2023-03-07 21:14               ` Linus Torvalds
2023-03-07 21:23                 ` Luck, Tony
2023-03-08  0:36                   ` Luck, Tony
2023-03-07 21:16               ` Nick Desaulniers
2023-03-07 21:19                 ` Linus Torvalds
2023-03-07 21:22                   ` Nick Desaulniers

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=20230307184315.GS25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=ananth.narayan@amd.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peternewman@google.com \
    --cc=peterz@infradead.org \
    --cc=reinette.chatre@intel.com \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vschneid@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.