From: Alice Ryhl <aliceryhl@google.com>
To: Carlos Llamas <cmllamas@google.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Martijn Coenen" <maco@android.com>,
"Joel Fernandes" <joel@joelfernandes.org>,
"Christian Brauner" <brauner@kernel.org>,
"Suren Baghdasaryan" <surenb@google.com>,
linux-kernel@vger.kernel.org, kernel-team@android.com,
"Tim Murray" <timmurray@google.com>
Subject: Re: [PATCH 3/4] binder: add support for PF_LARGE_HANDLES
Date: Thu, 18 Apr 2024 10:21:49 +0200 [thread overview]
Message-ID: <CAH5fLghRmYFLa-ag9vo4vv_P281jXGFfsDFyGq5pk5g0PUXtUA@mail.gmail.com> (raw)
In-Reply-To: <20240417191418.1341988-4-cmllamas@google.com>
On Wed, Apr 17, 2024 at 9:15 PM Carlos Llamas <cmllamas@google.com> wrote:
>
> Introduce the PF_LARGE_HANDLES flag to enable the use of monotonically
> increasing counters to generate handles. This improves performance in
> transactions when dealing with a large number of references.
>
> The legacy logic performs an inorder traversal of an rbtree to find the
> smallest unused handle. This limitation is due to userspace using the
> handles as indexes (e.g. in vectors). The new logic scales much better
> but requires userspace to support large handle numbers.
>
> The benchmark below with 100,000 references shows the performance gains
> in binder_get_ref_for_node_olocked() calls with PF_LARGE_HANDLES.
>
> [ 167.855945] binder_get_ref_for_node_olocked: 17us (flag on)
> [ 237.088072] binder_get_ref_for_node_olocked: 18178us (flag off)
>
> Suggested-by: Tim Murray <timmurray@google.com>
> Suggested-by: Alice Ryhl <aliceryhl@google.com>
> Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
next prev parent reply other threads:[~2024-04-18 8:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 19:13 [PATCH 0/4] binder: optimize handle generation logic Carlos Llamas
2024-04-17 19:13 ` [PATCH 1/4] binder: introduce BINDER_SET_PROC_FLAGS ioctl Carlos Llamas
2024-04-18 8:34 ` Alice Ryhl
2024-04-20 23:39 ` Carlos Llamas
2024-04-22 8:56 ` Alice Ryhl
2024-04-22 22:48 ` Carlos Llamas
2024-04-23 8:18 ` Alice Ryhl
2024-04-17 19:13 ` [PATCH 2/4] binder: migrate ioctl to new PF_SPAM_DETECTION Carlos Llamas
2024-04-18 8:12 ` Alice Ryhl
2024-04-20 23:49 ` Carlos Llamas
2024-04-22 8:52 ` Alice Ryhl
2024-04-22 22:24 ` Carlos Llamas
2024-04-17 19:13 ` [PATCH 3/4] binder: add support for PF_LARGE_HANDLES Carlos Llamas
2024-04-18 8:21 ` Alice Ryhl [this message]
2024-04-17 19:13 ` [PATCH 4/4] binder: fix max_thread type inconsistency Carlos Llamas
2024-04-18 4:40 ` Greg Kroah-Hartman
2024-04-21 0:00 ` Carlos Llamas
2024-04-21 6:39 ` Greg Kroah-Hartman
2024-04-21 17:48 ` Carlos Llamas
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=CAH5fLghRmYFLa-ag9vo4vv_P281jXGFfsDFyGq5pk5g0PUXtUA@mail.gmail.com \
--to=aliceryhl@google.com \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=cmllamas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=joel@joelfernandes.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=surenb@google.com \
--cc=timmurray@google.com \
--cc=tkjos@android.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;
as well as URLs for NNTP newsgroup(s).