From patchwork Mon Nov 12 09:56:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 150811 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2948387ljp; Mon, 12 Nov 2018 01:58:11 -0800 (PST) X-Google-Smtp-Source: AJdET5fOLS30G/QiA6F0L6jGzJ4o3E70dzSmih4R/kEV4P1BlPwxKtlVGcko3M2JBt8L4Ey6aC++ X-Received: by 2002:a17:902:9009:: with SMTP id a9-v6mr307810plp.134.1542016691532; Mon, 12 Nov 2018 01:58:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542016691; cv=none; d=google.com; s=arc-20160816; b=HTA28hER/1n1BsuoNc9dFU1lVXx96chhXfoeRun9aeYOJnAosKkocfEhBHohSqOqmq ZGquSJymjOjF9K4l48Uo/GuWTobWNnWe3RQN2S2IcaAsam2PTQZ2te3SvudXRZ+QQiES s8yuFiA9h/WM4BlOlMy9vis+vpqxjuDYetREtD3bOvuwowNDbakUbKhiqxCoOGGkUPQT Elau7WQGKWpzISjMZSDJtoBavOCfL7xlynaG/VEVAGQy6yjVQrcwzGX1u0AvzNsBMZYA IIFEong+EyGVNaoArQypQHsZqSaGJHc98gHLERSJd8rcWrh0Z7AiBDX0C5ijZrQyI7bQ 2kPg== 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=P7bU520jYWPTb3cyPzcSyUy1YpHK+qexJMs0P6lqanE=; b=aIsjA2YPv8rfIMvwnGvtetRdXEuq7G12l5sU4hcqeemO2Ad9IOExJtvg2PE3YutSlp JHKVSn+5Kti+a49607j5KLDmel1NvrwtlaRzwpM7KNt63hUn3HlzLHbJdlWsguCo7wQq +EUbkjV0hdBcYXqxSCuh+54wmhXTyyKS7VnqRDzWsy/L5bXkQ6dTuMqnvBksZv/FiacG nharuwzgF/z9U/Mv4z3CdSGTk5W2WYpkwoH6wQwQ24fSy2SGoFtcP+G+uiJmGbe+zce8 qX7a5+7J+5yWLGxGWvuK8SsmwJIuLIsSXsLMCrn2DyfS6pwLuV2m3bYFWiwVN0VQF7Cw jZSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JtQQC93a; 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 d18si16004323pgm.212.2018.11.12.01.58.11; Mon, 12 Nov 2018 01:58:11 -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=JtQQC93a; 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 S1729199AbeKLTtq (ORCPT + 32 others); Mon, 12 Nov 2018 14:49:46 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54599 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729138AbeKLTtp (ORCPT ); Mon, 12 Nov 2018 14:49:45 -0500 Received: by mail-wm1-f65.google.com with SMTP id r63-v6so7828627wma.4 for ; Mon, 12 Nov 2018 01:57:16 -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=P7bU520jYWPTb3cyPzcSyUy1YpHK+qexJMs0P6lqanE=; b=JtQQC93arLRCUkYIzxYNMaBRBMon6J3hW9n1Xxh71Mx0tPT2003ZczFsHzJ42mmoOX CFbUgZR3B0Jz5VRmHN1WePt8B0KRBQkeu6YZZjQxZMnpbSTRsYSnZaaMTfMQXbgZ9JGD le/9K33CGl4PFQx+RuuGtMEVzyJUE113m9ick= 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=P7bU520jYWPTb3cyPzcSyUy1YpHK+qexJMs0P6lqanE=; b=MGk8VnXDlZQZc/s3Dq2xSWhja9/Vtpjk+I9JlIb3wV2SR+1mYRrJ2LejGw1myul6Dp vI4W3dPhh/NEGy+np8GDtjCUCTg4O5CzhPNookNKKAcjj2Kmt/kQQu/NQJMXlVXnUFc5 SyygasGslkYIIn+rxSitk0jf33fhJ8GwmExQ/u5EcLPNzpH1AlE67J5EAmwDtVAquusl 2cpgB3My58ccNiIAs4mVzGKYqqdIi/uq5LYzjBrWvaWjM1gWA58cxCMsdeP6YTP6EQ0k DzMbXJ+MCkbD11+AgMB8C1U7q6PdCZfec20JNjIOokAkS6JNXOjcjPdC1GPFOA2eUTcL 3OeQ== X-Gm-Message-State: AGRZ1gL+VLD9MD4MFUeJeV98TlOinPJJfMeMQam3eaoWXj3XKhYyJLEP Q5G1wy9dXRziiy893478LZInxg== X-Received: by 2002:a1c:b5ce:: with SMTP id e197-v6mr6848082wmf.30.1542016635664; Mon, 12 Nov 2018 01:57:15 -0800 (PST) Received: from localhost.localdomain ([93.68.220.21]) by smtp.gmail.com with ESMTPSA id r14-v6sm21273089wro.8.2018.11.12.01.57.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Nov 2018 01:57:15 -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 05/12] cgroup: add owner name to cftypes Date: Mon, 12 Nov 2018 10:56:25 +0100 Message-Id: <20181112095632.69114-6-paolo.valente@linaro.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181112095632.69114-1-paolo.valente@linaro.org> References: <20181112095632.69114-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 9968332cceed..bf17a9843f45 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -293,6 +293,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. */