[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ec7308f-02c6-a357-eab8-63b6f2b7a5eb@infradead.org>
Date: Mon, 28 Jun 2021 14:22:15 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Mark Rutland <mark.rutland@....com>
Cc: linux-kernel@...r.kernel.org, will@...nel.org,
boqun.feng@...il.com, peterz@...radead.org, aou@...s.berkeley.edu,
arnd@...db.de, bcain@...eaurora.org, benh@...nel.crashing.org,
chris@...kel.net, dalias@...c.org, davem@...emloft.net,
deanbo422@...il.com, deller@....de, geert@...ux-m68k.org,
gerg@...ux-m68k.org, green.hu@...il.com, guoren@...nel.org,
ink@...assic.park.msu.ru, James.Bottomley@...senPartnership.com,
jcmvbkbc@...il.com, jonas@...thpole.se, ley.foon.tan@...el.com,
linux@...linux.org.uk, mattst88@...il.com, monstr@...str.eu,
mpe@...erman.id.au, nickhu@...estech.com, palmerdabbelt@...gle.com,
paulus@...ba.org, paul.walmsley@...ive.com, rth@...ddle.net,
shorne@...il.com, stefan.kristiansson@...nalahti.fi,
tsbogend@...ha.franken.de, vgupta@...opsys.com,
ysato@...rs.sourceforge.jp
Subject: Re: [PATCH v2 00/33] locking/atomic: convert all architectures to
ARCH_ATOMIC
On 6/27/21 2:47 PM, Randy Dunlap wrote:
> On 6/18/21 1:48 AM, Mark Rutland wrote:
>> On Fri, Jun 04, 2021 at 10:56:16PM -0700, Randy Dunlap wrote:
>>> On 5/25/21 7:01 AM, Mark Rutland wrote:
>>>> This series (based on v5.13-rc2) converts all architectures to
>>>> ARCH_ATOMIC. This will allow the use of instrumented atomics on all
>>>> architectures (e.g. for KASAN and similar), and simplifies the core
>>>> atomic code (which should allow for easier rework of the fallbacks and
>>>> other bits in future).
>>
>> [...]
>>
>>> Hi Mark,
>>> Sorry for the late reply.
>>
>> Hi Randy,
>>
>> Likewise, apologies in the delay in getting to this!
>>
>>> I was just trying to update a patch
>>> to arch/sh/include/asm/cmpxchg.h, in its xchg() macro:
>>>
>>> https://lore.kernel.org/lkml/20210602231443.4670-2-rdunlap@infradead.org/
>>>
>>> The patch simply converts xchg() to a GCC statement expression to
>>> eliminate a build warning.
>
> Hm, with your locking/atomic patch series applied (in linux-next), I can
> no longer make arch/sh/ get this build warning:
>
> ../fs/ocfs2/file.c: In function 'ocfs2_file_write_iter':
> ../arch/sh/include/asm/cmpxchg.h:49:3: warning: value computed is not used [-Wunused-value]
> 49 | ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
>
>
> so I will go ahead with the rest of my arch/sh/ patches and then contemplate
> what to do about this one.
>
>
>>> Arnd has done this for m68k and I have done it for sparc in the past.
>>>
>>> Is there any (good) reason that all versions of arch_xchg() are not
>>> statement expressions? In this patch series, they seem to be quite
>>> mixed (as they were before this patch series). I count 11 arches
>>> that use a statement expression and 4 that do not (including arch/sh/).
>>
>> Largely I tried to make the minimal change from what was there before,
>> and I didn't have any specific reason to either use or avoid statement
>> expressions.
>>
>> This series has been queued in the tip tree's locking/core branch for a
>> while now, but we could spin a patch atop. Do you want to spin a patch
>> to convert the remaining 4 architectures in one go?
>
> I'll look at the 4 remaining arches later..
>
Hi Mark,
I checked xchg(), __xchg(), and cmpxchg() in all
arch/*/include/asm/cmpxchg.h. They are use static inline
functions or statement expressions so I don't see any need
for follow-ups to fix warnings like this (old) one, which
I cannot cause with your series applied:
> ../fs/ocfs2/file.c: In function 'ocfs2_file_write_iter':
> ../arch/sh/include/asm/cmpxchg.h:49:3: warning: value computed is not used [-Wunused-value]
> 49 | ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
However, something in arch/arc/ did look suspicious so I decided to
try an ARC allmodconfig build, where I did see a few errors FYI:
CC drivers/iommu/io-pgtable-arm.o
In file included from ../include/linux/atomic.h:80,
from ../drivers/iommu/io-pgtable-arm.c:12:
../drivers/iommu/io-pgtable-arm.c: In function 'arm_lpae_install_table':
../include/linux/atomic-arch-fallback.h:60:32: error: implicit declaration of function 'arch_cmpxchg64'; did you mean 'arch_cmpxchg'? [-Werror=implicit-function-declaration]
60 | #define arch_cmpxchg64_relaxed arch_cmpxchg64
| ^~~~~~~~~~~~~~
../include/asm-generic/atomic-instrumented.h:1261:2: note: in expansion of macro 'arch_cmpxchg64_relaxed'
1261 | arch_cmpxchg64_relaxed(__ai_ptr, __VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~~~~~
../drivers/iommu/io-pgtable-arm.c:320:8: note: in expansion of macro 'cmpxchg64_relaxed'
320 | old = cmpxchg64_relaxed(ptep, curr, new);
| ^~~~~~~~~~~~~~~~~
--
~Randy
Powered by blists - more mailing lists