mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] locking/rwsem: Make owner store task pointer of last owning reader
Date: Mon, 10 Sep 2018 13:35:53 -0400	[thread overview]
Message-ID: <70273024-d40a-e7bb-740a-629089d169f8@redhat.com> (raw)
In-Reply-To: <20180910171550.GA3902@linux-r8p5>

On 09/10/2018 01:15 PM, Davidlohr Bueso wrote:
> On Mon, 10 Sep 2018, Waiman Long wrote:
>
>> One major issue with a combined count/owner is that we may have to use
>> cmpxchg for reader lock which will certainly impact reader-heavy
>> workloads. I have also thought about ways to compress the task pointer
>> address so that it can use fewer bits and leave the rests for reader
>> count. It is probably doable on 64-bit systems, but likely not on 32-bit
>> system given that there are less bits to play around.
>
> Yeah we've discussed this before. As a cleanup it would obviously be
> good,
> but I fear about raw performance loss when using cmpxchg instead of xadd. 

I don't think using cmpxchg for writers will be a performance issue.
However, using cmpxchg for readers will be. One thought that I have is
to use the tid of the writer on the lower half and use the upper half
for reader count. However, there is some overhead in translating tid to
task pointer. So I don't know how useful that may be. So we may still
need to keep the owner field around.

Cheers,
Longman


  reply	other threads:[~2018-09-10 17:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 20:18 Waiman Long
2018-09-10  9:31 ` Peter Zijlstra
2018-09-10 15:01   ` Waiman Long
2018-09-10 17:15     ` Davidlohr Bueso
2018-09-10 17:35       ` Waiman Long [this message]
2018-09-11  8:17       ` Peter Zijlstra
2018-09-11 12:56         ` Waiman Long
2018-09-11 19:21   ` Davidlohr Bueso
2018-09-11 19:38     ` Peter Zijlstra
2018-09-10 10:54 ` [tip:locking/core] " tip-bot for Waiman Long

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=70273024-d40a-e7bb-740a-629089d169f8@redhat.com \
    --to=longman@redhat.com \
    --cc=dave@stgolabs.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome