From: Boqun Feng <boqun.feng@gmail.com>
To: Alice Ryhl <aliceryhl@google.com>
Cc: Filipe Xavier <felipe_life@live.com>,
ojeda@kernel.org, gary@garyguo.net, benno.lossin@proton.me,
will@kernel.org, longman@redhat.com,
rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v3] rust: add trylock method support for lock backend
Date: Fri, 27 Sep 2024 01:24:20 -0700 [thread overview]
Message-ID: <ZvZrtDAaqq-XHqGy@boqun-archlinux> (raw)
In-Reply-To: <CAH5fLgjLLvaT2n9seJRp5WFTHG9kNG1wEWAi5FUWzR172tf4cw@mail.gmail.com>
On Fri, Sep 27, 2024 at 10:03:43AM +0200, Alice Ryhl wrote:
> On Thu, Sep 26, 2024 at 10:50 PM Filipe Xavier <felipe_life@live.com> wrote:
> >
> > Add a non-blocking trylock method to lock backend interface, mutex
> > and spinlock implementations. It includes a C helper for spin_trylock.
> > Rust Binder will use this method together with the new shrinker abstractions
> > to avoid deadlocks in the memory shrinker.
> >
> > Link: https://lore.kernel.org/all/20240912-shrinker-v1-1-18b7f1253553@google.com
> > Signed-off-by: Filipe Xavier <felipe_life@live.com>
>
> I guess there is the question of whether it should be called trylock
> or try_lock. One matches the kernel, the other matches the Rust
> standard library.
>
I prefer try_lock, not because it matches the Rust standard library, but
because it matches with other try-like APIs.
Regards,
Boqun
> Either way:
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
next prev parent reply other threads:[~2024-09-27 8:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-26 20:50 [PATCH v3] rust: add trylock method support for lock backend Filipe Xavier
2024-09-27 8:03 ` Alice Ryhl
2024-09-27 8:24 ` Boqun Feng [this message]
2024-09-27 8:28 ` Boqun Feng
2024-09-27 9:07 ` Fiona Behrens
2024-10-05 22:05 ` Miguel Ojeda
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=ZvZrtDAaqq-XHqGy@boqun-archlinux \
--to=boqun.feng@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=felipe_life@live.com \
--cc=gary@garyguo.net \
--cc=longman@redhat.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=will@kernel.org \
/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