All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <gaoxiang25@huawei.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	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: [PATCH v2] bit_spinlock: introduce smp_cond_load_relaxed
Date: Tue, 6 Nov 2018 19:36:41 +0800	[thread overview]
Message-ID: <dedbc211-082b-be4a-1bce-2593084d4ca3@huawei.com> (raw)
In-Reply-To: <20181106110026.GJ22431@hirez.programming.kicks-ass.net>

Hi Peter,

On 2018/11/6 19:00, Peter Zijlstra wrote:
>>> Yes, that's much better. Ideally though, we'd get rid of bit spinlocks
>>> that have significant enough contention for this to matter.
>> OK, I will send v3 to fix like the above.
> That's not answering the full question though. What bit spinlocks did
> you find where this matters? And can't we convert them to proper
> spinlocks instead?

I just misunderstood your question and I get your point now.

"What bit spinlocks did you find where this matters?" nope..I said the original
background to Greg before, that is I tried to use smp_cond_load_relaxed instead
of busy spining in the development of erofs file system and I saw this bit_spinlock
implementation by chance...This is not a big modification but since I raised the
question before and I want to trace to the end...

"And can't we convert them to proper spinlocks instead?" I think bit_spinlock is
sometime preferred since it requires little memory and can be integrated into some
fields(eg. flags)...It is selectable for spinlocks don't have to many users
at the same time, so I think it depends on the detailed real use scenerio...
It is just a tool for user code to select case by case... That is my personal idea...

IMO, to use wrapped up function for the detailed scenario could be better than
open-coded all the time (eg. do cpu_relax(); while(...)) since it could be
optimizated even more for the specific architecture...

Thanks,
Gao Xiang

  reply	other threads:[~2018-11-06 11:36 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
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 [this message]
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=dedbc211-082b-be4a-1bce-2593084d4ca3@huawei.com \
    --to=gaoxiang25@huawei.com \
    --cc=chao@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=peterz@infradead.org \
    --cc=pombredanne@nexb.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.