From: Carlos Llamas <cmllamas@google.com>
To: Alice Ryhl <aliceryhl@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>,
"John Stultz" <jstultz@google.com>,
"Steven Moreland" <smoreland@google.com>,
"Nick Chen" <chenjia3@oppo.com>
Subject: Re: [PATCH v2] binder: use bitmap for faster descriptor lookup
Date: Wed, 15 May 2024 16:38:51 +0000 [thread overview]
Message-ID: <ZkTlG-ZNHRYXnHLQ@google.com> (raw)
In-Reply-To: <CAH5fLgjzVHSAQBF5-C1BthK1jspAGRr1z4SQXdQepkeVL9Eq2A@mail.gmail.com>
On Wed, May 15, 2024 at 05:29:29PM +0200, Alice Ryhl wrote:
> On Tue, May 14, 2024 at 6:09 PM Carlos Llamas <cmllamas@google.com> wrote:
> > +static inline int
> > +dbitmap_get_first_zero_bit(struct dbitmap *dmap, unsigned long *bit)
> > +{
> > + unsigned long n;
> > +
> > + n = find_first_zero_bit(dmap->map, dmap->nbits);
> > + if (unlikely(n == dmap->nbits))
> > + return -ENOSPC;
> > +
> > + *bit = n;
> > + set_bit(n, dmap->map);
> > +
> > + return 0;
> > +}
>
> Could we rename this method to something that makes it more clear that
> it's not just a getter, but that it actually also sets the bit?
>
> Alice
Sure, what were you thinking? I had picked "get" and not just "find" to
indicate this behavior. However, I'll take any better ideas. The option
of dbitmap_find_and_set_first_zero_bit() seemed too long for me.
--
Carlos Llamas
next prev parent reply other threads:[~2024-05-15 16:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 16:09 [PATCH v2] binder: use bitmap for faster descriptor lookup Carlos Llamas
2024-05-14 20:35 ` Christophe JAILLET
2024-05-14 21:11 ` Carlos Llamas
2024-05-15 15:29 ` Alice Ryhl
2024-05-15 16:38 ` Carlos Llamas [this message]
2024-05-15 16:43 ` Carlos Llamas
2024-05-15 21:42 ` Alice Ryhl
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=ZkTlG-ZNHRYXnHLQ@google.com \
--to=cmllamas@google.com \
--cc=aliceryhl@google.com \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=chenjia3@oppo.com \
--cc=gregkh@linuxfoundation.org \
--cc=joel@joelfernandes.org \
--cc=jstultz@google.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=smoreland@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.