From: Jeremy Kerr <jk@codeconstruct.com.au>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Matt Johnston <matt@codeconstruct.com.au>,
netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH net-next v3 1/2] mctp: make __mctp_dev_get() take a refcount hold
Date: Wed, 23 Feb 2022 12:22:58 +0800 [thread overview]
Message-ID: <d7ee44e4ca9340943e88306542326f0e3b756837.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20220222195914.6f001f66@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Hi Jakub,
> Jeremy, did you have any specific semantics or naming scheme in mind
> here? PTAL. Is it better to make __mctp_dev_get() "safe" or create
> mctp_dev_get()? etc
The __ prefix is (was?) more about the requirement for the RCU read lock
there. That's still the case, so the __ may still be applicable.
We only have one non-test usage of a contender for a RCU-locked
mctp_dev_get(), ie, currently:
rcu_read_lock();
dev = __mctp_dev_get();
rcu_read_unlock();
- so I'm not sure it's worthwhile adding a separate function for that
at present, and I'm OK with this patch retaining the __.
I guess the question is really: as per existing conventions, does __
more imply an unlocked accessor, or a non-reference-counting accessor?
Cheers,
Jeremy
next prev parent reply other threads:[~2022-02-23 4:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 4:17 [PATCH net-next v3 0/2] mctp: Fix incorrect refs for extended addr Matt Johnston
2022-02-22 4:17 ` [PATCH net-next v3 1/2] mctp: make __mctp_dev_get() take a refcount hold Matt Johnston
2022-02-23 3:59 ` Jakub Kicinski
2022-02-23 4:22 ` Jeremy Kerr [this message]
2022-02-22 4:17 ` [PATCH net-next v3 2/2] mctp: Fix incorrect netdev unref for extended addr Matt Johnston
2022-02-23 12:30 ` [PATCH net-next v3 0/2] mctp: Fix incorrect refs " patchwork-bot+netdevbpf
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=d7ee44e4ca9340943e88306542326f0e3b756837.camel@codeconstruct.com.au \
--to=jk@codeconstruct.com.au \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=matt@codeconstruct.com.au \
--cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).