Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3290090pxu; Tue, 15 Dec 2020 03:30:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwORqPDu05PYAQ+C3B5uEUEyFrgCnctNILzUmqoehMX8glQwPGOISkv8OQkk8AUiFkF/Lw4 X-Received: by 2002:a05:6402:312c:: with SMTP id dd12mr29523050edb.327.1608031822330; Tue, 15 Dec 2020 03:30:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608031822; cv=none; d=google.com; s=arc-20160816; b=ea8vfJNlenmSoydsqKit2oIEjOMhntoFM7Jrnq+C4yoO2/Yv9Tp7uLkZ1r+oxuv71x VjrfxGYmr75n9iGgYda5Qjr0uIBgOBkWcnWwAKm0+6BQCObs5adyLN1bLWNCALXTLLMJ 27Fp5WwWu6b+x+VZXPqQupTBRwJBTAdBRpSfkZkBFqOdwQ/NfCmJUGApsKISDX3ypBAW MXjgcQ3BYBs5chaWq849yg1GGiMF8FOpx6TwbBVgBPMmmhKFcqLOhihU38BQd0I6GLA0 DSv+Zr8uYNxsz7HSeW5ljWkc+l2q/hNxJMxtFFs3qp2Uug1CROa1ZAQ+lPsHDvnkLFjh fdhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wqy5KaUmaPPS8lav8bePxFxkbrxxWlyotADTdvdAZQI=; b=nH5RND+O8LTzZkBG1mWYrVmA7K3xrHUDta5d3Vzai/o3DAKWIYqW2b1GQQHAYJbDGV rzyzSFv4xewVmeiRv9YVUILjptUnHIyqHVnSsf3dfLOx+RNL0ZCBXhzV6o0yKCSV/ZdQ +Iqh/5+295/67Pr4pKUHpobJsS5YL92zz3ysuk1NfhsUe+eJruH6tG3Hj0v1KWVVD6ZW FTocrRQnLPNNVVwZnZumN12KIGknd2x53nQAlDvivu/I6dqmDgY9DrWnba3JG7S7AE9D Fu5ZMMp8XsiunZMOeHQY9QzzsZWJba19gIrZGPDL+vFwD7ee+SgAPOIcMWLG6v9ZoG1i alWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k70ldZS0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si701679edt.452.2020.12.15.03.29.58; Tue, 15 Dec 2020 03:30:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k70ldZS0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728776AbgLOL1b (ORCPT + 99 others); Tue, 15 Dec 2020 06:27:31 -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-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