linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Alex Kogan <alex.kogan@oracle.com>,
	linux@armlinux.org.uk, peterz@infradead.org, mingo@redhat.com,
	will.deacon@arm.com, arnd@arndb.de, linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@alien8.de,
	hpa@zytor.com, x86@kernel.org, guohanjun@huawei.com,
	jglauber@marvell.com
Cc: dave.dice@oracle.com, steven.sistare@oracle.com,
	daniel.m.jordan@oracle.com
Subject: Re: [PATCH v11 3/5] locking/qspinlock: Introduce CNA into the slow path of qspinlock
Date: Tue, 15 Sep 2020 22:40:11 -0400	[thread overview]
Message-ID: <05a65878-d24c-0f8e-c271-24ebc729d7e3@redhat.com> (raw)
In-Reply-To: <20200915180535.2975060-4-alex.kogan@oracle.com>

On 9/15/20 2:05 PM, Alex Kogan wrote:
> In CNA, spinning threads are organized in two queues, a primary queue for
> threads running on the same node as the current lock holder, and a
> secondary queue for threads running on other nodes. After acquiring the
> MCS lock and before acquiring the spinlock, the MCS lock
> holder checks whether the next waiter in the primary queue (if exists) is
> running on the same NUMA node. If it is not, that waiter is detached from
> the main queue and moved into the tail of the secondary queue. This way,
> we gradually filter the primary queue, leaving only waiters running on
> the same preferred NUMA node. For more details, see
> https://arxiv.org/abs/1810.05600.
>
> Note that this variant of CNA may introduce starvation by continuously
> passing the lock between waiters in the main queue. This issue will be
> addressed later in the series.
>
> Enabling CNA is controlled via a new configuration option
> (NUMA_AWARE_SPINLOCKS). By default, the CNA variant is patched in at the
> boot time only if we run on a multi-node machine in native environment and
> the new config is enabled. (For the time being, the patching requires
> CONFIG_PARAVIRT_SPINLOCKS to be enabled as well. However, this should be
> resolved once static_call() is available.) This default behavior can be
> overridden with the new kernel boot command-line option
> "numa_spinlock=on/off" (default is "auto").
>
> Signed-off-by: Alex Kogan <alex.kogan@oracle.com>
> Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
> Reviewed-by: Waiman Long <longman@redhat.com>
> ---
>   .../admin-guide/kernel-parameters.txt         |  10 +
>   arch/x86/Kconfig                              |  20 ++
>   arch/x86/include/asm/qspinlock.h              |   4 +
>   arch/x86/kernel/alternative.c                 |   4 +
>   kernel/locking/mcs_spinlock.h                 |   2 +-
>   kernel/locking/qspinlock.c                    |  42 ++-
>   kernel/locking/qspinlock_cna.h                | 336 ++++++++++++++++++
>   7 files changed, 413 insertions(+), 5 deletions(-)
>   create mode 100644 kernel/locking/qspinlock_cna.h
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index a1068742a6df..51ce050f8701 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -3353,6 +3353,16 @@
>   
>   	nox2apic	[X86-64,APIC] Do not enable x2APIC mode.
>   
> +	numa_spinlock=	[NUMA, PV_OPS] Select the NUMA-aware variant
> +			of spinlock. The options are:
> +			auto - Enable this variant if running on a multi-node
> +			machine in native environment.
> +			on  - Unconditionally enable this variant.
> +			off - Unconditionally disable this variant.
> +
> +			Not specifying this option is equivalent to
> +			numa_spinlock=auto.
> +
>   	cpu0_hotplug	[X86] Turn on CPU0 hotplug feature when
>   			CONFIG_BOOTPARAM_HOTPLUG_CPU0 is off.
>   			Some features depend on CPU0. Known dependencies are:

You will have to move down this hunk according to alphabetic order. 
Other than that this patch looks good to me.

Cheers,
Longman


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-09-16  2:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 18:05 [PATCH v11 0/5] Add NUMA-awareness to qspinlock Alex Kogan
2020-09-15 18:05 ` [PATCH v11 1/5] locking/qspinlock: Rename mcs lock/unlock macros and make them more generic Alex Kogan
2020-09-15 18:05 ` [PATCH v11 2/5] locking/qspinlock: Refactor the qspinlock slow path Alex Kogan
2020-09-15 18:05 ` [PATCH v11 3/5] locking/qspinlock: Introduce CNA into the slow path of qspinlock Alex Kogan
2020-09-16  2:40   ` Waiman Long [this message]
2020-09-15 18:05 ` [PATCH v11 4/5] locking/qspinlock: Introduce starvation avoidance into CNA Alex Kogan
2020-09-15 19:24   ` Randy Dunlap
2020-09-15 19:57     ` Alex Kogan
2020-09-16  3:13   ` Waiman Long
2020-09-15 18:05 ` [PATCH v11 5/5] locking/qspinlock: Avoid moving certain threads between waiting queues in CNA Alex Kogan

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=05a65878-d24c-0f8e-c271-24ebc729d7e3@redhat.com \
    --to=longman@redhat.com \
    --cc=alex.kogan@oracle.com \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=daniel.m.jordan@oracle.com \
    --cc=dave.dice@oracle.com \
    --cc=guohanjun@huawei.com \
    --cc=hpa@zytor.com \
    --cc=jglauber@marvell.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=steven.sistare@oracle.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).