From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF599C4361B for ; Tue, 15 Dec 2020 11:27:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89FFE22258 for ; Tue, 15 Dec 2020 11:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729060AbgLOL1c (ORCPT ); Tue, 15 Dec 2020 06:27:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:32892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729043AbgLOL1J (ORCPT ); Tue, 15 Dec 2020 06:27:09 -0500 X-Gm-Message-State: AOAM531kJNVJoHVhvxeleYcztgLRmGaDuhRIOBA3AeDIqecI4V8Us3rR Hy1ZCkJ6p36+OwqfqsBzyo/ylvQjRIx5QuPNT5A= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608031587; bh=rKOqa+R7y7mNp4eGjcH7gQWW+nLwZbAUT9kBD3lZKQQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=k70ldZS0l6V88WrQxLMEndoVnq2m/KjFtz+SI9cpIncROfnOXbQdLcAX96kzj9Jr4 fUIoGhMYqJOMl38ILevJCDrE3t2yTfjYzzQADCZ1gZshSXyJQlduncAe5omcuIrkzx QsoDU0j7rYXoLIKwgsQe7J1M2guKtrkeQd6GqMQeC9yfRm2fFEr8YfHvnW7CbOGx5+ t+JvW1xPZsG/NgHenIb7r4mVYv9YZCpkjwxJ6kyYj6djesVaD15t5Cz3ZWWYXM+fpe GlvBVjkoa6AJGfKyQzRSYhtE2ygHodgwifn0jUCCLqv3uzlzLaSUOBPAlr83DBCRPZ 7fNh1AdAfPmdQ== X-Google-Smtp-Source: ABdhPJzPyvmL8dDsf1iieoW9f95hiyyM8AowO7irrDFRwVfuGZ4n22u3MxoO/K4BU5ug1mXFiWGDS9GALpaS0p3jmPk= X-Received: by 2002:a9d:be1:: with SMTP id 88mr22991912oth.210.1608031586660; Tue, 15 Dec 2020 03:26:26 -0800 (PST) MIME-Version: 1.0 References: <20190307091514.2489338-1-arnd@arndb.de> <87czzeg5ep.fsf@nanos.tec.linutronix.de> In-Reply-To: From: Arnd Bergmann Date: Tue, 15 Dec 2020 12:26:10 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline' To: Guo Ren Cc: Thomas Gleixner , Marco Elver , Arnd Bergmann , Russell King , Ingo Molnar , Peter Zijlstra , Darren Hart , Nick Desaulniers , Davidlohr Bueso , Elena Reshetova , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , linux-csky@vger.kernel.org, sparclinux , "David S. Miller" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 15, 2020 at 7:09 AM Guo Ren wrote: > On Mon, Dec 14, 2020 at 9:15 PM Arnd Bergmann wrote: > > I had a look at what other architectures always implement > > futex_atomic_cmpxchg_inatomic() or can use the asm-generic non-SMP version, > > and I found that it's pretty much all of them, the odd ones being just sparc32 > > and csky, which use asm-generic/futex.h but do have an SMP option, > > as well as xtensa > > > > I would guess that for csky, this is a mistake, as the architecture is fairly > > new and should be able to implement it. Not sure about sparc32. > > The c610, c807, c810 don't support SMP, so futex_cmpxchg_enabled = 1 > with asm-generic's implementation. > For c860, there is no HAVE_FUTEX_CMPXCHG and cmpxchg_inatomic/inuser > implementation, so futex_cmpxchg_enabled = 0. > > Thx for point it out, we'll implement cmpxchg_inatomic/inuser for C860 > and still use asm-generic for non-smp CPUs. Sounds good to me. With that, I would suggest we actually remove the -ENOSYS fallback for arch_futex_atomic_op_inuser() and futex_atomic_cmpxchg_inatomic() in asm-generic/futex.h as well as the HAVE_FUTEX_CMPXCHG Kconfig symbol, plus these additional fixups: - for xtensa and mips configurations without ll/sc, fall back to the asm-generic version. These are all uniprocessor, while the corresponding SMP machines have a working arch_futex_atomic_op_inuser(). - Disable SMP support for sun4m/sun4d. From the historic git tree, it's unclear how well this ever worked, and very few machines of this class ever existed - Mark SMP for LEON as temporarily broken. As I see in the LEON patch set, they have changes to enable compare-and-swap-atomic instructions unconditionally, as all SMP Leons have those and seem to require this support already for other things. Arnd