public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@aol.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, Miao Xie <miaoxie@huawei.com>,
	Chao Yu <chao@kernel.org>
Subject: Re: [RFC PATCH] bit_spinlock: introduce smp_cond_load_relaxed
Date: Sat, 13 Oct 2018 15:44:19 +0800	[thread overview]
Message-ID: <752f4ea2-7cd7-fff8-ee0b-d9c01204122e@aol.com> (raw)
In-Reply-To: <20181013073004.GA29921@kroah.com>

Hi Greg,

On 2018/10/13 15:30, Greg Kroah-Hartman wrote:
> On Sat, Oct 13, 2018 at 03:22:08PM +0800, Gao Xiang wrote:
>> Hi Greg,
>>
>> On 2018/10/13 15:04, Greg Kroah-Hartman wrote:
>>> On Sat, Oct 13, 2018 at 02:47:29PM +0800, Gao Xiang wrote:
>>>> It is better to use smp_cond_load_relaxed instead
>>>> of busy waiting for bit_spinlock.
>>>
>>> Why?  I think we need some kind of "proof" that this is true before
>>> being able to accept a patch like this, don't you agree?
>>
>> There are some materials which discuss smp_cond_load_* earlier.
>> https://patchwork.kernel.org/patch/10335991/
>> https://patchwork.kernel.org/patch/10325057/
>>
>> In ARM64, they implements a function called "cmpwait", which uses
>> hardware instructions to monitor a value change, I think it is more
>> energy efficient than just do a open-code busy loop...
>>
>> And it seem smp_cond_load_* is already used in the current kernel, such as:
>> ./kernel/locking/mcs_spinlock.h
>> ./kernel/locking/qspinlock.c
>> ./kernel/sched/core.c
>> ./kernel/smp.c
>>
>> For other architectures like x86/arm64, I think they could implement
>> smp_cond_load_* later.
> 
> And have you benchmarked this change to show that it provides any
> benifit?
> 
> You need to do that...

OK, it is my responsibility to test this patch in ARM64 indeed.

I will test it later in ARM64 to see if it has any performance difference
after I handled EROFS product landing stuffs (perhaps weeks later,
many urgent stuffs for the current product that I need to solve...)

Or if some warm-hearted folks interest in it, I'm very happy to see other
implementations or comments about that. :)

Thanks,
Gao Xiang

> 
> thanks,
> 
> greg k-h
> 

  reply	other threads:[~2018-10-13  7:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13  6:47 [RFC PATCH] bit_spinlock: introduce smp_cond_load_relaxed Gao Xiang
2018-10-13  7:04 ` Greg Kroah-Hartman
2018-10-13  7:22   ` Gao Xiang
2018-10-13  7:30     ` Greg Kroah-Hartman
2018-10-13  7:44       ` Gao Xiang [this message]
2018-10-13  7:30     ` Gao Xiang
2018-10-30  6:04 ` [PATCH v2] " Gao Xiang
2018-10-30  5:52   ` Gao Xiang
2018-11-05 17:11     ` Gao Xiang
2018-11-05 22:49   ` Will Deacon
2018-11-06  1:45     ` Gao Xiang
2018-11-06  9:06     ` Peter Zijlstra
2018-11-06 10:22       ` Gao Xiang
2018-11-06 11:00         ` Peter Zijlstra
2018-11-06 11:36           ` Gao Xiang
2018-11-06 12:27             ` Peter Zijlstra
2018-11-06 12:33               ` Gao Xiang
2018-11-06 12:38                 ` Gao Xiang
2018-11-06 12:43                 ` Peter Zijlstra

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=752f4ea2-7cd7-fff8-ee0b-d9c01204122e@aol.com \
    --to=hsiangkao@aol.com \
    --cc=chao@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=pombredanne@nexb.com \
    --cc=tglx@linutronix.de \
    /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