From: Leon Romanovsky <leon@kernel.org>
To: Parav Pandit <pandit.parav@gmail.com>
Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
tj@kernel.org, lizefan@huawei.com, hannes@cmpxchg.org,
dledford@redhat.com, hch@lst.de, liranl@mellanox.com,
sean.hefty@intel.com, jgunthorpe@obsidianresearch.com,
haggaie@mellanox.com, corbet@lwn.net, james.l.morris@oracle.com,
serge@hallyn.com, ogerlitz@mellanox.com, matanb@mellanox.com,
akpm@linux-foundation.org, linux-security-module@vger.kernel.org
Subject: Re: [PATCHv12 1/3] rdmacg: Added rdma cgroup controller
Date: Wed, 31 Aug 2016 12:38:36 +0300 [thread overview]
Message-ID: <20160831093836.GC3694@leon.nu> (raw)
In-Reply-To: <1472632647-1525-2-git-send-email-pandit.parav@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2059 bytes --]
On Wed, Aug 31, 2016 at 02:07:25PM +0530, Parav Pandit wrote:
> Added rdma cgroup controller that does accounting, limit enforcement
> on rdma/IB verbs and hw resources.
>
> Added rdma cgroup header file which defines its APIs to perform
> charing/uncharing functionality. It also defined APIs for RDMA/IB
> stack for device registration. Devices which are registered will
> participate in controller functions of accounting and limit
> enforcements. It define rdmacg_device structure to bind IB stack
> and RDMA cgroup controller.
>
> RDMA resources are tracked using resource pool. Resource pool is per
> device, per cgroup entity which allows setting up accounting limits
> on per device basis.
>
> Currently resources are defined by the RDMA cgroup.
>
> Resource pool is created/destroyed dynamically whenever
> charging/uncharging occurs respectively and whenever user
> configuration is done. Its a tradeoff of memory vs little more code
> space that creates resource pool object whenever necessary, instead of
> creating them during cgroup creation and device registration time.
>
> Signed-off-by: Parav Pandit <pandit.parav@gmail.com>
> ---
<...>
> +
> +static struct rdmacg_resource_pool *
> +get_cg_rpool_locked(struct rdma_cgroup *cg, struct rdmacg_device *device)
> +{
> + struct rdmacg_resource_pool *rpool;
> +
> + rpool = find_cg_rpool_locked(cg, device);
> + if (rpool)
> + return rpool;
> +
> + rpool = kzalloc(sizeof(*rpool), GFP_KERNEL);
> + if (!rpool)
> + return ERR_PTR(-ENOMEM);
> +
> + rpool->device = device;
> + set_all_resource_max_limit(rpool);
> +
> + INIT_LIST_HEAD(&rpool->cg_node);
> + INIT_LIST_HEAD(&rpool->dev_node);
> + list_add_tail(&rpool->cg_node, &cg->rpools);
> + list_add_tail(&rpool->dev_node, &device->rpools);
> + return rpool;
> +}
<...>
> + for (p = cg; p; p = parent_rdmacg(p)) {
> + rpool = get_cg_rpool_locked(p, device);
> + if (IS_ERR_OR_NULL(rpool)) {
get_cg_rpool_locked always returns !NULL (error, or pointer)
> + ret = PTR_ERR(rpool);
> + goto err;
I didn't review the whole series yet.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-08-31 9:38 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-31 8:37 [PATCHv12 0/3] rdmacg: IB/core: rdma controller support Parav Pandit
2016-08-31 8:37 ` [PATCHv12 1/3] rdmacg: Added rdma cgroup controller Parav Pandit
2016-08-31 9:38 ` Leon Romanovsky [this message]
2016-09-07 15:07 ` Parav Pandit
2016-09-08 6:12 ` Leon Romanovsky
2016-09-08 10:20 ` Parav Pandit
2016-08-31 15:07 ` Matan Barak
2016-08-31 21:16 ` Tejun Heo
2016-09-01 7:25 ` Matan Barak
2016-09-01 8:44 ` Christoph Hellwig
2016-09-07 7:55 ` Parav Pandit
2016-09-07 8:51 ` Matan Barak
2016-09-07 14:54 ` Parav Pandit
2016-09-10 16:14 ` Christoph Hellwig
2016-09-10 17:01 ` Jason Gunthorpe
2016-09-11 8:07 ` Matan Barak
2016-09-11 13:34 ` Christoph Hellwig
2016-09-11 14:35 ` Leon Romanovsky
2016-09-11 17:14 ` Jason Gunthorpe
2016-09-11 17:24 ` Christoph Hellwig
2016-09-11 17:52 ` Jason Gunthorpe
2016-09-12 5:07 ` Leon Romanovsky
2016-09-14 7:06 ` Parav Pandit
2016-09-14 8:14 ` Matan Barak
2016-09-14 9:19 ` Parav Pandit
2016-09-15 18:56 ` Leon Romanovsky
2016-09-21 4:43 ` Parav Pandit
2016-09-21 14:26 ` Tejun Heo
2016-09-21 16:02 ` Parav Pandit
2016-10-04 18:19 ` Parav Pandit
2016-10-05 6:37 ` Christoph Hellwig
2016-10-05 11:22 ` Leon Romanovsky
2016-10-05 15:36 ` Tejun Heo
2016-10-06 12:55 ` Parav Pandit
2016-10-18 20:15 ` Parav Pandit
2016-09-19 13:10 ` Dalessandro, Dennis
2016-09-19 17:00 ` Parav Pandit
2016-09-10 16:12 ` Christoph Hellwig
2016-09-11 7:40 ` Matan Barak
2016-08-31 8:37 ` [PATCHv12 2/3] IB/core: added support to use " Parav Pandit
2016-08-31 8:37 ` [PATCHv12 3/3] rdmacg: Added documentation for rdmacg Parav Pandit
2016-08-31 13:56 ` [PATCHv12 0/3] rdmacg: IB/core: rdma controller support Tejun Heo
2016-10-05 11:22 ` Leon Romanovsky
2016-10-06 12:59 ` 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=20160831093836.GC3694@leon.nu \
--to=leon@kernel.org \
--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=hch@lst.de \
--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=pandit.parav@gmail.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 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).