mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>, Guo Ren <guoren@kernel.org>
Cc: Palmer Dabbelt <palmer@rivosinc.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Guo Ren <guoren@linux.alibaba.com>
Subject: Re: [PATCH V5] riscv: Add qspinlock support
Date: Mon, 20 Jun 2022 17:16:15 -0400	[thread overview]
Message-ID: <f6513b4f-ef62-fd40-b031-27c9b7f57e00@redhat.com> (raw)
In-Reply-To: <CAK8P3a2enbvE9a5V=JpUFt7FfyDGLQHTWTszibqqLVoeiMAo5Q@mail.gmail.com>


On 6/20/22 16:42, Arnd Bergmann wrote:
> On Mon, Jun 20, 2022 at 5:54 PM <guoren@kernel.org> 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 <asm/qspinlock.h>
>> +#include <asm/qrwlock.h>
>> +#else
>> +#include <asm-generic/spinlock.h>
>> +#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


  reply	other threads:[~2022-06-20 21:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 15:54 guoren
2022-06-20 15:57 ` Conor.Dooley
2022-06-21 14:19   ` Guo Ren
2022-06-20 19:57 ` kernel test robot
2022-06-20 22:53   ` Guo Ren
2022-06-21 14:57   ` Guo Ren
2022-06-20 20:42 ` Arnd Bergmann
2022-06-20 21:16   ` Waiman Long [this message]
2022-06-20 22:47     ` Guo Ren
2022-06-20 23:02   ` Guo Ren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6513b4f-ef62-fd40-b031-27c9b7f57e00@redhat.com \
    --to=longman@redhat.com \
    --cc=arnd@arndb.de \
    --cc=boqun.feng@gmail.com \
    --cc=guoren@kernel.org \
    --cc=guoren@linux.alibaba.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@rivosinc.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®