From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Jack Morgenstein
<jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
Max Matveev <makc-puGfsi27rH1aa/9Udqfwiw@public.gmane.org>
Cc: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>,
linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Shlomo Pongratz <shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH RFC for-next] net/mlx4_core: Fix racy flow in the driver CQ completion handler
Date: Mon, 10 Sep 2012 13:35:07 +0300 [thread overview]
Message-ID: <504DC25B.1030501@mellanox.com> (raw)
In-Reply-To: <201209100957.08509.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
On 10/09/2012 09:57, Jack Morgenstein wrote:
> + *
> + * For API usage, in general,
> + * - any function _modifying_ the the tree or tags (inserting or deleting
> + * items, setting or clearing tags must exclude other modifications, and
> + * exclude any functions reading the tree.
> + * - any function _reading_ the the tree or tags (looking up items or tags,
> + * gang lookups) must exclude modifications to the tree, but may occur
> + * concurrently with other readers.
> + *
> + * The notable exceptions to this rule are the following functions:
> + * radix_tree_lookup
> + * radix_tree_tag_get
> + * radix_tree_gang_lookup
> + * radix_tree_gang_lookup_tag
> + * radix_tree_tagged
> + *
>
> ======= JPM -- Note the following text! =========================
> + * The first 4 functions are able to be called locklessly, using RCU. The
> + * caller must ensure calls to these functions are made within rcu_read_lock()
> + * regions.
> ===========================================
>
> + * Other readers (lock-free or otherwise) and modifications may be
> + * running concurrently.
>
> Roland, the above states explicitly that radix_tree_lookup should be called only under rcu_read_lock()!
> This is NOT the case in our driver, in mlx4_eq_int()/mlx4_cq_completion() .
>
> Looks to me, then, that the spinlock in mlx4_cq_completion() is required.
>
>
Jack, Max
Actually, can't we do well with rcu_read_lock() in mlx4_cq_completion()
as that commit documentation suggests?
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-09-10 10:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20549.47088.805176.786765@iinet.net.au>
[not found] ` <20549.47088.805176.786765-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org>
2012-09-09 14:08 ` [PATCH RFC for-next] net/mlx4_core: Fix racy flow in the driver CQ completion handler Or Gerlitz
[not found] ` <CAG4TOxOQvAMFSTzM1vRS4XqMTiTPQ2Ofgbm7nEHPpPHD_tNwYw@mail.gmail.com>
[not found] ` <20551.21182.486376.898809@iinet.net.au>
[not found] ` <20551.21182.486376.898809-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org>
2012-09-09 14:09 ` Or Gerlitz
[not found] ` <CAJZOPZLXktTREd3xmE=v14HpP1O+EgiqA54LHwQvPNXNX9Rr7A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-09 15:10 ` Roland Dreier
[not found] ` <CAL1RGDXZtqWcFhPXnit=O81wACdXsyDziv6ivkXMOcTf+8_X6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-10 6:57 ` Jack Morgenstein
[not found] ` <201209100957.08509.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-10 10:35 ` Or Gerlitz [this message]
[not found] ` <504DC25B.1030501-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-09-10 13:17 ` Jack Morgenstein
[not found] ` <201209101617.46581.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-10 13:27 ` Or Gerlitz
[not found] ` <504DEAB7.2070101-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-09-11 6:03 ` Jack Morgenstein
[not found] ` <201209110903.39789.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-11 7:50 ` Or Gerlitz
2012-08-30 10:38 Or Gerlitz
[not found] ` <1346323085-2665-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-08-30 22:17 ` Or Gerlitz
[not found] ` <CAJZOPZJOWuoBQx49-O2WLk240GWGRsqfJpCXfhxRV6Cmdw7W0w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-30 22:35 ` Roland Dreier
[not found] ` <CAL1RGDX7kx7aypOqYvvwu8KBjMra2Gqq+4OGLz22k0RVmeZ1eQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-31 6:53 ` Or Gerlitz
2012-08-31 7:12 ` Or Gerlitz
2012-08-31 7:02 ` Or Gerlitz
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=504DC25B.1030501@mellanox.com \
--to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=makc-puGfsi27rH1aa/9Udqfwiw@public.gmane.org \
--cc=roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org \
--cc=shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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).