From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: Mat Martineau <mathewm@codeaurora.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv2] Bluetooth: Add refcnt to l2cap_conn
Date: Mon, 25 Jun 2012 10:53:17 +0300 [thread overview]
Message-ID: <20120625075311.GA11001@aemeltch-MOBL1> (raw)
In-Reply-To: <alpine.DEB.2.02.1206221423110.2543@mathewm-linux>
Hi Mat,
On Fri, Jun 22, 2012 at 03:09:08PM -0700, Mat Martineau wrote:
> >Adding kref to l2cap_conn helps to better handle racing when deleting
> >l2cap_conn. Races are created when deleting conn from timeout and from
> >the other execution path.
> >
> >Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> >---
> >include/net/bluetooth/l2cap.h | 6 ++
> >net/bluetooth/l2cap_core.c | 128 +++++++++++++++++++++++++++++++++--------
> >net/bluetooth/smp.c | 7 +--
> >3 files changed, 113 insertions(+), 28 deletions(-)
> >
>
> This v2 patch adds reference counting for the info timer. Are there
> any other changes compared to v1?
>
> I'm still concerned that this "reference counting" does not count
> every reference. It only counts references used by the timers and
> in l2cap_security_cfm. This is a fragile approach - as the code
> evolves, it's not clear what the rules are for using reference
> counting with l2cap_conn. I think the most maintainable and robust
> approach is to make the rule "Count every reference" (including
> those in hci_conn and l2cap_chan).
Yes this should actually evolve to this.
> What rules do you think are best
> for reference counting in this case? It might be good to include
> that information in the commit message or comments.
I am thinking to add also reference counting for each l2cap_chan created
in l2cap_conn.
Best regards
Andrei Emeltchenko
prev parent reply other threads:[~2012-06-25 7:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-06 14:22 [RFC] Bluetooth: Add refcnt to l2cap_conn Andrei Emeltchenko
2012-06-07 7:04 ` [PATCHv1] " Andrei Emeltchenko
2012-06-08 7:27 ` Andrei Emeltchenko
2012-06-08 16:54 ` Mat Martineau
2012-06-21 14:18 ` [PATCHv2] " Andrei Emeltchenko
2012-06-22 22:09 ` Mat Martineau
2012-06-25 7:53 ` Andrei Emeltchenko [this message]
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=20120625075311.GA11001@aemeltch-MOBL1 \
--to=andrei.emeltchenko.news@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=mathewm@codeaurora.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