From patchwork Tue May 21 08:01:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 164695 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1295876ili; Tue, 21 May 2019 01:02:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqytYE8Ds0XYkEJ2ulh2sIUsargmpB8qf0o2QwCp2OyaC0Cr+92rDvtTXpMUDnkGg6VE18J8 X-Received: by 2002:a63:17:: with SMTP id 23mr79830049pga.206.1558425764471; Tue, 21 May 2019 01:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558425764; cv=none; d=google.com; s=arc-20160816; b=gy/IZdzpyvUB0yCl6Yal6jCIpGkucGJvZoAa5PAbiDBKSOYXgQCAtksaXWZiOaAJHA XU4z4V9sWu9vhyWjILZ9UJmYK3xi9FIZtTldH5DtQK4JBll5EnORijgIaQC95GL6cJ7/ /ESI8jr6tvpciKm1yhf8mGnJJWgyzFpVPxu6EqEUTvQzFW7tTA5/5focxnA30QiGx2f+ gPbpOATPTS+lrmXCgNzqqyxAoncBimeZ2nCtvKgLeZwVCwcPVXRSgOzjf0tyZkHtDAfa b6E7oxiH6pnPJB7EYPBlozUbGDt7uLv1dNB1g4DTI3WeX1qv8ZuZVL5wiI9l11b4C6Gn K94Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DOhhDvGFx5TQBrV3vUuuJNqU81qFULp2qAUcY70tdpo=; b=meC779yWx6yuRwCgOdu66BsRaOWsU6LhUqzWCvlWHNGvTP1CT9adV8GxM+YDhetcSZ RDJoALnHsy/02JLD3zypy/C93j1BSIJshfwkxsLGygFkvz94r4MABDLVzK8ENP8PM2KE CRIJrwnVCs5FZPevX0IYRbC/FATKSv7Z2CUdjsXM3GLAhsfx7M/Jbwqji96MTgmE6qIz e4DcHoUGX18aqodAr5whRILukMduylkWSKa1bph5XAKgktd4cpMiBw+ARaqstc+H+ZX6 p/jhp568862YC3Q3cI4v/IJ2gXTVBeXBEBlnMdN0d9r6IcDoQbN+ZPFqzKvmA/c4DyU3 NmDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U5lZgDhD; 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 67si22041129pfe.269.2019.05.21.01.02.44; Tue, 21 May 2019 01:02:44 -0700 (PDT) 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=U5lZgDhD; 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 S1727253AbfEUICn (ORCPT + 30 others); Tue, 21 May 2019 04:02:43 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35347 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727205AbfEUICl (ORCPT ); Tue, 21 May 2019 04:02:41 -0400 Received: by mail-wm1-f66.google.com with SMTP id q15so1819773wmj.0 for ; Tue, 21 May 2019 01:02:40 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=DOhhDvGFx5TQBrV3vUuuJNqU81qFULp2qAUcY70tdpo=; b=U5lZgDhD03GpNQCNQxmESbv9lWfJZcDrizZYolBCQqWW/xEYt9UwLILokyg8eZw2fv OoHDixUXEs4MfaUj9VCaYKeLQ6CgxSEf+3dN3WetIPP+SUCRY7n1qJjhUO9i7So752mT eOVjY3sdJA+kTXkPvE52Mc0lf6Qz9kuRXbijZTvxFeFXk/rtACX7jccmZp1RgxGZpYNb R8icSFl8ioKe7x+3GqeaG1+kGo2RQ5tP0EH7tAtsrz9RlLQT0gbcEiXM0C89oq41RMxJ 131Ipwk/vsUv5tD+3ALHha2SVRHMkreikP5BaMJXOjM6YlJ28mWz/Gj0x3kuklYPyrNb hU3A== 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:mime-version:content-transfer-encoding; bh=DOhhDvGFx5TQBrV3vUuuJNqU81qFULp2qAUcY70tdpo=; b=uWi0SfaGdtcIwvpx2EIDGiay5Q0O6SIhoDJiXpJo2n6KIbPdma+ZxbPzv/DD+FPppj ngiNUWx6RL49T5a7Vm1i5aGs87ik5cVDMTstLDF/+rYxVdz0E2X0TG9GAWnbgRkjFeyc cQAibQLqGaNWY1MkA6dVpt8ON5h/ysh1vPPmwFmWFk6rlZEXUn7JEfz4T2q4+Nmi8Vqe 2sUo6995yJiK2flNS0pMBpFvQ6ccdIfznuNu6FY7uJIYXq8ElZy3YJdAcCyg1vWVYWLe XxbCc5aTe6ftQuOGZjcO7pbJL2D22haquYIa+HtgWwiOWjlTzm4sJz5X1MDWSUHCqPpP HCsg== X-Gm-Message-State: APjAAAVrVlaokdjzURsuR4IrR/Qbfm4TYXaxmjkqgKgCHJ4QPPCFeCP0 22obsxJaTs4/uWiZpIAZ8e8Yiw== X-Received: by 2002:a1c:3287:: with SMTP id y129mr2330502wmy.153.1558425759355; Tue, 21 May 2019 01:02:39 -0700 (PDT) Received: from localhost.localdomain ([88.147.35.136]) by smtp.gmail.com with ESMTPSA id p8sm11322301wro.0.2019.05.21.01.02.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 01:02:38 -0700 (PDT) From: Paolo Valente To: Jens Axboe 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, Angelo Ruocco , Johannes Thumshirn , Paolo Valente Subject: [PATCH 2/2] block, bfq: add weight symlink to the bfq.weight cgroup parameter Date: Tue, 21 May 2019 10:01:55 +0200 Message-Id: <20190521080155.36178-3-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190521080155.36178-1-paolo.valente@linaro.org> References: <20190521080155.36178-1-paolo.valente@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Angelo Ruocco Many userspace tools and services use the proportional-share policy of the blkio/io cgroups controller. The CFQ I/O scheduler implemented this policy for the legacy block layer. To modify the weight of a group in case CFQ was in charge, the 'weight' parameter of the group must be modified. On the other hand, the BFQ I/O scheduler implements the same policy in blk-mq, but, with BFQ, the parameter to modify has a different name: bfq.weight (forced choice until legacy block was present, because two different policies cannot share a common parameter in cgroups). Due to CFQ legacy, most if not all userspace configurations still use the parameter 'weight', and for the moment do not seem likely to be changed. But, when CFQ went away with legacy block, such a parameter ceased to exist. So, a simple workaround has been proposed [1] to make all configurations work: add a symlink, named weight, to bfq.weight. This commit adds such a symlink. [1] https://lkml.org/lkml/2019/4/8/555 Suggested-by: Johannes Thumshirn Signed-off-by: Angelo Ruocco Signed-off-by: Paolo Valente --- block/bfq-cgroup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index b3796a40a61a..59f46904cb11 100644 --- a/block/bfq-cgroup.c +++ b/block/bfq-cgroup.c @@ -1046,7 +1046,8 @@ struct blkcg_policy blkcg_policy_bfq = { struct cftype bfq_blkcg_legacy_files[] = { { .name = "bfq.weight", - .flags = CFTYPE_NOT_ON_ROOT, + .link_name = "weight", + .flags = CFTYPE_NOT_ON_ROOT | CFTYPE_SYMLINKED, .seq_show = bfq_io_show_weight, .write_u64 = bfq_io_set_weight_legacy, }, @@ -1166,7 +1167,8 @@ struct cftype bfq_blkcg_legacy_files[] = { struct cftype bfq_blkg_files[] = { { .name = "bfq.weight", - .flags = CFTYPE_NOT_ON_ROOT, + .link_name = "weight", + .flags = CFTYPE_NOT_ON_ROOT | CFTYPE_SYMLINKED, .seq_show = bfq_io_show_weight, .write = bfq_io_set_weight, },