From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>,
Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Tal Alon <talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Liran Liss <liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH for-next 1/7] IB/core: Refactor IDR to be per-device
Date: Wed, 11 Jan 2017 15:39:17 -0700 [thread overview]
Message-ID: <20170111223917.GA31682@obsidianresearch.com> (raw)
In-Reply-To: <1484132033-3346-2-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
On Wed, Jan 11, 2017 at 12:53:47PM +0200, Matan Barak wrote:
> From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> The current code creates an IDR per type. Since types are currently
> common for all vendors and known in advance, this was good enough.
> However, the proposed ioctl based infrastructure allows each vendor
> to declare only some of the common types and declare its own specific
> types.
>
> Thus, we decided to implement IDR to be per device and refactor it to
> use a new file.
I'm still unclear why we want the idr to be global and not per
/dev/uverbs0 open fd.
__idr_get_uobj forces a strong association:
if (uobj->context == context)
Why on earth should we have a shared IDR when the objects cannot
actually be shared?
Surely that just wastes memory and harms performance.
I know we have talked about this before, but I think there should be a
strong reason why we don't move this into struct ib_ucontext in this
patch.
> +static void ib_device_allocate_idrs(struct ib_device *device)
> +{
> + spin_lock_init(&device->idr_lock);
> + idr_init(&device->idr);
> +}
> +
> +static void ib_device_destroy_idrs(struct ib_device *device)
> +{
> + idr_destroy(&device->idr);
> +}
Not sure why we need these wrappers..
> @@ -230,24 +228,24 @@ static void put_cq_read(struct ib_cq *cq)
> put_uobj_read(cq->uobject);
> }
>
> -static struct ib_ah *idr_read_ah(int ah_handle, struct ib_ucontext *context)
> +static void put_ah_read(struct ib_ah *ah)
> {
> - return idr_read_obj(&ib_uverbs_ah_idr, ah_handle, context, 0);
> + put_uobj_read(ah->uobject);
> }
>
> -static void put_ah_read(struct ib_ah *ah)
> +static struct ib_ah *idr_read_ah(int ah_handle, struct ib_ucontext *context)
> {
> - put_uobj_read(ah->uobject);
> + return idr_read_obj(ah_handle, context, 0);
> }
These two functions got reordered, makes the diff ugly.
> + struct idr idr;
> + /* Global lock in use to safely release device IDR */
> + spinlock_t idr_lock;
That comment doesn't make sense, has nothing to do with
release... 'spinlock protects idr'
Otherwise this patch looks fine to me.
Jason
--
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:[~2017-01-11 22:39 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-11 10:53 [PATCH for-next 0/7] Change IDR usage and locking in uverbs Matan Barak
[not found] ` <1484132033-3346-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-11 10:53 ` [PATCH for-next 1/7] IB/core: Refactor IDR to be per-device Matan Barak
[not found] ` <1484132033-3346-2-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-11 22:39 ` Jason Gunthorpe [this message]
[not found] ` <20170111223917.GA31682-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-17 17:08 ` Matan Barak
[not found] ` <CAAKD3BDMDyahSu1uFPE_bA=QXAy9Q+qdMPoVw-hJTrFN3um9rg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-17 18:09 ` Jason Gunthorpe
2017-01-11 10:53 ` [PATCH for-next 2/7] IB/core: Add support for custom types Matan Barak
[not found] ` <1484132033-3346-3-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-11 23:28 ` Jason Gunthorpe
[not found] ` <20170111232811.GB31682-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-17 17:23 ` Matan Barak
[not found] ` <CAAKD3BBkzoLuY3TF=bDK3U=rnLzK0uWmDL2tgsUwmBoGTXAqrw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-17 19:01 ` Jason Gunthorpe
2017-01-11 10:53 ` [PATCH for-next 3/7] IB/core: Add support for fd objects Matan Barak
[not found] ` <1484132033-3346-4-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-11 23:58 ` Jason Gunthorpe
[not found] ` <20170111235801.GC31682-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-17 17:24 ` Matan Barak
[not found] ` <CAAKD3BBQLxnh-keng+LjZEyWBYKbXN_Sszk1BcGnyVeZU_45nw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-17 19:11 ` Jason Gunthorpe
2017-01-11 10:53 ` [PATCH for-next 4/7] IB/core: Add generic ucontext initialization and teardown Matan Barak
[not found] ` <1484132033-3346-5-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-12 0:09 ` Jason Gunthorpe
2017-01-11 10:53 ` [PATCH for-next 5/7] IB/core: Add macros for declaring types and type groups Matan Barak
[not found] ` <1484132033-3346-6-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-12 0:10 ` Jason Gunthorpe
[not found] ` <20170112001029.GE31682-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-17 17:25 ` Matan Barak
[not found] ` <CAAKD3BCvEP4MdvSy6dD0DDjfyd+PO8Y=7O+qFwPO5rjGDW_nfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-17 19:13 ` Jason Gunthorpe
2017-01-11 10:53 ` [PATCH for-next 6/7] IB/core: Declare all common IB types Matan Barak
[not found] ` <1484132033-3346-7-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-12 0:19 ` Jason Gunthorpe
[not found] ` <20170112001955.GF31682-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-12 6:48 ` Matan Barak
2017-01-17 17:37 ` Matan Barak
[not found] ` <CAAKD3BBKnJRNF+iqRSkjmGVcff=Hd68wVvXW7y+=pnnc4=yDfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-17 19:15 ` Jason Gunthorpe
2017-01-11 10:53 ` [PATCH for-next 7/7] IB/core: Use the new IDR and locking infrastructure in uverbs_cmd Matan Barak
[not found] ` <1484132033-3346-8-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-11 22:49 ` kbuild test robot
2017-01-11 23:43 ` kbuild test robot
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=20170111223917.GA31682@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=yishaih-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.