From: Waiman Long <longman@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
vbabka@suse.cz, Davidlohr Bueso <dave@stgolabs.net>
Cc: rong.a.chen@intel.com, yang.shi@linux.alibaba.com,
kirill.shutemov@linux.intel.com, mhocko@kernel.org,
Matthew Wilcox <willy@infradead.org>,
ldufour@linux.vnet.ibm.com, Colin King <colin.king@canonical.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
lkp@01.org
Subject: Re: [LKP] [mm] 9bc8039e71: will-it-scale.per_thread_ops -64.1% regression
Date: Mon, 5 Nov 2018 17:40:14 -0500 [thread overview]
Message-ID: <60ef3584-6f3a-1a9a-94d1-3d4a5b9f1e56@redhat.com> (raw)
In-Reply-To: <CAHk-=wjZ1C2iL79jOuC9ysvX2oRpUjoqXirvY0NRuLC0eQ8nbg@mail.gmail.com>
On 11/05/2018 05:14 PM, Linus Torvalds wrote:
> On Mon, Nov 5, 2018 at 12:12 PM Vlastimil Babka <vbabka@suse.cz> wrote:
>> I didn't spot an obvious mistake in the patch itself, so it looks
>> like some bad interaction between scheduler and the mmap downgrade?
> I'm thinking it's RWSEM_SPIN_ON_OWNER that ends up being confused by
> the downgrade.
>
> It looks like the benchmark used to be basically CPU-bound, at about
> 800% CPU, and now it's somewhere in the 200% CPU region:
>
> will-it-scale.time.percent_of_cpu_this_job_got
>
> 800 +-+-------------------------------------------------------------------+
> |.+.+.+.+.+.+.+. .+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+..+.+.+.+. .+.+.+.|
> 700 +-+ +. + |
> | |
> 600 +-+ |
> | |
> 500 +-+ |
> | |
> 400 +-+ |
> | |
> 300 +-+ |
> | |
> 200 O-O O O O O O |
> | O O O O O O O O O O O O O O O O O O |
> 100 +-+-------------------------------------------------------------------+
>
> which sounds like the downgrade really messes with the "spin waiting
> for lock" logic.
>
> I'm thinking it's the "wake up waiter" logic that has some bad
> interaction with spinning, and breaks that whole optimization.
>
> Adding Waiman and Davidlohr to the participants, because they seem to
> be the obvious experts in this area.
>
> Linus
Optimistic spinning on rwsem is done only on writers spinning on a
writer-owned rwsem. If a write-lock is downgraded to a read-lock, all
the spinning waiters will quit. That may explain the drop in cpu
utilization. I do have a old patch that enable a certain amount of
reader spinning which may help the situation. I can rebase that and send
it out for review if people have interest.
Cheers,
Longman
next prev parent reply other threads:[~2018-11-05 22:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 5:08 kernel test robot
2018-11-05 17:50 ` Linus Torvalds
2018-11-05 18:28 ` Yang Shi
2018-11-05 18:35 ` Linus Torvalds
2018-11-05 20:17 ` Yang Shi
2018-11-05 20:09 ` Vlastimil Babka
2018-11-05 22:14 ` Linus Torvalds
2018-11-05 22:40 ` Waiman Long [this message]
2018-12-28 1:31 ` Wang, Kemi
2018-12-28 2:55 ` Waiman Long
2018-12-28 2:55 ` kemi
2019-01-31 0:06 ` Tim Chen
2019-01-31 2:54 ` 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=60ef3584-6f3a-1a9a-94d1-3d4a5b9f1e56@redhat.com \
--to=longman@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=colin.king@canonical.com \
--cc=dave@stgolabs.net \
--cc=kirill.shutemov@linux.intel.com \
--cc=ldufour@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@01.org \
--cc=mhocko@kernel.org \
--cc=rong.a.chen@intel.com \
--cc=torvalds@linux-foundation.org \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=yang.shi@linux.alibaba.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
all inboxes | Powered by JetHome®