All of lore.kernel.org
 help / color / mirror / Atom feed
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>,
	Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
Cc: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Shlomo Pongratz <shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	dotanb-VPRAkNaXOzVS1MOuV/RT9w@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 16:27:19 +0300	[thread overview]
Message-ID: <504DEAB7.2070101@mellanox.com> (raw)
In-Reply-To: <201209101617.46581.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

On 10/09/2012 16:17, Jack Morgenstein wrote:
> I don't know. I do notice (in file include/linux/rcupdate.h) that 
> rcu_read_lock/unlock is meant to be used in the interrupt context. 
> Would it be sufficient (besides rcu_read_lock/unlock calls) to add a 
> call rcu_synchronize() in mlx4_cq_free (after calling synchronize_irq)? 

I  took a look on the practice/wrapping used over the mm subsystem for 
radix_tree_lookup calls, whose maintainer,
Andrew Morton is signed on the patch Roland pointed to, its just 
rcu_read_lock/unlock, seems this is what to do as well.


> mm/readahead.c-179- rcu_read_lock();
> mm/readahead.c:180:             page = 
> radix_tree_lookup(&mapping->page_tree, page_offset);
> mm/readahead.c-181-             rcu_read_unlock();
> --
> mm/shmem.c-278- rcu_read_lock();
> mm/shmem.c:279: item = radix_tree_lookup(&mapping->page_tree, index);
> mm/shmem.c-280- rcu_read_unlock();
> --
> mm/vmalloc.c-986-       rcu_read_lock();
> mm/vmalloc.c:987:       vb = radix_tree_lookup(&vmap_block_tree, vb_idx);
> mm/vmalloc.c-988-       rcu_read_unlock();


> Could we also then dispense with the spinlocks in mlx4_cq_event() as 
> well? 

I don't see why mlx4_cq_event should be treated differently.

> Acquiring the SINGLE cq_table->lock spinlock for EVERY completion 
> event of EVERY cq seems very nasty to me (probably why Roland did not 
> do this), and it would clearly be desirable not to have to do this

so we have a way to avoid it, with rcu_read_lock, Max/Roland, agree?

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

  parent reply	other threads:[~2012-09-10 13:27 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
     [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 [this message]
     [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=504DEAB7.2070101@mellanox.com \
    --to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=dotanb-VPRAkNaXOzVS1MOuV/RT9w@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 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.