From patchwork Mon Nov 12 09:56:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 10678399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BACD13AD for ; Mon, 12 Nov 2018 09:57:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A9A629F60 for ; Mon, 12 Nov 2018 09:57:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E36529F62; Mon, 12 Nov 2018 09:57:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A25DE29F60 for ; Mon, 12 Nov 2018 09:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726207AbeKLTty (ORCPT ); Mon, 12 Nov 2018 14:49:54 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54612 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729279AbeKLTtx (ORCPT ); Mon, 12 Nov 2018 14:49:53 -0500 Received: by mail-wm1-f67.google.com with SMTP id r63-v6so7828962wma.4 for ; Mon, 12 Nov 2018 01:57:23 -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=BhhSrhl3GPkKSUoXIhn9nAMo7Bh19cGOMzxu3Gi9vPg=; b=QG+hymxrp0k2JHc1mCXq7bGzmIVfKn8kyei84SG0+Y3J9yu8gRuP/KiUBxNO6H35Yw PAM/xy0h10htiE9hYdXK9BcdZPCqgmM0bjBMsEt8TvvDzFJTQMZNtCgl4n1iF4YqNIE/ nqEomghns5VaEzxAIC/4QDraAfkZx5bQG9Ixk= 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=BhhSrhl3GPkKSUoXIhn9nAMo7Bh19cGOMzxu3Gi9vPg=; b=RBW7R48v0OTvA/a3i+RazPS1wWGAw9Wfz0BkY1NDYamX8kOVeVTQVy3SInBEACYbnH MW0GQCtbZQ5qgJqioGn0JUCkm9GqotAudvklWM0SXZyheYq62dVex6Yn35MMAJOyjWow hjg56TilexibPKMRszUnAPYbc9Au5B6fIRsZBB2kfZ+Vz6BfnMDFWyWex5oQ1UJAYyIz SavpOXX2jrKVVErCYVpWMU4EtN+VYBW8JUu/vvYV7ncfFONMfbibetmmjURX1s1lEmRq pDHP7lK+wAAgWhXviwLr0ej+51VzvFpiztVhmIU+Yptgnyyn8tWPw9Z6nBkjCYu7Zbp4 e68g== X-Gm-Message-State: AGRZ1gIqkIS0gbwy1/L+/xnVPbnr5ocqk86/i0xwnsB0Ccr/pVbvlvZh cyS/y+VUSMAe2wIY4YkYjMgnhA== X-Google-Smtp-Source: AJdET5ciK+vocmPu6b60UpX73AaZ1OTTiPWtswUD/U+3dbiFmTt0CYEpBhnfnlzDg3PvsctIzLIX7w== X-Received: by 2002:a1c:3c83:: with SMTP id j125-v6mr6771922wma.65.1542016642661; Mon, 12 Nov 2018 01:57:22 -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.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Nov 2018 01:57:22 -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 08/12] block, cfq: allow cgroup files to be shared Date: Mon, 12 Nov 2018 10:56:28 +0100 Message-Id: <20181112095632.69114-9-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-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Angelo Ruocco Some of the files exposed in a cgroup by cfq have the same meaning as the files exposed by bfq and throttle. This commit allows these files to be shared. Signed-off-by: Angelo Ruocco Signed-off-by: Paolo Valente --- block/cfq-iosched.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index af0c59c2dcde..f046039bdfc6 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -2016,7 +2016,8 @@ static struct cftype cfq_blkcg_legacy_files[] = { }, { .name = "weight", - .flags = CFTYPE_NOT_ON_ROOT, + .owner_name = "cfq", + .flags = CFTYPE_NOT_ON_ROOT | CFTYPE_SHARES_FILE, .seq_show = cfq_print_weight, .write_u64 = cfq_set_weight, }, @@ -2035,40 +2036,56 @@ static struct cftype cfq_blkcg_legacy_files[] = { /* statistics, covers only the tasks in the cfqg */ { .name = "time", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.time), .seq_show_cft = cfqg_print_stat, }, { .name = "sectors", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .seq_show = cfqg_print_stat_sectors, }, { .name = "io_service_bytes", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = (unsigned long)&blkcg_policy_cfq, .seq_show_cft = blkg_print_stat_bytes, }, { .name = "io_serviced", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = (unsigned long)&blkcg_policy_cfq, .seq_show_cft = blkg_print_stat_ios, }, { .name = "io_service_time", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.service_time), .seq_show_cft = cfqg_print_rwstat, }, { .name = "io_wait_time", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.wait_time), .seq_show_cft = cfqg_print_rwstat, }, { .name = "io_merged", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.merged), .seq_show_cft = cfqg_print_rwstat, }, { .name = "io_queued", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.queued), .seq_show_cft = cfqg_print_rwstat, }, @@ -2076,70 +2093,97 @@ static struct cftype cfq_blkcg_legacy_files[] = { /* the same statictics which cover the cfqg and its descendants */ { .name = "time_recursive", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.time), .seq_show_cft = cfqg_print_stat_recursive, }, { .name = "sectors_recursive", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .seq_show = cfqg_print_stat_sectors_recursive, }, { .name = "io_service_bytes_recursive", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = (unsigned long)&blkcg_policy_cfq, .seq_show_cft = blkg_print_stat_bytes_recursive, }, { .name = "io_serviced_recursive", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = (unsigned long)&blkcg_policy_cfq, .seq_show_cft = blkg_print_stat_ios_recursive, }, { .name = "io_service_time_recursive", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.service_time), .seq_show_cft = cfqg_print_rwstat_recursive, }, { .name = "io_wait_time_recursive", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.wait_time), .seq_show_cft = cfqg_print_rwstat_recursive, }, { .name = "io_merged_recursive", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.merged), .seq_show_cft = cfqg_print_rwstat_recursive, }, { .name = "io_queued_recursive", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.queued), .seq_show_cft = cfqg_print_rwstat_recursive, }, #ifdef CONFIG_DEBUG_BLK_CGROUP { .name = "avg_queue_size", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .seq_show = cfqg_print_avg_queue_size, }, { .name = "group_wait_time", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.group_wait_time), .seq_show_cft = cfqg_print_stat, }, { .name = "idle_time", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.idle_time), .seq_show_cft = cfqg_print_stat, }, { .name = "empty_time", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.empty_time), .seq_show_cft = cfqg_print_stat, }, { .name = "dequeue", + .owner_name = "cfq", + .flags = CFTYPE_SHARES_FILE, .private = offsetof(struct cfq_group, stats.dequeue), .seq_show_cft = cfqg_print_stat, }, { .name = "unaccounted_time", + .owner_name = "cfq", .private = offsetof(struct cfq_group, stats.unaccounted_time), .seq_show_cft = cfqg_print_stat, }, @@ -2181,7 +2225,8 @@ static ssize_t cfq_set_weight_on_dfl(struct kernfs_open_file *of, static struct cftype cfq_blkcg_files[] = { { .name = "weight", - .flags = CFTYPE_NOT_ON_ROOT, + .owner_name = "cfq", + .flags = CFTYPE_NOT_ON_ROOT | CFTYPE_SHARES_FILE, .seq_show = cfq_print_weight_on_dfl, .write = cfq_set_weight_on_dfl, },