Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3880952imu; Mon, 12 Nov 2018 01:59:48 -0800 (PST) X-Google-Smtp-Source: AJdET5emOdn+czc/HDofOswoWMHNd+AzjmvjcuZgaTHeFLW17xLNBnboJDvEKJjOlpHC4NoiFfWh X-Received: by 2002:a63:31d0:: with SMTP id x199mr270856pgx.10.1542016788075; Mon, 12 Nov 2018 01:59:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542016788; cv=none; d=google.com; s=arc-20160816; b=kU+vPpq4LK2rwiZqPnjEAPdYgoW3OD3z7e9ayol4nJozcMvSFfnU8g5odZ/S/JLy4s lvQhqf+M/IAdJJ2D381TqpbopPsZ60V06mANwWJIpM2I/xsku5oKF6BORlARUYm7BuSa GBo6Aukn0Jv27OOi/Skx9/mpbfssR2ub7VRLkuxfC8lSQza9qR4lhD6FvCnoPxpiuXqK l2OEL+vetJDDqDyd2HjMbBPsUqkcHQfNTnXjMb37DuVbZOlYctqJCk3pZVES9QloHrh0 3mzrWhvJr+Ut+GYpKrv3+r2sDTvO+WnRN77BQZDIwuLaUmXv/SgA6wDzNTzRk53OuYpq ZGFw== 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=0oaKQg1Db4rRhO3WCbNaQdRbhtsjokz1BpBDDqQDnH0=; b=phLFIjG9EhruzJc5uMg0TsAFCgvh7AlnuQzntuDPOZAf9EpASW+GuatA07AOobqyuy zTohIZFJxTbfspZf204bG8BVVNTDNpNTAoD9HWwiT09VsrAg7MgHSBxRWRAe1bXU6qj9 if+0+Wh/lJbUe0gGwenRzeCts/O8+XO+tcsQ2U+d3a+oMI9+yZMO66l4UY9wSBIAHQIz lVEliL60P/R+VZZc1cgXKWdSJuCwNET/ZR6IZAd7gevQnHTufqfDtMGCmwqk2H+hXdl4 N0CP57kfuFosPh2dTckCLSS8frplRvp104IniVhlEXentVi5DpHg6/zK2LxQyO6DGzJB iiFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rg5OfuRn; 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 h3-v6si17045711pld.424.2018.11.12.01.59.32; Mon, 12 Nov 2018 01:59:48 -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=Rg5OfuRn; 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 S1729359AbeKLTt6 (ORCPT + 99 others); Mon, 12 Nov 2018 14:49:58 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54615 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729341AbeKLTt4 (ORCPT ); Mon, 12 Nov 2018 14:49:56 -0500 Received: by mail-wm1-f68.google.com with SMTP id r63-v6so7829068wma.4 for ; Mon, 12 Nov 2018 01:57:26 -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=0oaKQg1Db4rRhO3WCbNaQdRbhtsjokz1BpBDDqQDnH0=; b=Rg5OfuRnIxfiEqH0WAirw+p5zFFM2A3eP+/qNVgYtz/p1XWMtJQwYM05UW/C4+j5gX IaZnE3XI6wvJCXcd4FQ1Hx5aghznqX87ea65MY8LBS1tfU6fXt06wlGlTPcLKrs9JP1t 5iM+S+o9ye6yz2LV6kWJfSIofPFST2APQ3GVM= 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=0oaKQg1Db4rRhO3WCbNaQdRbhtsjokz1BpBDDqQDnH0=; b=Ef8Qn95TBgcp+oSGdgXiM+cTs92DNDQV8iKC+1sOXqsMAIj4lbEQxI+ZZlT/F8csnN wJTsXyG125PPlU0YxGbjcC6v07Nb7aRZ5YCLBGgPa5SOPu3snmPKtySZAcp1LY0N4ZWI 2MeFsIg1bOPNnyKDpoTp9b/0AxIkM9mQunrbyzNzrMsR8n9AxcGUaSng5e9BQuHkHqi3 fJAE89ws9EQttOVcYZ+6GlVCvrS0qGTFKxDSBFwmWnthL8M/+M8r6O6udRgU7Gi2/Asf Wiq1tyQqRoOU25+GOhr+qTndVudzYyCFJX14KpUfhuuMhqkU3vt27PI3RYlnS9Be7WsG 9l5g== X-Gm-Message-State: AGRZ1gJd34JnkR7/aYXI528oYVpjJxnvr6W0vC0SZSPMTyeu2kNZb0oT A/EEkWyu8fFG2+MRzSx21y0LsA== X-Received: by 2002:a7b:c84f:: with SMTP id c15-v6mr6284511wml.79.1542016645423; Mon, 12 Nov 2018 01:57:25 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Nov 2018 01:57:24 -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 09/12] block, bfq: use standard file names for the proportional-share policy Date: Mon, 12 Nov 2018 10:56:29 +0100 Message-Id: <20181112095632.69114-10-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 Some of the files exposed in a cgroup by bfq, for the proportional share policy, have the same meaning as the files owned by cfq. The old implementation of the cgroup interface didn't allow different entities to create cgroup files with the same name (in the same subsystem). So, for bfq, we had to add the prefix "bfq" to the names of its cgroup files. This commit renames the cgroup files of the bfq scheduler as those exposed by cfq, and makes bfq share these files with any other policy. Signed-off-by: Angelo Ruocco Signed-off-by: Paolo Valente --- block/bfq-cgroup.c | 94 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 25 deletions(-) diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index 50b2d7ba6b9d..9148fc38c737 100644 --- a/block/bfq-cgroup.c +++ b/block/bfq-cgroup.c @@ -1055,50 +1055,67 @@ struct blkcg_policy blkcg_policy_bfq = { struct cftype bfq_blkcg_legacy_files[] = { { - .name = "bfq.weight", - .flags = CFTYPE_NOT_ON_ROOT, + .name = "weight", + .owner_name = "bfq", + .flags = CFTYPE_NOT_ON_ROOT | CFTYPE_SHARES_FILE, .seq_show = bfq_io_show_weight, .write_u64 = bfq_io_set_weight_legacy, }, /* statistics, covers only the tasks in the bfqg */ { - .name = "bfq.io_service_bytes", + .name = "io_service_bytes", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = (unsigned long)&blkcg_policy_bfq, .seq_show_cft = blkg_print_stat_bytes, }, { - .name = "bfq.io_serviced", + .name = "io_serviced", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = (unsigned long)&blkcg_policy_bfq, .seq_show_cft = blkg_print_stat_ios, }, #ifdef CONFIG_DEBUG_BLK_CGROUP { - .name = "bfq.time", + .name = "time", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.time), .seq_show_cft = bfqg_print_stat, }, { - .name = "bfq.sectors", + .name = "sectors", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .seq_show = bfqg_print_stat_sectors, }, { - .name = "bfq.io_service_time", + .name = "io_service_time", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.service_time), .seq_show_cft = bfqg_print_rwstat, }, { - .name = "bfq.io_wait_time", + .name = "io_wait_time", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.wait_time), .seq_show_cft = bfqg_print_rwstat, }, { - .name = "bfq.io_merged", + .name = "io_merged", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.merged), .seq_show_cft = bfqg_print_rwstat, }, { - .name = "bfq.io_queued", + .name = "io_queued", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.queued), .seq_show_cft = bfqg_print_rwstat, }, @@ -1106,66 +1123,92 @@ struct cftype bfq_blkcg_legacy_files[] = { /* the same statictics which cover the bfqg and its descendants */ { - .name = "bfq.io_service_bytes_recursive", + .name = "io_service_bytes_recursive", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = (unsigned long)&blkcg_policy_bfq, .seq_show_cft = blkg_print_stat_bytes_recursive, }, { - .name = "bfq.io_serviced_recursive", + .name = "io_serviced_recursive", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = (unsigned long)&blkcg_policy_bfq, .seq_show_cft = blkg_print_stat_ios_recursive, }, #ifdef CONFIG_DEBUG_BLK_CGROUP { - .name = "bfq.time_recursive", + .name = "time_recursive", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.time), .seq_show_cft = bfqg_print_stat_recursive, }, { - .name = "bfq.sectors_recursive", + .name = "sectors_recursive", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .seq_show = bfqg_print_stat_sectors_recursive, }, { - .name = "bfq.io_service_time_recursive", + .name = "io_service_time_recursive", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.service_time), .seq_show_cft = bfqg_print_rwstat_recursive, }, { - .name = "bfq.io_wait_time_recursive", + .name = "io_wait_time_recursive", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.wait_time), .seq_show_cft = bfqg_print_rwstat_recursive, }, { - .name = "bfq.io_merged_recursive", + .name = "io_merged_recursive", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.merged), .seq_show_cft = bfqg_print_rwstat_recursive, }, { - .name = "bfq.io_queued_recursive", + .name = "io_queued_recursive", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.queued), .seq_show_cft = bfqg_print_rwstat_recursive, }, { - .name = "bfq.avg_queue_size", + .name = "avg_queue_size", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .seq_show = bfqg_print_avg_queue_size, }, { - .name = "bfq.group_wait_time", + .name = "group_wait_time", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.group_wait_time), .seq_show_cft = bfqg_print_stat, }, { - .name = "bfq.idle_time", + .name = "idle_time", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.idle_time), .seq_show_cft = bfqg_print_stat, }, { - .name = "bfq.empty_time", + .name = "empty_time", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.empty_time), .seq_show_cft = bfqg_print_stat, }, { - .name = "bfq.dequeue", + .name = "dequeue", + .owner_name = "bfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct bfq_group, stats.dequeue), .seq_show_cft = bfqg_print_stat, }, @@ -1175,8 +1218,9 @@ struct cftype bfq_blkcg_legacy_files[] = { struct cftype bfq_blkg_files[] = { { - .name = "bfq.weight", - .flags = CFTYPE_NOT_ON_ROOT, + .name = "weight", + .owner_name = "bfq", + .flags = CFTYPE_NOT_ON_ROOT | CFTYPE_SHARES_FILE, .seq_show = bfq_io_show_weight, .write = bfq_io_set_weight, }, -- 2.16.1