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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 626CDC4361B for ; Wed, 16 Dec 2020 11:42:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0816C23383 for ; Wed, 16 Dec 2020 11:42:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725878AbgLPLmE (ORCPT ); Wed, 16 Dec 2020 06:42:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbgLPLmE (ORCPT ); Wed, 16 Dec 2020 06:42:04 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08A84C0617A6; Wed, 16 Dec 2020 03:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=cd/jmFqAdQ2uq/lf9GQPoQ1p56nBN0qOB2qJeg5iOpU=; b=l+YJ+V6w9771oHNjfW3asaU2tb 4QQRX8fM+QPcKsS7/u8SaWVixjlPI2AK6NuJNqQWUGD/rAmmA3tVYyOza0pAVPyGpvfBIXLhsp+Lb Od/uDIVY4PXOs4p9io27mlEW9KuEDKFjGzf5C+2jA1mmExVScg9Un1qONsgDYuEBKYlevKpcxGndA AiuLYotyPIQPN6EiqVtqTDATKGPK+tczmRT9ZJkJ7ydT1bMaep8hCM2mzaXdQtlDhJk3fOxo3q5uP 1hSuC82AH5ntvLH3uYhamL/dlIZeS6tE1/XhQoY0U54kMIZD/0iJvJlzUt1TiFT/BSeiUwgzpDOlp utjGSMiw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpVAX-0000HO-SG; Wed, 16 Dec 2020 11:40:33 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 67DD8303DA0; Wed, 16 Dec 2020 12:40:31 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E282621ADB0A3; Wed, 16 Dec 2020 12:40:30 +0100 (CET) Date: Wed, 16 Dec 2020 12:40:30 +0100 From: Peter Zijlstra To: Arnd Bergmann Cc: Guo Ren , Thomas Gleixner , Marco Elver , Arnd Bergmann , Russell King , Ingo Molnar , 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" Subject: Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline' Message-ID: <20201216114030.GN3040@hirez.programming.kicks-ass.net> References: <20190307091514.2489338-1-arnd@arndb.de> <87czzeg5ep.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-csky@vger.kernel.org On Tue, Dec 15, 2020 at 12:26:10PM +0100, Arnd Bergmann wrote: > 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 Hooray!! what about PA-RISC ? Can we burn that too?