From patchwork Mon Sep 7 20:38:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parav Pandit X-Patchwork-Id: 7137841 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 75C4ABEEC1 for ; Mon, 7 Sep 2015 20:42:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80955208CB for ; Mon, 7 Sep 2015 20:42:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 94AC020704 for ; Mon, 7 Sep 2015 20:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752466AbbIGUkm (ORCPT ); Mon, 7 Sep 2015 16:40:42 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:33649 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752133AbbIGUkQ (ORCPT ); Mon, 7 Sep 2015 16:40:16 -0400 Received: by paddd1 with SMTP id dd1so11959033pad.0; Mon, 07 Sep 2015 13:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V/gYlXloAgEwWXX41gbdazyEu2OLL+zwXAd7vNgdyag=; b=sq6Aq9B2cD4ix+4kq9iUEp6ZHGdRBJtxhbDVZkvN2VI4h+amts8zTFiAD+s2zQaXjr jbBtNEfZpx0IBvue0MzcwMzxTyCCb/afPTumoQD9k1/Fl1RFxoaSLdgzFjSp6SxqQMbd uQCzJaB7eoocL8/pE8O0oG+6usVVzG2osHs0PG6xHTQFp3jr+2MO2v68KMu1374GVCRK i+HAWkgjy9tdV0pNokFj3PPFnhtYq8YkhQupbB0RRXwRNz/WJTjXuEBwJVkADaKiv+30 sB2uUQUCD44ca/9LNVaRy5Y8jm2uxG0MLY02/hHgAjSeZB/AK1gTVM0JVx4FWEe+fouJ xfJg== X-Received: by 10.66.194.138 with SMTP id hw10mr31206992pac.71.1441658416394; Mon, 07 Sep 2015 13:40:16 -0700 (PDT) Received: from server1.localdomain ([106.216.129.226]) by smtp.gmail.com with ESMTPSA id h15sm772673pdk.29.2015.09.07.13.40.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Sep 2015 13:40:15 -0700 (PDT) From: Parav Pandit To: 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 Cc: corbet@lwn.net, james.l.morris@oracle.com, serge@hallyn.com, haggaie@mellanox.com, ogerlitz@mellanox.com, matanb@mellanox.com, raindel@mellanox.com, akpm@linux-foundation.org, linux-security-module@vger.kernel.org, pandit.parav@gmail.com Subject: [PATCH 4/7] devcg: Added rdma resource tracker object per task Date: Tue, 8 Sep 2015 02:08:20 +0530 Message-Id: <1441658303-18081-5-git-send-email-pandit.parav@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1441658303-18081-1-git-send-email-pandit.parav@gmail.com> References: <1441658303-18081-1-git-send-email-pandit.parav@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Added RDMA device resource tracking object per task. Added comments to capture usage of task lock by device cgroup for rdma. Signed-off-by: Parav Pandit --- include/linux/sched.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index ae21f15..a5f79b6 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1334,6 +1334,8 @@ union rcu_special { }; struct rcu_node; +struct task_rdma_res_counter; + enum perf_event_task_context { perf_invalid_context = -1, perf_hw_context = 0, @@ -1637,6 +1639,14 @@ struct task_struct { struct css_set __rcu *cgroups; /* cg_list protected by css_set_lock and tsk->alloc_lock */ struct list_head cg_list; + +#ifdef CONFIG_CGROUP_RDMA_RESOURCE + /* RDMA resource accounting counters, allocated only + * when RDMA resources are created by a task. + */ + struct task_rdma_res_counter *rdma_res_counter; +#endif + #endif #ifdef CONFIG_FUTEX struct robust_list_head __user *robust_list; @@ -2676,7 +2686,7 @@ static inline int thread_group_empty(struct task_struct *p) * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring * subscriptions and synchronises with wait4(). Also used in procfs. Also * pins the final release of task.io_context. Also protects ->cpuset and - * ->cgroup.subsys[]. And ->vfork_done. + * ->cgroup.subsys[]. Also projtects ->vfork_done and ->rdma_res_counter. * * Nests both inside and outside of read_lock(&tasklist_lock). * It must not be nested with write_lock_irq(&tasklist_lock),