Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3566536pxf; Mon, 29 Mar 2021 05:57:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw6WM3y0e27zC1n3+3lGmr0R8KP/UGO+eJcKN6GxOEIhfPRrfPur8APDwxK30vHZGBuY7Z X-Received: by 2002:a05:6402:312b:: with SMTP id dd11mr28124683edb.149.1617022628177; Mon, 29 Mar 2021 05:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617022628; cv=none; d=google.com; s=arc-20160816; b=lSUrbCgzQJbOuBN13aLpyD3FQXi/ivfrCg+TqqFA9+tt/hNc/0BvQ+vynubmSXX7sJ 2LxEbmY8TLMcam6uovCmODKw6fPOwOXzhWc2wJBeoUTfEik4CQF90fymjPQ8R4LtQxeh 2Zu80iOK6xMrbhv2I7SujAoW1IU8FtTZmgxRgkvLM/Yhm2tAX3joXuPiSwx3gMfYPies fyFzgI6+QfvrTfkTBLf7x9aCe1uM+YMWfFfmXgK9auj5P7ieMfrfAu707qaASCdi0QgR PaPXaiF/b1aEvDEgKXrAhnwmI5GawGLBTdKsgYEaR+DeaUZAFkmHuSCTJVGRxQaDx0lw CAJg== 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:dkim-signature; bh=ryQUmQX9VCrgI40LMrpbOpblpt+Cjb8URzPqoIp8UFw=; b=w9Ia3KsH3fT4fK+bJSsVW6oNzg0pNMxHN7CPVdSPEe+B0t+BjbTXt/ihlxn/6DVsCA xRZTRhCMAdj+aJJAYAJyiKXS8R3Kn5GeVp0nJzBr2cSKq0sHlHNFjyZaU8nT5xrIuHuH pE6iNb/FwQcORvXBg0RqaZ+QIqMC0CfO2CmDg3C6+OkPL/0PAR1X6vrwCqY1yYMgETN3 wjvG/foJsXtGyQMWi42rQ9iuXfVWWyKDmn7Tipi7v8h+/Lk63001SiXLzmmYbkZc39CT Ni7OUayujKg3w3TS8xindUtudRHogZdyyIYz29dqEMWSNjVlQadTNXuXZtEujKLwIUbf v1zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=aKCY2I+A; 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 c1si12518535edq.252.2021.03.29.05.56.45; Mon, 29 Mar 2021 05:57:08 -0700 (PDT) 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=@infradead.org header.s=casper.20170209 header.b=aKCY2I+A; 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 S231742AbhC2Mzb (ORCPT + 99 others); Mon, 29 Mar 2021 08:55:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231687AbhC2MzG (ORCPT ); Mon, 29 Mar 2021 08:55:06 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FD7DC061574; Mon, 29 Mar 2021 05:55:06 -0700 (PDT) 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=ryQUmQX9VCrgI40LMrpbOpblpt+Cjb8URzPqoIp8UFw=; b=aKCY2I+A4CoLQS4X2EJS0qhT9V 9ldUP14p2myn0I2H7vFFLqGO2ViFxVgtMp4r7AISXPeratKP1oX1td2NT3SjHs3UHQEDIYBu/dI40 TeEn+vntWxrKhtc6Uj4OVxkrwgL4cXU9DA/DjM2CHa03mwkVuXqeNx5fGnhKvIxXVv4zEFVpmNBkB fRgtFq4Ne+2TGvb2X+UXQVVUm7y5jArJzdG591z5/1eWOtycdRF+C/x8xP/UYoEpIg0DLcrhR2znb 0YCbxNQBx7fmjOZMi8dAlDthdfL4GOwnOSYkL82gDAajM/DMqAriiVoM5XQby9P+0S1YQuKvq2mta vp6FxWOA==; 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.94 #2 (Red Hat Linux)) id 1lQrPU-001aoq-Jy; Mon, 29 Mar 2021 12:54:32 +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 E0707305CC3; Mon, 29 Mar 2021 14:54:23 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CBCD02BB1A680; Mon, 29 Mar 2021 14:54:23 +0200 (CEST) Date: Mon, 29 Mar 2021 14:54:23 +0200 From: Peter Zijlstra To: Anup Patel Cc: Guo Ren , linux-riscv , Linux Kernel Mailing List , "linux-csky@vger.kernel.org" , linux-arch , Guo Ren , Will Deacon , Ingo Molnar , Waiman Long , Arnd Bergmann , Anup Patel Subject: Re: [PATCH v4 3/4] locking/qspinlock: Add ARCH_USE_QUEUED_SPINLOCKS_XCHG32 Message-ID: References: <1616868399-82848-1-git-send-email-guoren@kernel.org> <1616868399-82848-4-git-send-email-guoren@kernel.org> 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-kernel@vger.kernel.org On Mon, Mar 29, 2021 at 12:13:10PM +0000, Anup Patel wrote: > We had discussions in the RISC-V platforms group about this. Over there, > We had evaluated all spin lock approaches (ticket, qspinlock, etc) tried > in Linux till now. It was concluded in those discussions that eventually we > have to move to qspinlock (even if we moved to ticket spinlock temporarily) > because qspinlock avoids cache line bouncing. Also, moving to qspinlock > will be aligned with other major architectures supported in Linux (such as > x86, ARM64) > > Some of the organizations working on high-end RISC-V systems (> 32 > CPUs) are interested in having an optimized spinlock implementation > (just like other major architectures x86 and ARM64). > > Based on above, Linux RISC-V should move to qspinlock. That's all well and good, but first you need architectural forward progress guarantees. Otherwise there's absolutely no point in building complex locking primitives. And unless you already have such big systems in silicon, where you can benchmark against simpler locks (like ticket) there really is no point in the complexity.