From: Roman Penyaev <rpenyaev@suse.de>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jason Baron <jbaron@akamai.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: [RFC PATCH 1/1] epoll: use rwlock in order to reduce ep_poll_callback() contention
Date: Thu, 06 Dec 2018 11:25:57 +0100 [thread overview]
Message-ID: <98d200aa103fd6086c02dd620b65e961@suse.de> (raw)
In-Reply-To: <20181206040430.d7wjik6lt7kr75m6@linux-r8p5>
On 2018-12-06 05:04, Davidlohr Bueso wrote:
> On 12/3/18 6:02 AM, Roman Penyaev wrote:
>
>> The main change is in replacement of the spinlock with a rwlock, which
>> is
>> taken on read in ep_poll_callback(), and then by adding poll items to
>> the
>> tail of the list using xchg atomic instruction. Write lock is taken
>> everywhere else in order to stop list modifications and guarantee that
>> list
>> updates are fully completed (I assume that write side of a rwlock does
>> not
>> starve, it seems qrwlock implementation has these guarantees).
>
> Its good then that Will recently ported qrwlocks to arm64, which iirc
> had
> a bad case of writer starvation. In general, qrwlock will maintain
> reader
> to writer ratios of acquisitions fairly well, but will favor readers
> over
> writers in scenarios where when too many tasks (more than ncpus).
Thanks for noting that. Then that should not be a problem, since number
of
parallel ep_poll_callback() calls can't be greater then number of CPUs
because of the wq.lock which is taken by the caller of
ep_poll_callback().
BTW, did someone make any estimations how much does the latency on the
write side increase if the number of readers is greater than CPUs?
--
Roman
next prev parent reply other threads:[~2018-12-06 10:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-03 11:02 [RFC PATCH 1/1] epoll: use rwlock in order to reduce ep_poll_callback() contention Roman Penyaev
2018-12-03 17:34 ` Linus Torvalds
2018-12-04 11:50 ` Roman Penyaev
2018-12-04 23:59 ` Andrea Parri
2018-12-05 11:25 ` Roman Penyaev
2018-12-04 17:23 ` Jason Baron
2018-12-04 19:02 ` Paul E. McKenney
2018-12-05 11:22 ` Roman Penyaev
2018-12-05 11:16 ` Roman Penyaev
2018-12-05 16:38 ` Jason Baron
2018-12-05 20:11 ` Roman Penyaev
2018-12-06 1:54 ` Davidlohr Bueso
2018-12-06 3:08 ` Davidlohr Bueso
2018-12-06 10:27 ` Roman Penyaev
2018-12-06 4:04 ` Davidlohr Bueso
2018-12-06 10:25 ` Roman Penyaev [this message]
2018-12-05 23:46 ` Eric Wong
2018-12-06 10:52 ` Roman Penyaev
2018-12-06 20:35 ` Eric Wong
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=98d200aa103fd6086c02dd620b65e961@suse.de \
--to=rpenyaev@suse.de \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=jbaron@akamai.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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).