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 6C0D8C6379D for ; Wed, 25 Nov 2020 14:18:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 292712076B for ; Wed, 25 Nov 2020 14:18:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ZuzsjBMR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729976AbgKYOSZ (ORCPT ); Wed, 25 Nov 2020 09:18:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729812AbgKYOSZ (ORCPT ); Wed, 25 Nov 2020 09:18:25 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 614B5C0613D4; Wed, 25 Nov 2020 06:18:25 -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=wU0zOrnocdlJXkwamHXZAUVyZC76vH5lJ5qYsICzTKo=; b=ZuzsjBMR9U0lOnIq/91BDGYPEA xn+47d8MvnUyg0jb+LlGQaXhOVNZZ0HxdFkuGcVOIPoxSJme47cjFNsRC0seL2naATdv5B4NKA2JS VySBiCx2iK4Qxvk7FeoJeptUxcaJwpWZBeryC506uwx6HbbOxVl08piQ7f4EVkumqG22zzaoxbOV9 DXq+CfJ/nHL3hVFaQDowit5vE3Sl5ttR9mpY5iFcJ3epNHQjktWxbaPPSzAkZDGQDZrhjwhOYd9se OfC4HUbDqj/yJToiL2Qhu9n6pCJ5nXaV2e92gxqPrVSFydbh9TstGdABE92ozX3z+457pVs+qha/t W5xl5aJg==; 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 1khvcc-0001r2-CL; Wed, 25 Nov 2020 14:18:14 +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 B0254306E0C; Wed, 25 Nov 2020 15:18:13 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A08ED22B9CF4B; Wed, 25 Nov 2020 15:18:13 +0100 (CET) Date: Wed, 25 Nov 2020 15:18:13 +0100 From: Peter Zijlstra To: Guo Ren Cc: Arnd Bergmann , Palmer Dabbelt , Paul Walmsley , Anup Patel , linux-riscv , Linux Kernel Mailing List , linux-csky@vger.kernel.org, Guo Ren , Michael Clark , Will Deacon Subject: Re: [PATCH 2/5] riscv: Add QUEUED_SPINLOCKS & QUEUED_RWLOCKS supported Message-ID: <20201125141813.GC2414@hirez.programming.kicks-ass.net> References: <1606225437-22948-1-git-send-email-guoren@kernel.org> <1606225437-22948-2-git-send-email-guoren@kernel.org> <20201124143931.GI2414@hirez.programming.kicks-ass.net> 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 Wed, Nov 25, 2020 at 08:52:23AM +0800, Guo Ren wrote: > > I'm pretty sure there's a handfull of implementations like this out > > there... if only we could share. > Michael has sent qspinlock before, ref to Link below. He reused mips' code. > > Link: https://lore.kernel.org/linux-riscv/20190211043829.30096-1-michaeljclark@mac.com/ > > Which short xchg implementation do you prefer (Mine or his)? Well, it would be very nice to have mips/riscv/csky all use the same header to implement these I suppose. But then we're back to a cmpxchg-loop, in which case Arnd's suggestion isn't worse.