From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Vitaly Wool <vitalywool@gmail.com>
Cc: "Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Martijn Coenen" <maco@android.com>,
Oleksiy.Avramchenko@sony.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] binder: use lockless list for deferred_work
Date: Mon, 22 Jan 2018 16:44:28 +0100 [thread overview]
Message-ID: <20180122154428.GA6879@kroah.com> (raw)
In-Reply-To: <20180108145518.1f39ea095da6dd4fbbf660cb@gmail.com>
On Mon, Jan 08, 2018 at 02:55:18PM +0100, Vitaly Wool wrote:
> Binder uses hlist for deferred list, which isn't a good match.
> It's slow and requires mutual exclusion mechanism to protect its
> operations. Moreover, having schedule_work() called under a mutex
> may cause significant delays and creates noticeable adverse effect
> on Binder performance.
>
> Deferred list in Binder is actually treated in a very simple way:
> either add an entry to it or delete the first entry from it. llist
> (lockless list) is a good match for such usage pattern, and it is
> of course quite a bit faster and doesn't require locking.
>
> To be able to add an entry to an llist only if it's not already on
> another llist, this patch adds two small helper functions. That is,
> llist_add_exclusive would only add a node if it's not already on a
> list, and llist_del_first_exclusive will delete the first node off
> the list and mark it as not being on any list.
>
> Signed-off-by: Vitaly Vul <vitaly.vul@sony.com>
> ---
> drivers/android/binder.c | 87 ++++++++++++++++++++++++++++++++++++------------
> 1 file changed, 66 insertions(+), 21 deletions(-)
Martijn and Todd, any objections to this patch?
thanks,
greg k-h
next prev parent reply other threads:[~2018-01-22 15:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 13:55 [PATCH] binder: use lockless list for deferred_work Vitaly Wool
2018-01-22 15:44 ` Greg Kroah-Hartman [this message]
2018-01-22 16:54 ` Todd Kjos
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=20180122154428.GA6879@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Oleksiy.Avramchenko@sony.com \
--cc=arve@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=tkjos@android.com \
--cc=vitalywool@gmail.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