Skip to contentSkip to conversation

rdmacg: IB/core: rdma controller support

PATCH Superseded Parav Pandit 2 participants 9 messages Jan 30, 2016 – Jan 31, 2016

Subsystems (3)

v4 of 14 Superseded Latest is v14 →

lore
Share & tools
lore
#0 lore raw

v4 cover rdmacg: IB/core: rdma controller support

This patchset adds support for RDMA cgroup by addressing review comments of [2], [1] and by implementing published RFC [3].

Overview:
Currently user space applications can easily take away all the rdma device specific resources such as AH, CQ, QP, MR etc. Due to which other applications in other cgroup or kernel space ULPs may not even get chance to allocate any rdma resources. This results into service unavailibility.

RDMA cgroup addresses this issue by allowing resource accounting, limit enforcement on per cgroup, per rdma device basis.

Resources are not defined by the RDMA cgroup. Resources are defined by RDMA/IB stack & optionally by HCA vendor device drivers. This allows rdma cgroup to remain constant while RDMA/IB stack can evolve without the need of rdma cgroup update. A new resource can be easily added by the RDMA/IB stack without touching rdma cgroup.

RDMA uverbs layer will enforce limits on well defined RDMA verb resources without any HCA vendor device driver involvement.

RDMA uverbs layer will not do accounting of hw vendor specific resources. Instead rdma cgroup provides set of APIs through which vendor specific drivers can define their own resources (upto 64) that can be accounted by rdma cgroup.

Resource limit enforcement is hierarchical.

When process is migrated with active RDMA resources, rdma cgroup continues to uncharge original cgroup for allocated resource. New resource is charged to current process's cgroup, which means if the process is migrated with active resources, for new resources it will be charged to new cgroup and old resources will be correctly uncharged from old cgroup.

Changes from v3:
* (To address comments from Tejun)
1. Renamed cg_resource to rdmacg_resource
2. Merged dealloc_cg_rpool and _dealloc_cg_rpool to single function
3. Renamed _find_cg_rpool to find_cg_rpool_locked()
5. Removed RDMACG_MAX_RESOURCE_INDEX limitation
6. Fixed few alignments.
7. Improved description for RDMA cgroup configuration menu
8. Renamed cg_list_lock to rpool_list_lock to reflect the lock is for rpools.
9. Renamed _get_cg_rpool to find_cg_rpool.
10. Made creator as int variable, instead of atomic as its not required to be atomic.
* Fixed freeing right rpool during query_limit error path
* Added copywrite for cgroup.c
* Removed including parser.h from cgroup.c as its included by cgroup_rdma.h
* Reduced try_charge functions to single function and removed duplicate comments.

Changes from v2:
* Fixed compilation error reported by 0-DAY kernel test infrastructure for m68k architecture where CONFIG_CGROUP is also not defined.
* Fixed comment in patch to refer to legacy mode of cgroup, changed to refer to v1 and v2 version.
* Added more information in commit log for rdma controller patch.

Changes from v1:
* (To address comments from Tejun)
a. reduces 3 patches to single patch
b. removed resource word from the cgroup configuration files c. changed cgroup configuration file names to match other cgroups d. removed .list file and merged functionality with .max file
* Based on comment to merge to single patch for rdma controller; IB/core patches are reduced to single patch.
* Removed pid cgroup map and simplified design - Charge/Uncharge caller stack keeps track of the rdmacg for given resource. This removes the need to maintain and perform hash lookup. This also allows little more accurate resource charging/uncharging when process moved from one to other cgroup with active resources and continue to allocate more.
* Critical fix: Removed rdma cgroup's dependency on the kernel module header files to avoid crashes when modules are upgraded without kernel upgrade, which is very common due to high amount of changes in IB stack and it is also shipped as individual kernel modules.
* uboject extended to keep track of the owner rdma cgroup, so that same rdmacg can be used while uncharging.
* Added support functions to hide details of rdmacg device in uverbs modules for cases of cgroup enabled/disabled at compile time. This avoids multiple ifdefs for every API in uverbs layer.
* Removed failure counters in first patch, which will be added once initial feature is merged.
* Fixed stale rpool access which is getting freed, while doing configuration to rdma.verb.max file.
* Fixed rpool resource leak while querying max, current values.

Changes from v0:
(To address comments from Haggai, Doug, Liran, Tejun, Sean, Jason)
* Redesigned to support per device per cgroup limit settings by bringing concept of resource pool.
* Redesigned to let IB stack define the resources instead of rdma controller using resource template.
* Redesigned to support hw vendor specific limits setting (optional to drivers).
* Created new rdma controller instead of piggyback on device cgroup.
* Fixed race conditions for multiple tasks sharing rdma resources.
* Removed dependency on the task_struct.

[1] https://lkml.org/lkml/2016/1/5/632
[2] https://lkml.org/lkml/2015/9/7/476
[3] https://lkml.org/lkml/2015/10/28/144

This patchset is for Tejun's for-4.5 branch.
It is not attempted on Doug's rdma tree yet, which I will do once I receive comments for this pathset.

Parav Pandit (3):
rdmacg: Added rdma cgroup controller. IB/core: added support to use rdma cgroup controller
rdmacg: Added documentation for rdma controller

 Documentation/cgroup-v1/rdma.txt      | 117 ++++
 Documentation/cgroup-v2.txt           |  43 ++
 drivers/infiniband/core/Makefile      |   1 +
 drivers/infiniband/core/cgroup.c      | 137 +++++
 drivers/infiniband/core/core_priv.h   |  45 ++
 drivers/infiniband/core/device.c      |   8 +
 drivers/infiniband/core/uverbs_cmd.c  | 209 ++++++-
 drivers/infiniband/core/uverbs_main.c |  28 +
 include/linux/cgroup_rdma.h           |  79 +++
 include/linux/cgroup_subsys.h         |   4 +
 include/rdma/ib_verbs.h               |  27 +-
 init/Kconfig                          |  11 +
 kernel/Makefile                       |   1 +
 kernel/cgroup_rdma.c                  | 995 ++++++++++++++++++++++++++++++++++
 14 files changed, 1689 insertions(+), 16 deletions(-)
 create mode 100644 Documentation/cgroup-v1/rdma.txt
 create mode 100644 drivers/infiniband/core/cgroup.c
 create mode 100644 include/linux/cgroup_rdma.h
 create mode 100644 kernel/cgroup_rdma.c
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v4 1/3 rdmacg: Added rdma cgroup controller.

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 and device registration which will participate in controller functions of accounting and limit enforcements. It also 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, per resource pool_type entity which allows setting up accounting limits on per device basis.

RDMA cgroup returns error when user space applications try to allocate resources more than its configured limit.

Rdma cgroup implements resource accounting for two types of resource pools.
(a) RDMA IB specification level verb resources defined by IB stack
(b) HCA vendor device specific resources defined by vendor device driver

Resources are not defined by the RDMA cgroup, instead they are defined by the external module, typically IB stack and optionally by HCA drivers for those RDMA devices which doesn't have one to one mapping of IB verb resource with hardware resource. This allows extending IB stack without changing kernel, which is frequent as IB stack is going through changes and enhancements.

Resource pool are 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 whenever necessary, instead of creating them during cgroup creation and device registration time.

---
 include/linux/cgroup_rdma.h   |  79 ++++
 include/linux/cgroup_subsys.h |   4 +
 init/Kconfig                  |  11 +
 kernel/Makefile               |   1 +
 kernel/cgroup_rdma.c          | 995 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 1090 insertions(+)
 create mode 100644 include/linux/cgroup_rdma.h
 create mode 100644 kernel/cgroup_rdma.c
include/linux/cgroup_rdma.h new file +79 -0
new file mode 100644
index 0000000..33f2d37
@@ -0,0 +1,79 @@
+#ifndef _CGROUP_RDMA_H
+#define _CGROUP_RDMA_H
+
+#include <linux/cgroup.h>
+#include <linux/parser.h>
+
+/*
+ * This file is subject to the terms and conditions of version 2 of the GNU
+ * General Public License.  See the file COPYING in the main directory of the
+ * Linux distribution for more details.
+ */
+
+enum rdmacg_resource_pool_type {
+	RDMACG_RESOURCE_POOL_VERB,
+	RDMACG_RESOURCE_POOL_HW,
+	RDMACG_RESOURCE_POOL_TYPE_MAX,
+};
+
+struct rdma_cgroup {
+#ifdef CONFIG_CGROUP_RDMA
+	struct cgroup_subsys_state	css;
+
+	spinlock_t rpool_list_lock;	/* protects resource pool list */
+	struct list_head rpool_head;	/* head to keep track of all resource
+					 * pools that belongs to this cgroup.
+					 */
+#endif
+};
+
+#ifdef CONFIG_CGROUP_RDMA
+
+struct rdmacg_device;
+
+struct rdmacg_pool_info {
+	struct match_token *resource_table;
+	int resource_count;
+};
+
+struct rdmacg_resource_pool_ops {
+	struct rdmacg_pool_info*
+		(*get_resource_pool_tokens)(struct rdmacg_device *);
+};
+
+struct rdmacg_device {
+	struct rdmacg_resource_pool_ops
+				*rpool_ops[RDMACG_RESOURCE_POOL_TYPE_MAX];
+	struct list_head        rdmacg_list;
+	char                    *name;
+};
+
+/* APIs for RDMA/IB stack to publish when a device wants to
+ * participate in resource accounting
+ */
+void rdmacg_register_device(struct rdmacg_device *device, char *dev_name);
+void rdmacg_unregister_device(struct rdmacg_device *device);
+
+/* APIs for RDMA/IB stack to charge/uncharge pool specific resources */
+int rdmacg_try_charge(struct rdma_cgroup **rdmacg,
+		      struct rdmacg_device *device,
+		      enum rdmacg_resource_pool_type type,
+		      int resource_index,
+		      int num);
+void rdmacg_uncharge(struct rdma_cgroup *cg,
+		     struct rdmacg_device *device,
+		     enum rdmacg_resource_pool_type type,
+		     int resource_index,
+		     int num);
+
+void rdmacg_set_rpool_ops(struct rdmacg_device *device,
+			  enum rdmacg_resource_pool_type pool_type,
+			  struct rdmacg_resource_pool_ops *ops);
+void rdmacg_clear_rpool_ops(struct rdmacg_device *device,
+			    enum rdmacg_resource_pool_type pool_type);
+int rdmacg_query_limit(struct rdmacg_device *device,
+		       enum rdmacg_resource_pool_type type,
+		       int *limits, int max_count);
+
+#endif	/* CONFIG_CGROUP_RDMA */
+#endif	/* _CGROUP_RDMA_H */
include/linux/cgroup_subsys.h +4 -0
index 0df0336a..d0e597c 100644
@@ -56,6 +56,10 @@ SUBSYS(hugetlb)
 SUBSYS(pids)
 #endif
 
+#if IS_ENABLED(CONFIG_CGROUP_RDMA)
+SUBSYS(rdma)
+#endif
+
 /*
  * The following subsystems are not supported on the default hierarchy.
  */
init/Kconfig +11 -0
index f8754f5..8ea645e 100644
@@ -1070,6 +1070,17 @@ config CGROUP_PIDS
 	  since the PIDs limit only affects a process's ability to fork, not to
 	  attach to a cgroup.
 
+config CGROUP_RDMA
+	bool "RDMA controller"
+	help
+	  Provides enforcement of RDMA resources at RDMA/IB verb level and
+	  enforcement of any RDMA/IB capable hardware advertised resources.
+	  It is fairly easy for consumers to exhaust RDMA resources, which
+	  can result into resource unavailibility to other consumers.
+	  RDMA controller is designed to stop this from happening.
+	  Attaching processes with active RDMA resources to the cgroup
+	  hierarchy is allowed even if can cross the hierarchy's limit.
+
 config CGROUP_FREEZER
 	bool "Freezer controller"
 	help
kernel/Makefile +1 -0
index 53abf00..26e413c 100644
@@ -57,6 +57,7 @@ obj-$(CONFIG_COMPAT) += compat.o
 obj-$(CONFIG_CGROUPS) += cgroup.o
 obj-$(CONFIG_CGROUP_FREEZER) += cgroup_freezer.o
 obj-$(CONFIG_CGROUP_PIDS) += cgroup_pids.o
+obj-$(CONFIG_CGROUP_RDMA) += cgroup_rdma.o
 obj-$(CONFIG_CPUSETS) += cpuset.o
 obj-$(CONFIG_UTS_NS) += utsname.o
 obj-$(CONFIG_USER_NS) += user_namespace.o
kernel/cgroup_rdma.c new file +995 -0

995 lines not on this page · raw message

Signature · 6 lines
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

PATCH v4 2/3 IB/core: added support to use rdma cgroup controller

In reply to Parav Pandit

Added support APIs for IB core to register/unregister every RDMA device with rdma cgroup for tracking verbs and hw resources.
IB core registers with rdma cgroup controller and also defines resources that can be accounted.
Added support APIs for uverbs layer to make use of rdma controller. Added uverbs layer to perform resource charge/uncharge functionality.

---
 drivers/infiniband/core/Makefile      |   1 +
 drivers/infiniband/core/cgroup.c      | 137 ++++++++++++++++++++++
 drivers/infiniband/core/core_priv.h   |  45 ++++++++
 drivers/infiniband/core/device.c      |   8 ++
 drivers/infiniband/core/uverbs_cmd.c  | 209 +++++++++++++++++++++++++++++++---
 drivers/infiniband/core/uverbs_main.c |  28 +++++
 include/rdma/ib_verbs.h               |  27 ++++-
 7 files changed, 439 insertions(+), 16 deletions(-)
 create mode 100644 drivers/infiniband/core/cgroup.c
drivers/infiniband/core/Makefile +1 -0
index d43a899..df40cee 100644
@@ -13,6 +13,7 @@ ib_core-y :=			packer.o ud_header.o verbs.o sysfs.o \
 				roce_gid_mgmt.o
 ib_core-$(CONFIG_INFINIBAND_USER_MEM) += umem.o
 ib_core-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o umem_rbtree.o
+ib_core-$(CONFIG_CGROUP_RDMA) += cgroup.o
 
 ib_mad-y :=			mad.o smi.o agent.o mad_rmpp.o
 
drivers/infiniband/core/cgroup.c new file +137 -0

137 lines not on this page · raw message

drivers/infiniband/core/core_priv.h +45 -0

55 lines not on this page · raw message

drivers/infiniband/core/device.c +8 -0
index 179e813..59cab6b 100644
@@ -352,6 +352,10 @@ int ib_register_device(struct ib_device *device,
 		goto out;
 	}
 
+#ifdef CONFIG_CGROUP_RDMA
+	ib_device_register_rdmacg(device);
+#endif
+
 	ret = ib_device_register_sysfs(device, port_callback);
 	if (ret) {
 		printk(KERN_WARNING "Couldn't register device %s with driver model\n",
@@ -405,6 +409,10 @@ void ib_unregister_device(struct ib_device *device)
 
 	mutex_unlock(&device_mutex);
 
+#ifdef CONFIG_CGROUP_RDMA
+	ib_device_unregister_rdmacg(device);
+#endif
+
 	ib_device_unregister_sysfs(device);
 	ib_cache_cleanup_one(device);
 
drivers/infiniband/core/uverbs_cmd.c +194 -15

539 lines not on this page · raw message

drivers/infiniband/core/uverbs_main.c +28 -0
index e3ef288..1d8292c 100644
@@ -49,6 +49,7 @@
 #include <asm/uaccess.h>
 
 #include "uverbs.h"
+#include "core_priv.h"
 
 MODULE_AUTHOR("Roland Dreier");
 MODULE_DESCRIPTION("InfiniBand userspace verbs access");
@@ -214,6 +215,9 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
 	list_for_each_entry_safe(uobj, tmp, &context->ah_list, list) {
 		struct ib_ah *ah = uobj->object;
 
+		ib_rdmacg_uncharge(&uobj->cg_obj, ah->pd->device,
+				   RDMACG_RESOURCE_POOL_VERB,
+				   RDMA_VERB_RESOURCE_AH, 1);
 		idr_remove_uobj(&ib_uverbs_ah_idr, uobj);
 		ib_destroy_ah(ah);
 		kfree(uobj);
@@ -223,6 +227,9 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
 	list_for_each_entry_safe(uobj, tmp, &context->mw_list, list) {
 		struct ib_mw *mw = uobj->object;
 
+		ib_rdmacg_uncharge(&uobj->cg_obj, mw->pd->device,
+				   RDMACG_RESOURCE_POOL_VERB,
+				   RDMA_VERB_RESOURCE_MW, 1);
 		idr_remove_uobj(&ib_uverbs_mw_idr, uobj);
 		ib_dealloc_mw(mw);
 		kfree(uobj);
@@ -231,6 +238,9 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
 	list_for_each_entry_safe(uobj, tmp, &context->rule_list, list) {
 		struct ib_flow *flow_id = uobj->object;
 
+		ib_rdmacg_uncharge(&uobj->cg_obj, flow_id->qp->pd->device,
+				   RDMACG_RESOURCE_POOL_VERB,
+				   RDMA_VERB_RESOURCE_FLOW, 1);
 		idr_remove_uobj(&ib_uverbs_rule_idr, uobj);
 		ib_destroy_flow(flow_id);
 		kfree(uobj);
@@ -245,6 +255,9 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
 		if (qp != qp->real_qp) {
 			ib_close_qp(qp);
 		} else {
+			ib_rdmacg_uncharge(&uobj->cg_obj, qp->pd->device,
+					   RDMACG_RESOURCE_POOL_VERB,
+					   RDMA_VERB_RESOURCE_QP, 1);
 			ib_uverbs_detach_umcast(qp, uqp);
 			ib_destroy_qp(qp);
 		}
@@ -257,6 +270,9 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
 		struct ib_uevent_object *uevent =
 			container_of(uobj, struct ib_uevent_object, uobject);
 
+		ib_rdmacg_uncharge(&uobj->cg_obj, srq->pd->device,
+				   RDMACG_RESOURCE_POOL_VERB,
+				   RDMA_VERB_RESOURCE_SRQ, 1);
 		idr_remove_uobj(&ib_uverbs_srq_idr, uobj);
 		ib_destroy_srq(srq);
 		ib_uverbs_release_uevent(file, uevent);
@@ -269,6 +285,9 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
 		struct ib_ucq_object *ucq =
 			container_of(uobj, struct ib_ucq_object, uobject);
 
+		ib_rdmacg_uncharge(&uobj->cg_obj, cq->device,
+				   RDMACG_RESOURCE_POOL_VERB,
+				   RDMA_VERB_RESOURCE_CQ, 1);
 		idr_remove_uobj(&ib_uverbs_cq_idr, uobj);
 		ib_destroy_cq(cq);
 		ib_uverbs_release_ucq(file, ev_file, ucq);
@@ -278,6 +297,9 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
 	list_for_each_entry_safe(uobj, tmp, &context->mr_list, list) {
 		struct ib_mr *mr = uobj->object;
 
+		ib_rdmacg_uncharge(&uobj->cg_obj, mr->pd->device,
+				   RDMACG_RESOURCE_POOL_VERB,
+				   RDMA_VERB_RESOURCE_MR, 1);
 		idr_remove_uobj(&ib_uverbs_mr_idr, uobj);
 		ib_dereg_mr(mr);
 		kfree(uobj);
@@ -298,11 +320,17 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
 	list_for_each_entry_safe(uobj, tmp, &context->pd_list, list) {
 		struct ib_pd *pd = uobj->object;
 
+		ib_rdmacg_uncharge(&uobj->cg_obj, pd->device,
+				   RDMACG_RESOURCE_POOL_VERB,
+				   RDMA_VERB_RESOURCE_PD, 1);
 		idr_remove_uobj(&ib_uverbs_pd_idr, uobj);
 		ib_dealloc_pd(pd);
 		kfree(uobj);
 	}
 
+	ib_rdmacg_uncharge(&context->cg_obj, context->device,
+			   RDMACG_RESOURCE_POOL_VERB,
+			   RDMA_VERB_RESOURCE_UCTX, 1);
 	put_pid(context->tgid);
 
 	return context->device->dealloc_ucontext(context);
include/rdma/ib_verbs.h +26 -1
index 9a68a19..e109752 100644
@@ -55,6 +55,8 @@
 #include <linux/mmu_notifier.h>
 #include <asm/uaccess.h>
 
+#include <linux/cgroup_rdma.h>
+
 extern struct workqueue_struct *ib_wq;
 
 union ib_gid {
@@ -95,6 +97,19 @@ enum rdma_protocol_type {
 	RDMA_PROTOCOL_USNIC_UDP
 };
 
+enum rdma_resource_type {
+	RDMA_VERB_RESOURCE_UCTX,
+	RDMA_VERB_RESOURCE_AH,
+	RDMA_VERB_RESOURCE_PD,
+	RDMA_VERB_RESOURCE_CQ,
+	RDMA_VERB_RESOURCE_MR,
+	RDMA_VERB_RESOURCE_MW,
+	RDMA_VERB_RESOURCE_SRQ,
+	RDMA_VERB_RESOURCE_QP,
+	RDMA_VERB_RESOURCE_FLOW,
+	RDMA_VERB_RESOURCE_MAX,
+};
+
 __attribute_const__ enum rdma_transport_type
 rdma_node_get_transport(enum rdma_node_type node_type);
 
@@ -1231,6 +1246,12 @@ struct ib_fmr_attr {
 
 struct ib_umem;
 
+struct ib_rdmacg_object {
+#ifdef CONFIG_CGROUP_RDMA
+	struct rdma_cgroup	*cg;		/* owner rdma cgroup */
+#endif
+};
+
 struct ib_ucontext {
 	struct ib_device       *device;
 	struct list_head	pd_list;
@@ -1261,12 +1282,14 @@ struct ib_ucontext {
 	struct list_head	no_private_counters;
 	int                     odp_mrs_count;
 #endif
+	struct ib_rdmacg_object cg_obj;
 };
 
 struct ib_uobject {
 	u64			user_handle;	/* handle given to us by userspace */
 	struct ib_ucontext     *context;	/* associated user context */
 	void		       *object;		/* containing object */
+	struct ib_rdmacg_object cg_obj;
 	struct list_head	list;		/* link to context's list */
 	int			id;		/* index into kernel idr */
 	struct kref		ref;
@@ -1822,7 +1845,9 @@ struct ib_device {
 	u16                          is_switch:1;
 	u8                           node_type;
 	u8                           phys_port_cnt;
-
+#ifdef CONFIG_CGROUP_RDMA
+	struct rdmacg_device	     cg_device;
+#endif
 	/**
 	 * The following mandatory functions are used only at device
 	 * registration.  Keep functions such as these at the end of this
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH v4 3/3 rdmacg: Added documentation for rdma controller

In reply to Parav Pandit

Added documentation for rdma controller to use in v1 mode and using new unified hirerchy mode v2.

---
 Documentation/cgroup-v1/rdma.txt | 117 +++++++++++++++++++++++++++++++++++++++
 Documentation/cgroup-v2.txt      |  43 ++++++++++++++
 2 files changed, 160 insertions(+)
 create mode 100644 Documentation/cgroup-v1/rdma.txt
Documentation/cgroup-v1/rdma.txt new file +117 -0
new file mode 100644
index 0000000..688f04b
@@ -0,0 +1,117 @@
+				RDMA Controller
+				----------------
+
+Contents
+--------
+
+1. Overview
+  1-1. What is RDMA controller?
+  1-2. Why RDMA controller needed?
+  1-3. How is RDMA controller implemented?
+2. Usage Examples
+
+1. Overview
+
+1-1. What is RDMA controller?
+-----------------------------
+
+RDMA controller allows user to limit RDMA/IB specific resources
+that a given set of processes can use. These processes are grouped using
+RDMA controller.
+
+RDMA controller currently allows two different type of resource pools.
+(a) RDMA IB specification level verb resources defined by IB stack
+(b) HCA vendor device specific resources
+
+1-2. Why RDMA controller needed?
+--------------------------------
+
+Currently user space applications can easily take away all the rdma device
+specific resources such as AH, CQ, QP, MR etc. Due to which other applications
+in other cgroup or kernel space ULPs may not even get chance to allocate any
+rdma resources. This leads to service unavailability.
+
+Therefore RDMA controller is needed through which resource consumption
+of processes can be limited. Through this controller various different rdma
+resources described by IB uverbs layer and any HCA vendor driver can be
+accounted.
+
+1-3. How is RDMA controller implemented?
+----------------------------------------
+
+RDMA cgroup allows limit configuration of resources. These resources are not
+defined by the rdma controller. Instead they are defined by the IB stack
+and HCA device drivers(optionally).
+This provides great flexibility to allow IB stack to define new resources,
+without any changes to rdma cgroup.
+Rdma cgroup maintains resource accounting per cgroup, per device, per resource
+type using resource pool structure. Each such resource pool is limited up to
+64 resources in given resource pool by rdma cgroup, which can be extended
+later if required.
+
+This resource pool object is linked to the cgroup css. Typically there
+are 0 to 4 resource pool instances per cgroup, per device in most use cases.
+But nothing limits to have it more. At present hundreds of RDMA devices per
+single cgroup may not be handled optimally, however there is no known use case
+for such configuration either.
+
+Since RDMA resources can be allocated from any process and can be freed by any
+of the child processes which shares the address space, rdma resources are
+always owned by the creator cgroup css. This allows process migration from one
+to other cgroup without major complexity of transferring resource ownership;
+because such ownership is not really present due to shared nature of
+rdma resources. Linking resources around css also ensures that cgroups can be
+deleted after processes migrated. This allow progress migration as well with
+active resources, even though that’s not the primary use case.
+
+Whenever RDMA resource charing occurs, owner rdma cgroup is returned to
+the caller. Same rdma cgroup should be passed while uncharging the resource.
+This also allows process migrated with active RDMA resource to charge
+to new owner cgroup for new resource. It also allows to uncharge resource of
+a process from previously charged cgroup which is migrated to new cgroup,
+even though that is not a primary use case.
+
+Resource pool object is created in following situations.
+(a) User sets the limit and no previous resource pool exist for the device
+of interest for the cgroup.
+(b) No resource limits were configured, but IB/RDMA stack tries to
+charge the resource. So that it correctly uncharge them when applications are
+running without limits and later on when limits are enforced during uncharging,
+otherwise usage count will drop to negative. This is done using default
+resource pool. Instead of implementing any sort of time markers, default pool
+simplifies the design.
+
+Resource pool is destroyed if it was of default type (not created
+by administrative operation) and it’s the last resource getting
+deallocated. Resource pool created as administrative operation is not
+deleted, as it’s expected to be used in near future.
+
+If user setting tries to delete all the resource limit
+with active resources per device, RDMA cgroup just marks the pool as
+default pool with maximum limits for each resource, otherwise it deletes the
+default resource pool.
+
+2. Usage Examples
+-----------------
+
+(a) Configure resource limit:
+echo mlx4_0 mr=100 qp=10 ah=2 > /sys/fs/cgroup/rdma/1/rdma.verb.max
+echo ocrdma1 mr=120 qp=20 cq=10 > /sys/fs/cgroup/rdma/2/rdma.verb.max
+
+(b) Query resource limit:
+cat /sys/fs/cgroup/rdma/2/rdma.verb.max
+#Output:
+mlx4_0 mr=100 qp=10 ah=2
+ocrdma1 mr=120 qp=20 cq=10
+
+(c) Query current usage:
+cat /sys/fs/cgroup/rdma/2/rdma.verb.current
+#Output:
+mlx4_0 mr=95 qp=8 ah=2
+ocrdma1 mr=0 qp=20 cq=10
+
+(d) Delete resource limit:
+echo mlx4_0 remove > /sys/fs/cgroup/rdma/1/rdma.verb.max
+
+(e) Configure hw specific resource limit: (optional)
+echo vendor1 hw_qp=56 > /sys/fs/cgroup/rdma/2/rdma.hw.max
Documentation/cgroup-v2.txt +43 -0

55 lines not on this page · raw message

Signature · 6 lines
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

Re: [PATCHv4 1/3] rdmacg: Added rdma cgroup controller.

In reply to Parav Pandit
reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree…

Hi Parav,

[auto build test ERROR on cgroup/for-next]
[also build test ERROR on v4.5-rc1 next-20160129]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Parav-Pandit/rdmacg-IB-core-rdma-controller-support/20160131-063313
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
config: xtensa-allmodconfig (attached as .config)

reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa

All errors (new ones prefixed by >>):

In file included from arch/xtensa/include/generated/asm/bug.h:1:0,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/gfp.h:4,
from include/linux/slab.h:14,
from kernel/cgroup_rdma.c:8:
kernel/cgroup_rdma.c: In function 'find_cg_rpool_locked':

>> include/linux/lockdep.h:340:51: error: invalid type argument of '->' (have 'spinlock_t')
    #define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map)
                                                      ^
   include/asm-generic/bug.h:86:25: note: in definition of macro 'WARN_ON'
     int __ret_warn_on = !!(condition);    \
                            ^
   include/linux/lockdep.h:366:27: note: in expansion of macro 'lockdep_is_held'
      WARN_ON(debug_locks && !lockdep_is_held(l)); \
                              ^
   kernel/cgroup_rdma.c:179:2: note: in expansion of macro 'lockdep_assert_held'
     lockdep_assert_held(cg->rpool_list_lock);
     ^

vim +340 include/linux/lockdep.h

7531e2f34 Peter Zijlstra 2008-08-11  334  			 int trylock, int read, int check,
7531e2f34 Peter Zijlstra 2008-08-11  335  			 struct lockdep_map *nest_lock, unsigned long ip);
fbb9ce953 Ingo Molnar    2006-07-03  336  
fbb9ce953 Ingo Molnar    2006-07-03  337  extern void lock_release(struct lockdep_map *lock, int nested,
fbb9ce953 Ingo Molnar    2006-07-03  338  			 unsigned long ip);
fbb9ce953 Ingo Molnar    2006-07-03  339  
f607c6685 Peter Zijlstra 2009-07-20 @340  #define lockdep_is_held(lock)	lock_is_held(&(lock)->dep_map)
f607c6685 Peter Zijlstra 2009-07-20  341  
f607c6685 Peter Zijlstra 2009-07-20  342  extern int lock_is_held(struct lockdep_map *lock);
f607c6685 Peter Zijlstra 2009-07-20  343  

:::::: The code at line 340 was first introduced by commit
:::::: f607c6685774811b8112e124f10a053d77015485 lockdep: Introduce lockdep_assert_held()

:::::: TO: Peter Zijlstra <[email protected]> :::::: CC: Ingo Molnar <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw

[PATCH] rdmacg: fix semicolon.cocci warnings

In reply to Parav Pandit
kernel/cgroup_rdma.c:787:2-3: Unneeded semicolon kernel/cgroup_rdma.c:611:2-3: Unneeded semicolon

kernel/cgroup_rdma.c:787:2-3: Unneeded semicolon
kernel/cgroup_rdma.c:611:2-3: Unneeded semicolon

Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

---

 cgroup_rdma.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/cgroup_rdma.c +2 -2
@@ -608,7 +608,7 @@ static enum rdmacg_resource_pool_type of
 	default:
 		pool_type = RDMACG_RESOURCE_POOL_HW;
 		break;
-	};
+	}
 	return pool_type;
 }
 
@@ -784,7 +784,7 @@ static int get_resource_val(struct rdmac
 	default:
 		val = 0;
 		break;
-	};
+	}
 	return val;
 }
 
#4 lore raw

Re: [PATCHv4 1/3] rdmacg: Added rdma cgroup controller.

In reply to Parav Pandit
reproduce:

Hi Parav,

[auto build test ERROR on cgroup/for-next]
[also build test ERROR on v4.5-rc1 next-20160129]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Parav-Pandit/rdmacg-IB-core-rdma-controller-support/20160131-063313
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
config: i386-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

In file included from arch/x86/include/asm/bug.h:35:0,
from include/linux/bug.h:4, from include/linux/mmdebug.h:4, from include/linux/gfp.h:4, from include/linux/slab.h:14, from kernel/cgroup_rdma.c:8:
kernel/cgroup_rdma.c: In function 'find_cg_rpool_locked':

>> include/linux/lockdep.h:340:51: error: invalid type argument of '->' (have 'spinlock_t {aka struct spinlock}')
    #define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map)
                                                      ^
   include/asm-generic/bug.h:86:25: note: in definition of macro 'WARN_ON'
     int __ret_warn_on = !!(condition);    \
                            ^
>> include/linux/lockdep.h:366:27: note: in expansion of macro 'lockdep_is_held'
      WARN_ON(debug_locks && !lockdep_is_held(l)); \
                              ^
>> kernel/cgroup_rdma.c:179:2: note: in expansion of macro 'lockdep_assert_held'
     lockdep_assert_held(cg->rpool_list_lock);
     ^

coccinelle warnings: (new ones prefixed by >>)

>> kernel/cgroup_rdma.c:912:1-7: preceding lock on line 879
--
>> kernel/cgroup_rdma.c:787:2-3: Unneeded semicolon

kernel/cgroup_rdma.c:611:2-3: Unneeded semicolon

Please review and possibly fold the followup patch.

vim +340 include/linux/lockdep.h

7531e2f34 Peter Zijlstra  2008-08-11  334  			 int trylock, int read, int check,
7531e2f34 Peter Zijlstra  2008-08-11  335  			 struct lockdep_map *nest_lock, unsigned long ip);
fbb9ce953 Ingo Molnar     2006-07-03  336  
fbb9ce953 Ingo Molnar     2006-07-03  337  extern void lock_release(struct lockdep_map *lock, int nested,
fbb9ce953 Ingo Molnar     2006-07-03  338  			 unsigned long ip);
fbb9ce953 Ingo Molnar     2006-07-03  339  
f607c6685 Peter Zijlstra  2009-07-20 @340  #define lockdep_is_held(lock)	lock_is_held(&(lock)->dep_map)
f607c6685 Peter Zijlstra  2009-07-20  341  
f607c6685 Peter Zijlstra  2009-07-20  342  extern int lock_is_held(struct lockdep_map *lock);
f607c6685 Peter Zijlstra  2009-07-20  343  
00ef9f734 Peter Zijlstra  2008-12-04  344  extern void lock_set_class(struct lockdep_map *lock, const char *name,
00ef9f734 Peter Zijlstra  2008-12-04  345  			   struct lock_class_key *key, unsigned int subclass,
64aa348ed Peter Zijlstra  2008-08-11  346  			   unsigned long ip);
64aa348ed Peter Zijlstra  2008-08-11  347  
00ef9f734 Peter Zijlstra  2008-12-04  348  static inline void lock_set_subclass(struct lockdep_map *lock,
00ef9f734 Peter Zijlstra  2008-12-04  349  		unsigned int subclass, unsigned long ip)
00ef9f734 Peter Zijlstra  2008-12-04  350  {
00ef9f734 Peter Zijlstra  2008-12-04  351  	lock_set_class(lock, lock->name, lock->key, subclass, ip);
00ef9f734 Peter Zijlstra  2008-12-04  352  }
00ef9f734 Peter Zijlstra  2008-12-04  353  
cf40bd16f Nick Piggin     2009-01-21  354  extern void lockdep_set_current_reclaim_state(gfp_t gfp_mask);
cf40bd16f Nick Piggin     2009-01-21  355  extern void lockdep_clear_current_reclaim_state(void);
cf40bd16f Nick Piggin     2009-01-21  356  extern void lockdep_trace_alloc(gfp_t mask);
cf40bd16f Nick Piggin     2009-01-21  357  
a24fc60d6 Peter Zijlstra  2015-06-11  358  extern void lock_pin_lock(struct lockdep_map *lock);
a24fc60d6 Peter Zijlstra  2015-06-11  359  extern void lock_unpin_lock(struct lockdep_map *lock);
a24fc60d6 Peter Zijlstra  2015-06-11  360  
cf40bd16f Nick Piggin     2009-01-21  361  # define INIT_LOCKDEP				.lockdep_recursion = 0, .lockdep_reclaim_gfp = 0,
fbb9ce953 Ingo Molnar     2006-07-03  362  
e3a55fd18 Jarek Poplawski 2007-03-22  363  #define lockdep_depth(tsk)	(debug_locks ? (tsk)->lockdep_depth : 0)
d5abe6691 Peter Zijlstra  2006-12-06  364  
b1ae345d9 Johannes Berg   2013-02-21  365  #define lockdep_assert_held(l)	do {				\
b1ae345d9 Johannes Berg   2013-02-21 @366  		WARN_ON(debug_locks && !lockdep_is_held(l));	\
b1ae345d9 Johannes Berg   2013-02-21  367  	} while (0)
f607c6685 Peter Zijlstra  2009-07-20  368  
9a37110d2 Peter Hurley    2014-09-10  369  #define lockdep_assert_held_once(l)	do {				\

:::::: The code at line 340 was first introduced by commit
:::::: f607c6685774811b8112e124f10a053d77015485 lockdep: Introduce lockdep_assert_held()

:::::: TO: Peter Zijlstra <[email protected]> :::::: CC: Ingo Molnar <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#7 lore raw

Re: [PATCHv4 2/3] IB/core: added support to use rdma cgroup controller

In reply to Parav Pandit
reproduce:

Hi Parav,

[auto build test ERROR on cgroup/for-next]
[cannot apply to v4.5-rc1 next-20160129]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Parav-Pandit/rdmacg-IB-core-rdma-controller-support/20160131-063313
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
config: i386-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

In file included from include/linux/cgroup_rdma.h:5:0,
from include/rdma/ib_verbs.h:58, from include/rdma/ib_cache.h:38, from drivers/infiniband/ulp/srp/ib_srp.c:43:

>> include/linux/parser.h:12:8: error: redefinition of 'struct match_token'
    struct match_token {
           ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:12:8: note: originally defined here
    struct match_token {
           ^
   In file included from include/linux/cgroup_rdma.h:5:0,
                    from include/rdma/ib_verbs.h:58,
                    from include/rdma/ib_cache.h:38,
                    from drivers/infiniband/ulp/srp/ib_srp.c:43:
>> include/linux/parser.h:17:28: error: conflicting types for 'match_table_t'
    typedef struct match_token match_table_t[];
                               ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:17:28: note: previous declaration of 'match_table_t' was here
    typedef struct match_token match_table_t[];
                               ^
   In file included from include/linux/cgroup_rdma.h:5:0,
                    from include/rdma/ib_verbs.h:58,
                    from include/rdma/ib_cache.h:38,
                    from drivers/infiniband/ulp/srp/ib_srp.c:43:
>> include/linux/parser.h:20:7: error: redeclaration of enumerator 'MAX_OPT_ARGS'
    enum {MAX_OPT_ARGS = 3};
          ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:20:7: note: previous definition of 'MAX_OPT_ARGS' was here
    enum {MAX_OPT_ARGS = 3};
          ^
   In file included from include/linux/cgroup_rdma.h:5:0,
                    from include/rdma/ib_verbs.h:58,
                    from include/rdma/ib_cache.h:38,
                    from drivers/infiniband/ulp/srp/ib_srp.c:43:
>> include/linux/parser.h:26:3: error: conflicting types for 'substring_t'
    } substring_t;
      ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:26:3: note: previous declaration of 'substring_t' was here
    } substring_t;
      ^
   In file included from include/linux/cgroup_rdma.h:5:0,
                    from include/rdma/ib_verbs.h:58,
                    from include/rdma/ib_cache.h:38,
                    from drivers/infiniband/ulp/srp/ib_srp.c:43:
>> include/linux/parser.h:28:5: error: conflicting types for 'match_token'
    int match_token(char *, const match_table_t table, substring_t args[]);
        ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:28:5: note: previous declaration of 'match_token' was here
    int match_token(char *, const match_table_t table, substring_t args[]);
        ^
   In file included from include/linux/cgroup_rdma.h:5:0,
                    from include/rdma/ib_verbs.h:58,
                    from include/rdma/ib_cache.h:38,
                    from drivers/infiniband/ulp/srp/ib_srp.c:43:
>> include/linux/parser.h:29:5: error: conflicting types for 'match_int'
    int match_int(substring_t *, int *result);
        ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:29:5: note: previous declaration of 'match_int' was here
    int match_int(substring_t *, int *result);
        ^
   In file included from include/linux/cgroup_rdma.h:5:0,
                    from include/rdma/ib_verbs.h:58,
                    from include/rdma/ib_cache.h:38,
                    from drivers/infiniband/ulp/srp/ib_srp.c:43:
>> include/linux/parser.h:30:5: error: conflicting types for 'match_octal'
    int match_octal(substring_t *, int *result);
        ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:30:5: note: previous declaration of 'match_octal' was here
    int match_octal(substring_t *, int *result);
        ^
   In file included from include/linux/cgroup_rdma.h:5:0,
                    from include/rdma/ib_verbs.h:58,
                    from include/rdma/ib_cache.h:38,
                    from drivers/infiniband/ulp/srp/ib_srp.c:43:
>> include/linux/parser.h:31:5: error: conflicting types for 'match_hex'
    int match_hex(substring_t *, int *result);
        ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:31:5: note: previous declaration of 'match_hex' was here
    int match_hex(substring_t *, int *result);
        ^
   In file included from include/linux/cgroup_rdma.h:5:0,
                    from include/rdma/ib_verbs.h:58,
                    from include/rdma/ib_cache.h:38,
                    from drivers/infiniband/ulp/srp/ib_srp.c:43:
>> include/linux/parser.h:33:8: error: conflicting types for 'match_strlcpy'
    size_t match_strlcpy(char *, const substring_t *, size_t);
           ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:33:8: note: previous declaration of 'match_strlcpy' was here
    size_t match_strlcpy(char *, const substring_t *, size_t);
           ^
   In file included from include/linux/cgroup_rdma.h:5:0,
                    from include/rdma/ib_verbs.h:58,
                    from include/rdma/ib_cache.h:38,
                    from drivers/infiniband/ulp/srp/ib_srp.c:43:
>> include/linux/parser.h:34:7: error: conflicting types for 'match_strdup'
    char *match_strdup(const substring_t *);
          ^
   In file included from drivers/infiniband/ulp/srp/ib_srp.c:40:0:
   include/linux/parser.h:34:7: note: previous declaration of 'match_strdup' was here
    char *match_strdup(const substring_t *);
          ^

vim +12 include/linux/parser.h

^1da177e Linus Torvalds    2005-04-16   6   * but could potentially be used anywhere else that simple option=arg
^1da177e Linus Torvalds    2005-04-16   7   * parsing is required.
^1da177e Linus Torvalds    2005-04-16   8   */
^1da177e Linus Torvalds    2005-04-16   9  
^1da177e Linus Torvalds    2005-04-16  10  
^1da177e Linus Torvalds    2005-04-16  11  /* associates an integer enumerator with a pattern string. */
^1da177e Linus Torvalds    2005-04-16 @12  struct match_token {
^1da177e Linus Torvalds    2005-04-16  13  	int token;
ef4533f8 David Howells     2007-05-03  14  	const char *pattern;
^1da177e Linus Torvalds    2005-04-16  15  };
^1da177e Linus Torvalds    2005-04-16  16  
1a3f7d98 Linus Torvalds    2008-08-04 @17  typedef struct match_token match_table_t[];
^1da177e Linus Torvalds    2005-04-16  18  
^1da177e Linus Torvalds    2005-04-16  19  /* Maximum number of arguments that match_token will find in a pattern */
^1da177e Linus Torvalds    2005-04-16 @20  enum {MAX_OPT_ARGS = 3};
^1da177e Linus Torvalds    2005-04-16  21  
^1da177e Linus Torvalds    2005-04-16  22  /* Describe the location within a string of a substring */
^1da177e Linus Torvalds    2005-04-16  23  typedef struct {
^1da177e Linus Torvalds    2005-04-16  24  	char *from;
^1da177e Linus Torvalds    2005-04-16  25  	char *to;
^1da177e Linus Torvalds    2005-04-16 @26  } substring_t;
^1da177e Linus Torvalds    2005-04-16  27  
a447c093 Steven Whitehouse 2008-10-13 @28  int match_token(char *, const match_table_t table, substring_t args[]);
^1da177e Linus Torvalds    2005-04-16 @29  int match_int(substring_t *, int *result);
^1da177e Linus Torvalds    2005-04-16 @30  int match_octal(substring_t *, int *result);
^1da177e Linus Torvalds    2005-04-16 @31  int match_hex(substring_t *, int *result);
aace0509 Du, Changbin      2014-01-23  32  bool match_wildcard(const char *pattern, const char *str);
b32a09db Markus Armbruster 2008-02-26 @33  size_t match_strlcpy(char *, const substring_t *, size_t);
ef4533f8 David Howells     2007-05-03 @34  char *match_strdup(const substring_t *);

:::::: The code at line 12 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <[email protected]> :::::: CC: Linus Torvalds <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#5 lore raw

Re: [PATCHv4 1/3] rdmacg: Added rdma cgroup controller.

In reply to Parav Pandit
reproduce:

Hi Parav,

[auto build test ERROR on cgroup/for-next]
[also build test ERROR on v4.5-rc1 next-20160129]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Parav-Pandit/rdmacg-IB-core-rdma-controller-support/20160131-063313
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
config: i386-allyesconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

kernel/cgroup_rdma.c: In function 'find_cg_rpool_locked':

>> kernel/cgroup_rdma.c:179:84: error: invalid type argument of '->' (have 'spinlock_t {aka struct spinlock}')

vim +179 kernel/cgroup_rdma.c

173 struct rdmacg_device *device,
174 enum rdmacg_resource_pool_type type)
175
176 {
177 struct cg_resource_pool *pool;
178

 > 179		lockdep_assert_held(cg->rpool_list_lock);

180
181 list_for_each_entry(pool, &cg->rpool_head, cg_list)
182 if (pool->device == device && pool->type == type)

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation