Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3643552pxu; Tue, 15 Dec 2020 11:45:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzk9xnL1uqnwIyZQLl97Q89D6KRN/CX+a6qe75gcFg0//oA9O+Q4uDECHTrBAKR1TyqCrwB X-Received: by 2002:a17:906:e28c:: with SMTP id gg12mr29402158ejb.74.1608061549333; Tue, 15 Dec 2020 11:45:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608061549; cv=none; d=google.com; s=arc-20160816; b=04fSdoQmdETfDRu0FMNd19DfvL0/9pdl8dljeEOx5SRUwDVnLzz4fi70SYSoeASMS2 ymOLkYKMTVVXnNGSZq5BfEw6PtllrpkaZ5s2Q3A0FHzl+TUa+7d4XLK6wZF/USw20TUV qKojYmer3NtT3S27CKAvjgLF90lH7BWiVtnwhrglfNbnChVjmUECGeH3NzArTteEz99b Gnz64xv5SKdBogzyuwdo9kWBV7hbtRDiG6kYAyEH/LzVnfeJAteQAarDd7yFhXgSXGkj 6k9YIXoaHnGOaDj2zgjr+gBGX4Zz7QiD1WPN9az6q0MtkqzQSEOHqNG1wqB006BL9WrT eumg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=uZJKBeN3qmn+F4m5lEIFAptLZ3ghd/7ZQHdnpytTr1o=; b=wcm+Hxfe2Lglz7ylL0JDRW9D0GcqdSut8XkbO14gRoqxBlUqiyYJI2ZbZf/yr+GM1q 1jHEUa4ZwFeyjDuyfGMpwbfjL/revB/HlHdFeDJm3OcG60IFNe4WbVYzOYWvp2z3zCIQ g62QumzXZ9qTmK3w3KKy5a+0vNSgN8lxsuo14WOtOE/pLg7bjaON2W1kVPQXVnsdyGJg 4N+CR/6cT6NovX56qa66zgMghRa4iHvnK52v9NcdGiZnVpMAH+zUEr8SEhM2Yhnuzb0T zFmplN5q5zVRcHuwTh9GUUUHr2aKRDQxKD7+PWz2pjWpsi7RqHWge+rSAC0nlJm3YKxq 4T9w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si1461303edv.474.2020.12.15.11.45.24; Tue, 15 Dec 2020 11:45:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726356AbgLOTjQ (ORCPT + 99 others); Tue, 15 Dec 2020 14:39:16 -0500 Received: from asavdk4.altibox.net ([109.247.116.15]:41086 "EHLO asavdk4.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728369AbgLOTjC (ORCPT ); Tue, 15 Dec 2020 14:39:02 -0500 Received: from ravnborg.org (unknown [188.228.123.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id 5F4B18065E; Tue, 15 Dec 2020 20:38:02 +0100 (CET) Date: Tue, 15 Dec 2020 20:38:00 +0100 From: Sam Ravnborg To: Arnd Bergmann Cc: Guo Ren , 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" Subject: Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline' Message-ID: <20201215193800.GA1098247@ravnborg.org> 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: X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=Itgwjo3g c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=VwQbUJbxAAAA:8 a=KZstDQ4antaxc6hZ8AEA:9 a=CjuIK1q_8ugA:10 a=AjGcO6oz07-iQ99wixmX:22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, 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 Yeah, I have collection of sparc32 machines that I played around with once. Including one sun4d that I brought from a friendly Linux fellow in the UK. But somehow I lost interest as this is all very nice machines but not useful for anything real work. I think we would be better served dropping support for sun4m and sun4d from the kernel. Last I suggested deleting sun4m/sun4d the argument to keep sun4m was that QEMU supports sun4m - which is a good argument for sun4m. I dunno what would be needed to migrate QEMU to LEON, see below. > > - 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. LEON on the other hand could have some nice future. They are right now stuck on an older kernel and someone that was motivated should be able to get LEON4 running on latest upstream. We had it working in the past - but is was around the time I lost my sparc interest and no-one jumped in to move it much more forward. So in other words - no complains for the plan you outline. Sam