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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96B2BC43334 for ; Mon, 20 Jun 2022 21:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hBKAdvCVjdoHDc+JDk3/6V1t5FqDowCaIYQCXWbD/zw=; b=cGPLjBQHfU9rWy Ojvt+T02BsqqqBMfTxzH+TCZonJHwkx2jacklkAEl0C0PZX50EC6q8V7mBHTFXwVHrKx66j8gJHgd vWkIqeQoIebKEik+n7da3gSXCS4gRZaBsrdO0JixvgpSecZDuj0tz1gF4bs/A8mFqgAgtMprpjaUf w3p+TC/kjeG39iQE06hVD0CrQ5O/9XR+6EKcDM3NchBhFmGx7lkSsev3KB1q+pmaFkGnRlL7eoAoq 97J+UeIcNPItGSz0ttr24lQpEkCwllVEpnGAHY8E7pqDuYlI9nh0h0IIGmurcrcs55gEbfPV79DnW 6lH/27rldVGFmVdChfQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3Ol0-002WrH-CH; Mon, 20 Jun 2022 21:16:26 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3Okx-002WqZ-5y for linux-riscv@lists.infradead.org; Mon, 20 Jun 2022 21:16:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655759780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lZhHQwIP7ahDScS1KF5bFADmc8igjElNlRZM3fUDtks=; b=Aku/YqSi1tzcJb9WAMiLFNEtn/biQmAumDfGt+VOOe3RRIjdMs8cv81Y/PD3SQPrfARXdI ZUVPJTshyprO9B+ccy8uItO0DdMHGuEjPUC2hWCw4/ySMJXp5ePrSLKM/QFTw4iGLyRzjj xrVPFE6ktzyXkbQPkrYrhAe6wlAO870= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-363-vY5Lfy5bNyG3eOm35UQymw-1; Mon, 20 Jun 2022 17:16:17 -0400 X-MC-Unique: vY5Lfy5bNyG3eOm35UQymw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68E2E3C02B75; Mon, 20 Jun 2022 21:16:16 +0000 (UTC) Received: from [10.22.32.175] (unknown [10.22.32.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB067141510C; Mon, 20 Jun 2022 21:16:15 +0000 (UTC) Message-ID: Date: Mon, 20 Jun 2022 17:16:15 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH V5] riscv: Add qspinlock support Content-Language: en-US To: Arnd Bergmann , Guo Ren Cc: Palmer Dabbelt , Peter Zijlstra , Boqun Feng , linux-riscv , linux-arch , Linux Kernel Mailing List , Guo Ren References: <20220620155404.1968739-1-guoren@kernel.org> From: Waiman Long In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220620_141623_343334_5F83B63D X-CRM114-Status: GOOD ( 20.87 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 6/20/22 16:42, Arnd Bergmann wrote: > On Mon, Jun 20, 2022 at 5:54 PM wrote: >>> +config RISCV_USE_QUEUED_SPINLOCKS >> + bool "Using queued spinlock instead of ticket-lock" > Maybe we can just make ARCH_USE_QUEUED_SPINLOCKS > user visible and give users the choice between the two generic > implementations across all architectures that support the qspinlock > variant. > > In arch/riscv, you'd then just have a > > select ARCH_HAVE_QUEUED_SPINLOCKS > > diff --git a/arch/riscv/include/asm/spinlock.h > b/arch/riscv/include/asm/spinlock.h >> new file mode 100644 >> index 000000000000..fd3fd09cff52 >> --- /dev/null >> +++ b/arch/riscv/include/asm/spinlock.h >> @@ -0,0 +1,12 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +#ifndef __ASM_SPINLOCK_H >> +#define __ASM_SPINLOCK_H >> + >> +#ifdef CONFIG_ARCH_USE_QUEUED_SPINLOCKS >> +#include >> +#include >> +#else >> +#include >> +#endif >> + > Along the same lines: > > I think I'd prefer the header changes to be done in the asm-generic > version of this file, so this can be shared across all architectures > that want to give the choice between ticket and queued spinlock. I concur. Qspinlock is only needed if we want to support systems with a large number of CPUs. For systems with a small number of CPUs. It doesn't matter if qspinlock or the ticket lock is being used. Cheers, Longman _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv