From patchwork Mon Nov 19 10:34:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 151471 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2489922ljp; Mon, 19 Nov 2018 02:34:52 -0800 (PST) X-Google-Smtp-Source: AJdET5eHPYn8NCkirLG5K1ikxoVS+WL0P8VatIUHaTowdmFtITm3qftizzWbxP6zJldcAHNOfgc6 X-Received: by 2002:a63:a91a:: with SMTP id u26mr19308579pge.349.1542623692215; Mon, 19 Nov 2018 02:34:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542623692; cv=none; d=google.com; s=arc-20160816; b=TpPvJHtF8C/e5u5KAaz9VWpqP7u890XPuWceXPvaYenKvBL7yABNcHUxIUOSupLcRE LtglOFWAokf6ph8oEq4uv0wr7cfCz0lSfVhHfIVuz/whspBTvEeQlfIcAN7IAF8AHqrE J04O3TfTEb1blA/YmgaZ/kyaTIRWAFngM3Nldx+2ibLxi6uOh5+FimbayFgpaTZO4IvY gKZcpBDSBztGuaSg73jkKLCJj9keXKYO7OzQTIClkI+0vTafp+AG+6OqdsnWaCzZNByO DOxJA+8l7k/uHeKRNYnsFCm1baeyKftJYpRg5w/rg03GIBzUYkPLHKOYhgaUi1EKNfSY I3Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ixCco3tkgOz6XOnATIyg3v7JG+fMVyFH/i6hN9+7LbE=; b=QOHWS3SlHULtnUxjA3Ji+6Cn3sXECMLC5cAZ9qAVT5u5LluobowFe7OmYIFO4XbpcV Fv7kaB+uHy0NypTumP4s+K9zEW563j6Y2KO0xn4Cwu+5ZkP56Wbemo5LzzxiazwRVJJU JOl5HzZbPBxn4RbUiqFpbJgPF1VCKz6lDRCOAshG5/K/v6WMNs7rUjezEqFVvyYxxtb7 keZ4AiASVUC/7Xmh/6nwLxdCOqOX45eRJqJ3Zl16e879w1nvqZ8SrKLoDtmuYu3tAf7E WnqyVF1tEXhlIdx5CjjW8F4lUtUuC1+VNu2/NzuP0/Zv2h1WNraEHYx3Eo8ovaubOP1I 3c3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kKp2I6yh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5-v6si36714014pgv.38.2018.11.19.02.34.51; Mon, 19 Nov 2018 02:34:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kKp2I6yh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728236AbeKSU6C (ORCPT + 32 others); Mon, 19 Nov 2018 15:58:02 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39794 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728160AbeKSU6A (ORCPT ); Mon, 19 Nov 2018 15:58:00 -0500 Received: by mail-wm1-f65.google.com with SMTP id u13-v6so4681396wmc.4 for ; Mon, 19 Nov 2018 02:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ixCco3tkgOz6XOnATIyg3v7JG+fMVyFH/i6hN9+7LbE=; b=kKp2I6yh/orVyEouSJpVWokRdAT9xO+g+kCnqgaaTzcRgXwvj2mzpvsQeI/fL870j/ FWJpkmfYHVEX994JHS9HKt3nipa3xeLHvXCMO6b7u5kQXIhAGjuRJ+Y8HyG2lb5f+Ag9 5/O6i7rXVsv45I3wffJr69woHSqCdtIyD3Cxw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ixCco3tkgOz6XOnATIyg3v7JG+fMVyFH/i6hN9+7LbE=; b=Ljc7uZ5++6EFMOEUEnpIw+tx4A4HaE0d6hCm3FE89Ypqy/UilyoaHkHnXeQelekCJK jnarDJi/pTpGTe9e4Fuc97hBFKsQgrwcPbSISf7hOFDF0P/GuMpo1OCY76/yVyLWuX61 aB1EQrudsWi0EsjXVHGBGMO/XgvTFbJ69pF9qo/Qxb9XOFI7aB0CgWlDhQGYolCJB8ix TSFL5Sa69oITq8p9MaZMvY1SLkyKW4astoA9H4BEZzi4PbXrU15dPC+O7c87qXPCAWI2 FkUY8//BFnHMbyS5kSYi3h0dXD1RkqkO3Giwcg0zYnYeH2BIxYdkMIYtSvY+GEJOi98O yBkQ== X-Gm-Message-State: AA+aEWZ7gGrI1rxysm5JCeLCUZw9qZEdqRs8WZvBOvvOsqBZKB9LJdho UrF1fniN9ejoQJhgmlkAfyPagQ== X-Received: by 2002:a1c:2b45:: with SMTP id r66-v6mr6662149wmr.128.1542623686156; Mon, 19 Nov 2018 02:34:46 -0800 (PST) Received: from localhost.localdomain ([37.162.18.180]) by smtp.gmail.com with ESMTPSA id e9sm14973298wro.16.2018.11.19.02.34.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 02:34:45 -0800 (PST) From: Paolo Valente To: Jens Axboe , Greg Kroah-Hartman , Tejun Heo , Li Zefan , Angelo Ruocco , Dennis Zhou , Josef Bacik , Liu Bo , Bart Van Assche , Johannes Weiner Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, Jonathan Corbet , Paolo Valente Subject: [PATCH V2 04/10] cgroup: add owner name to cftypes Date: Mon, 19 Nov 2018 11:34:18 +0100 Message-Id: <20181119103424.3853-5-paolo.valente@linaro.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181119103424.3853-1-paolo.valente@linaro.org> References: <20181119103424.3853-1-paolo.valente@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Angelo Ruocco The piece of information "who created a certain cftype" is not stored anywhere, thus a cftype is not able to know who is its owner. This commit addresses this problem by adding a new field in the cftype structure that enables the name of its owner to be explicitly set. Signed-off-by: Angelo Ruocco Signed-off-by: Paolo Valente --- include/linux/cgroup-defs.h | 2 ++ include/linux/cgroup.h | 13 +++++++++++++ 2 files changed, 15 insertions(+) -- 2.16.1 diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index d659763c7221..6e31f478c6e1 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -36,6 +36,7 @@ struct seq_file; #define MAX_CGROUP_TYPE_NAMELEN 32 #define MAX_CGROUP_ROOT_NAMELEN 64 #define MAX_CFTYPE_NAME 64 +#define MAX_OWNER_NAME 64 /* define the enumeration of all cgroup subsystems */ #define SUBSYS(_x) _x ## _cgrp_id, @@ -505,6 +506,7 @@ struct cftype { * end of cftype array. */ char name[MAX_CFTYPE_NAME]; + char owner_name[MAX_OWNER_NAME]; unsigned long private; /* diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 9d12757a65b0..267153bd898a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -291,6 +291,19 @@ void css_task_iter_end(struct css_task_iter *it); ; \ else +/** + * list_for_each_cft - walk circular list of cftypes linked together + * @cft: cftype from where to start + * @n: cftype used as a temporary storage + * + * A cftype pointed by a file may be part of a circular list of cftypes, this + * macro walks the circular list starting from any given cftype. Unlike the + * "list_for_each_entry" macro, the first element is included in the iteration. + */ +#define list_for_each_cft(cft, n) \ + for (n = NULL; cft != n; n = (n == NULL) ? cft : n, \ + cft = list_next_entry(cft, share_node)) + /* * Inline functions. */