public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Baokun Li <libaokun1@huawei.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	 kernel test robot <lkp@intel.com>,
	sfr@canb.auug.org.au, llvm@lists.linux.dev,
	 oe-kbuild-all@lists.linux.dev,
	Christian Brauner <christianvanbrauner@gmail.com>,
	 yangerkun <yangerkun@huawei.com>,
	"zhangyi (F)" <yi.zhang@huawei.com>,
	linux-next@vger.kernel.org,  linux-fsdevel@vger.kernel.org
Subject: Re: [brauner-vfs:vfs.misc 12/13] include/linux/fs.h:911:9: error: call to '__compiletime_assert_207' declared with 'error' attribute: Need native word sized stores/loads for atomicity.
Date: Wed, 24 Jan 2024 14:27:35 +0100	[thread overview]
Message-ID: <20240124-warnhinweis-servolenkung-e482feb8fc43@brauner> (raw)
In-Reply-To: <bf9b8a90-7ace-5f14-e585-8cc467f4d611@huawei.com>

> If CONFIG_SMP is not enabled in include/asm-generic/barrier.h,
> then smp_load_acquire/smp_store_release is implemented as
> READ_ONCE/READ_ONCE and barrier() and type checking.
> READ_ONCE/READ_ONCE already checks the pointer type,
> but then checks it more stringently outside, but here the
> more stringent checking seems unnecessary, so it is removed
> and only the type checking in READ_ONCE/READ_ONCE is kept
> to avoid compilation errors.

Maha, brainfart on my end, I missed the !CONFIG_SMP case.
Sorry about that.

> 
> When CONFIG_SMP is enabled on 32-bit architectures,
> smp_load_acquire/smp_store_release is not called in i_size_read/write,
> so there is no compilation problem. On 64-bit architectures, there
> is no compilation problem because sizeof(long long) == sizeof(long),
> regardless of whether CONFIG_SMP is enabled or not.

Yes, of course.

> Yes, using smp_rmb()/smp_wmb() would also solve the problem, but
> the initial purpose of this patch was to replace smp_rmb() in filemap_read()
> with the clearer smp_load_acquire/smp_store_release, and that's where
> the community is going with this evolution. Later on, buffer and page/folio
> will also switch to acquire/release, which is why I think Linus' suggestion
> is better.

Ah ok, thanks for the context. Can you send an updated series then, please?

  reply	other threads:[~2024-01-24 13:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23  0:12 [brauner-vfs:vfs.misc 12/13] include/linux/fs.h:911:9: error: call to '__compiletime_assert_207' declared with 'error' attribute: Need native word sized stores/loads for atomicity kernel test robot
2024-01-23  7:07 ` Baokun Li
2024-01-23 16:24   ` Christian Brauner
2024-01-24  7:52     ` Baokun Li
2024-01-24 10:30       ` Christian Brauner
2024-01-24 11:53         ` Baokun Li
2024-01-24 13:27           ` Christian Brauner [this message]
2024-01-24 13:38             ` Baokun Li
2024-01-23 17:46   ` Linus Torvalds
2024-01-24  7:31     ` Baokun Li

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=20240124-warnhinweis-servolenkung-e482feb8fc43@brauner \
    --to=brauner@kernel.org \
    --cc=christianvanbrauner@gmail.com \
    --cc=libaokun1@huawei.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.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