Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3880184imu; Mon, 12 Nov 2018 01:58:44 -0800 (PST) X-Google-Smtp-Source: AJdET5fergWwqJxP10Cy8BwEeLfCUr7C6Q2GEquOZwvcyokLXnupT26g/9Cm+v3NgccxX/N5x1Lz X-Received: by 2002:a17:902:887:: with SMTP id 7-v6mr275268pll.283.1542016724203; Mon, 12 Nov 2018 01:58:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542016724; cv=none; d=google.com; s=arc-20160816; b=KptxzBrUFduf6Vg5bSeXFZzpCtubdIcYhs1w2NhGTBwSuLNCS/ZgZ/VrsfqzJiLLzn gTyTjaHjTs+5jXJ7OZDkuIvZrN8hqOOWPj+9yqi9WttYUjx5JdnCyTU8hV8U0TIOAG2j E3spk61SDXRBNePTd2QOjM7TqMe+4400pjNpMaFzanQ+GXHi+GziEIQm8UWYdHfFrKDB PH0eVQmEaPVgwnNkrk3F78i6BlOUDbL8/8u2JsqAWssqYS/P9UgeeuMgN85lafxo1KRn 5Pnsx8Qayx+mcWGL5Je0mvbA2bFAxPV8MctgyOPW18n6yh+F6GSJTdw3agPFK1LNZR6E 59UA== 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=BhhSrhl3GPkKSUoXIhn9nAMo7Bh19cGOMzxu3Gi9vPg=; b=lm9HMAxq4MlR/BhPy3BlJeZhLiDFiE8da1H2sJHne3bxpD0/XHfB5gq1r7CRwz8Pmx 4nKhFAl4to11RiT6T8xOXbBnA1R1t3YIICZMrtQ5sOguthyxuFWD0fXUL+T6JatiP+gy sxqoltBxyfjKlGf7hpWB/EuRebqfR7uYB8oppqYkpi9GjB9t3poFiKEKDZzAyyIQ9lLN WMWGwMnxFRSuYEMOsmJg7CMmqJNsAItFjmGVrVZRGhgqpUeT53iO6M5xnL8RigVKZXyI kpoVyFtUujFf2mG5V34hJ309qjT1uzLD6xfZ+MgNrI9WkGpCATK5DeZ6i0DW4FkdcfUe WZ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QG+hymxr; 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 w185si15823826pgd.518.2018.11.12.01.58.29; Mon, 12 Nov 2018 01:58:44 -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=QG+hymxr; 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 S1729329AbeKLTtx (ORCPT + 99 others); Mon, 12 Nov 2018 14:49:53 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53849 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729150AbeKLTtw (ORCPT ); Mon, 12 Nov 2018 14:49:52 -0500 Received: by mail-wm1-f66.google.com with SMTP id f10-v6so7788142wme.3 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=K0Z4fNtPx29BcohML4GPZ9krN4/CG7etL/qaQozxfPm32yNl2tPrJfkcsdLczzobAV BAu6gRXfzDT2EG7aYs5JUU07cM+DCD7EnyH8BIj8e4wCvJHHxfy3BC6ZEHFhiCGfmcWM yFsDO6Eujdk8WdiD96t4AOHemK6fT+XDK7PEdw2SavIgzaoHUsOi4/m3svR+EAMZC+V/ YR7pRSi9i7Ah/1R65ApdvW+Y5aKNLuuv2jFsiDxjNDtC6GiUTboL53OB2vbApHy1uCFB HDdZH0X/FkIjZ+U+7x6u4B/nZjjC4AHCkH9mMvpZ+u3BRm6MD8EqDix3T9ZjeO7hrwiv jCAg== X-Gm-Message-State: AGRZ1gIbdbSv7gdxThrePXXfAxq9+cYwy7s9nlKb48zulmciRVgmncCJ cPXM93OTjWc04l5vMBG/5uYFcL7LtByutyVq 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, }, -- 2.16.1