From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: feng.tang@intel.com, lkp@intel.com, Jann Horn <jannh@google.com>,
intel-gfx@lists.freedesktop.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, fengwei.yin@intel.com,
gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org,
kernel test robot <oliver.sang@intel.com>,
ying.huang@intel.com, oe-lkp@lists.linux.dev,
bpf@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [linus:master] [file] 0ede61d858: will-it-scale.per_thread_ops -2.9% regression
Date: Mon, 27 Nov 2023 11:13:00 +0100 [thread overview]
Message-ID: <20231127-protokollieren-ermuntern-748cc3855fe8@brauner> (raw)
In-Reply-To: <CAHk-=wjMKONPsXAJ=yJuPBEAx6HdYRkYE8TdYVBvpm3=x_EnCw@mail.gmail.com>
> I took a look at the code generation, and honestly, I think we're
> better off just making __fget_files_rcu() have special logic for this
> all, and not use __get_file_rcu().
My initial massaging of the patch did that btw. Then I sat there
wondering whether it would matter if we just made it possible to reuse
that code and I went through a bunch of iterations. Oh well, it seems to
matter.
> Comments? I also looked at that odd OPTIMIZER_HIDE_VAR() that
Concept looks sane to me.
> __get_file_rcu() does, and I don't get it. Both things come from
> volatile accesses, I don't see the point of those games, but I also
> didn't care, since it's no longer in a critical code path.
>
> Christian?
Puts his completely imagined "I understand RCU head on".
SLAB_TYPESAFE_BY_RCU makes the RCU consume memory ordering that the
compiler doesn't officialy support (afaik) a bit wonky.
So the thinking was that we could have code patterns where you could
free the object and reallocate it while legitimatly passing the pointer
recheck. In that case there is no memory ordering between the allocation
and the pointer recheck because the last (re)allocation could have been
after the rcu_dereference().
To combat that all future loads were made to have a dependency on the
first load using the hidevar trick.
I guess that might only be theoretically possible but not in practice?
But then I liked that we explicitly commented on it as a reminder.
prev parent reply other threads:[~2023-11-27 10:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-20 7:11 [linus:master] [file] 0ede61d858: will-it-scale.per_thread_ops -2.9% regression kernel test robot
2023-11-20 7:41 ` Mateusz Guzik
2023-11-26 20:23 ` Linus Torvalds
2023-11-26 23:20 ` Linus Torvalds
2023-11-27 6:58 ` Oliver Sang
2023-11-27 10:27 ` Christian Brauner
2023-11-27 17:10 ` Linus Torvalds
2023-11-28 15:52 ` Christian Brauner
2023-11-27 10:13 ` Christian Brauner [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=20231127-protokollieren-ermuntern-748cc3855fe8@brauner \
--to=brauner@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=feng.tang@intel.com \
--cc=fengwei.yin@intel.com \
--cc=gfs2@lists.linux.dev \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jannh@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lkp@intel.com \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=torvalds@linux-foundation.org \
--cc=ying.huang@intel.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 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).