All of lore.kernel.org
 help / color / mirror / Atom feed
From: Parav Pandit <pandit.parav@gmail.com>
To: Haggai Eran <haggaie@mellanox.com>
Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	Tejun Heo <tj@kernel.org>,
	lizefan@huawei.com, Johannes Weiner <hannes@cmpxchg.org>,
	Doug Ledford <dledford@redhat.com>,
	Liran Liss <liranl@mellanox.com>,
	"Hefty, Sean" <sean.hefty@intel.com>,
	Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	Jonathan Corbet <corbet@lwn.net>,
	james.l.morris@oracle.com, serge@hallyn.com,
	Or Gerlitz <ogerlitz@mellanox.com>,
	Matan Barak <matanb@mellanox.com>,
	raindel@mellanox.com, akpm@linux-foundation.org,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCHv6 2/3] IB/core: added support to use rdma cgroup controller
Date: Wed, 24 Feb 2016 21:35:00 +0530	[thread overview]
Message-ID: <CAG53R5WmLucikiKbFbwJipY936Z07UvvDtWST88S4g10HyJ2Ng@mail.gmail.com> (raw)
In-Reply-To: <56CDB374.602@mellanox.com>

On Wed, Feb 24, 2016 at 7:13 PM, Haggai Eran <haggaie@mellanox.com> wrote:

>> + * all the resources are deallocated, and after a stage when any
>> + * other resource allocation of user application cannot be done
>> + * for this device to avoid any leak in accounting.
>> + * HCA drivers should clear resource pool ops after ib stack
>> + * unregisters with rdma cgroup.
> HCA drivers don't supply their own ops in this version, right?
> If so, you can update the comment.
Yes. I will update.

>> +
> I'm not sure I understand why you need to keep the PD here. Why
> don't you use the same ib_device that is used to create the QP?
> The same applies comment also applies to other uverbs commands.

My bad. Left out of previous implementation. I have changed it now.

>
>>       if (cmd->qp_type == IB_QPT_XRC_TGT) {
>>               xrcd = idr_read_xrcd(cmd->pd_handle, file->ucontext,
>>                                    &xrcd_uobj);
>> @@ -1811,8 +1891,7 @@ static int create_qp(struct ib_uverbs_file *file,
>>
>>               scq = idr_read_cq(cmd->send_cq_handle, file->ucontext, !!rcq);
>>               rcq = rcq ?: scq;
>> -             pd  = idr_read_pd(cmd->pd_handle, file->ucontext);
>> -             if (!pd || !scq) {
>> +             if (!scq) {
>>                       ret = -EINVAL;
>>                       goto err_put;
>>               }
>> @@ -1858,6 +1937,11 @@ static int create_qp(struct ib_uverbs_file *file,
>>                       goto err_put;
>>               }
>>
>> +     ret = ib_rdmacg_try_charge(&obj->uevent.uobject.cg_obj, pd->device,
>> +                                RDMA_VERB_RESOURCE_QP, 1);
>> +     if (ret)
>> +             goto err_put;
>> +
>>       if (cmd->qp_type == IB_QPT_XRC_TGT)
>>               qp = ib_create_qp(pd, &attr);
>>       else
>> @@ -1865,7 +1949,7 @@ static int create_qp(struct ib_uverbs_file *file,
>>
>>       if (IS_ERR(qp)) {
>>               ret = PTR_ERR(qp);
>> -             goto err_put;
>> +             goto err_create;
>>       }
>>
>>       if (cmd->qp_type != IB_QPT_XRC_TGT) {
>> @@ -1940,6 +2024,10 @@ err_cb:
>>  err_destroy:
>>       ib_destroy_qp(qp);
>>
>> +err_create:
>> +     ib_rdmacg_uncharge(&obj->uevent.uobject.cg_obj, device,
>> +                        RDMA_VERB_RESOURCE_QP, 1);
>> +
>>  err_put:
>>       if (xrcd)
>>               put_xrcd_read(xrcd_uobj);
>
>> @@ -3323,6 +3441,11 @@ static int __uverbs_create_xsrq(struct ib_uverbs_file *file,
>>       obj->uevent.events_reported = 0;
>>       INIT_LIST_HEAD(&obj->uevent.event_list);
>>
>> +     ret = ib_rdmacg_try_charge(&obj->uevent.uobject.cg_obj, pd->device,
>> +                                RDMA_VERB_RESOURCE_SRQ, 1);
>> +     if (ret)
>> +             goto err_put_cq;
>> +
> I think you need a new error label to release the PD IDR but not
> uncharge.

Yes. Changed.

  reply	other threads:[~2016-02-24 16:05 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-20 11:00 [PATCHv6 0/3] rdmacg: IB/core: rdma controller support Parav Pandit
2016-02-20 11:00 ` Parav Pandit
2016-02-20 11:00 ` [PATCHv6 2/3] IB/core: added support to use rdma cgroup controller Parav Pandit
     [not found]   ` <1455966006-13774-3-git-send-email-pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-24 13:43     ` Haggai Eran
2016-02-24 13:43       ` Haggai Eran
2016-02-24 16:05       ` Parav Pandit [this message]
     [not found] ` <1455966006-13774-1-git-send-email-pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-20 11:00   ` [PATCHv6 1/3] rdmacg: Added " Parav Pandit
2016-02-20 11:00     ` Parav Pandit
2016-02-21  7:43     ` Leon Romanovsky
2016-02-21 11:33       ` Parav Pandit
     [not found]         ` <CAG53R5XGJESb+_-FtjLsK+jHoEmbePLd==G2knBMOcrfdPm62Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-21 13:45           ` Leon Romanovsky
2016-02-21 13:45             ` Leon Romanovsky
     [not found]             ` <20160221134518.GM30450-2ukJVAZIZ/Y@public.gmane.org>
2016-02-21 14:11               ` Parav Pandit
2016-02-21 14:11                 ` Parav Pandit
2016-02-21 15:09                 ` Leon Romanovsky
2016-02-21 15:15                   ` Parav Pandit
2016-02-24 13:13     ` Haggai Eran
2016-02-24 13:13       ` Haggai Eran
     [not found]       ` <56CDAC7A.6030206-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-02-24 16:16         ` Parav Pandit
2016-02-24 16:16           ` Parav Pandit
     [not found]           ` <CAG53R5Uof+Ve7CndWy=BrgtxxCisQpzP_Ls0kw=Q270DhoEsZw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-25 12:03             ` Haggai Eran
2016-02-25 12:03               ` Haggai Eran
     [not found]               ` <56CEED81.7010507-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-02-25 13:34                 ` Parav Pandit
2016-02-25 13:34                   ` Parav Pandit
2016-02-25 14:26                   ` Parav Pandit
     [not found]                     ` <CAG53R5WxXYZof4QzuJndakzvG1+t388pDRXL2O466eEDkYJ+bw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-25 14:42                       ` Haggai Eran
2016-02-25 14:42                         ` Haggai Eran
     [not found]                   ` <CAG53R5UZb=9WR7zk2b5C_FuKmt+WdNkbcrVbW+g1-oAj6J=w_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-25 14:30                     ` Haggai Eran
2016-02-25 14:30                       ` Haggai Eran
2016-02-20 11:00   ` [PATCHv6 3/3] rdmacg: Added documentation for rdmacg Parav Pandit
2016-02-20 11:00     ` Parav Pandit
2016-02-20 11:00     ` Parav Pandit
     [not found]     ` <1455966006-13774-4-git-send-email-pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-24 14:26       ` Haggai Eran
2016-02-24 14:26         ` Haggai Eran
2016-02-24 15:21         ` Parav Pandit
2016-02-28  8:55           ` Haggai Eran
2016-02-28  8:55             ` Haggai Eran
2016-02-28  9:02             ` Parav Pandit
2016-02-22  4:59 ` [PATCHv6 0/3] rdmacg: IB/core: rdma controller support Parav Pandit

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=CAG53R5WmLucikiKbFbwJipY936Z07UvvDtWST88S4g10HyJ2Ng@mail.gmail.com \
    --to=pandit.parav@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=dledford@redhat.com \
    --cc=haggaie@mellanox.com \
    --cc=hannes@cmpxchg.org \
    --cc=james.l.morris@oracle.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=liranl@mellanox.com \
    --cc=lizefan@huawei.com \
    --cc=matanb@mellanox.com \
    --cc=ogerlitz@mellanox.com \
    --cc=raindel@mellanox.com \
    --cc=sean.hefty@intel.com \
    --cc=serge@hallyn.com \
    --cc=tj@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 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.