From patchwork Mon Nov 12 09:56:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 150799 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2947684ljp; Mon, 12 Nov 2018 01:57:07 -0800 (PST) X-Google-Smtp-Source: AJdET5eA3isvjsBs8CTxUEeV7ZS/5CHz7BAI2gKBfXAahnmWZz/IHjTe2qHdVwPEkQyM4pbmGye4 X-Received: by 2002:a63:4a0a:: with SMTP id x10mr233708pga.237.1542016627712; Mon, 12 Nov 2018 01:57:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542016627; cv=none; d=google.com; s=arc-20160816; b=rb3KVqy3v+fvnIZyTGMhbPTX4gaoJLK8bWxhbJWmP3R03Sj/5Sl0RedVdmbt/VivZ1 z56GRpv4YyID2CzDE9tFaeZofN1tdLOG5j2QjUyXoEyjYoTpzCYr3P66LuYqQPC2Xclx +an15fe263jHDqhuufC3V60DdKT91fdpvNLpUhdZPWVx3z0i51pivQQsjttDo+cdXZUU gxmxs6mNMG9ZrFs2HbRG4fqqyJst+bT6rlfE83QynWkPpyt/F6ROxX1yKuiNPuQga4BE 0Qx1anMeX+hxnddDulM3Fqadypl9d9Y4O5VVcx4/a7odES0rMlQAGMo2BQPCMTVdX7Zq NEAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=5NCEbWQclgX8xpLbb2pIjqCBIH5tuRRK++nUd6E0vSs=; b=hya6l2KKtOFFjkAMoH2jDx3AC4fXB968NdiPA4sYuuxhaVAIiyhkV4lW+6w+xBOgrD L0ngG9s264PJyverphzJDVAyjV2ZnUIPQ/nbvocpeWe9e3a2y3Z7bWoP+OckrSpSomoC vO9UfRDXR0G6fKkhHV+9xbYqBwxXdMGyNhA4v8zWYF8nPXpKZIAgUN/D5ag/LUsyIyRu u2Z0+maumiv997GfS/YO4yCgKrNxC1a2s04HoEnkExdJyoEgdBLFfPa/DUm1UyP3Qzuz bPhIMGVbB6G1k/P4GaRUmMXCOr3oJ6LnRC/fcRppan6tPP0SqshZZkMnxNrfPAq9vQbs E9ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZP8OFRu+; 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 n5si14436165pgl.485.2018.11.12.01.57.07; Mon, 12 Nov 2018 01:57:07 -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=ZP8OFRu+; 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 S1728205AbeKLTtc (ORCPT + 32 others); Mon, 12 Nov 2018 14:49:32 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:34800 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725873AbeKLTtb (ORCPT ); Mon, 12 Nov 2018 14:49:31 -0500 Received: by mail-wm1-f65.google.com with SMTP id f1-v6so8445933wmg.1 for ; Mon, 12 Nov 2018 01:57:03 -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; bh=5NCEbWQclgX8xpLbb2pIjqCBIH5tuRRK++nUd6E0vSs=; b=ZP8OFRu+RKvhSzcVJmFuKWdyLaxPvw6eJ3EoE01vT0OKpBzf+TDowOhoLsELgoToEh UmcuzB9EvofHfDSk03ybYmYu3hZ4Wy6Qj0WPxyBAcwv/44Y3lMhbiGDjp/HtoYmdM3xf pJBhg8N82vVmwFfbxWmgNNVjs6jE8ICrnjhZY= 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; bh=5NCEbWQclgX8xpLbb2pIjqCBIH5tuRRK++nUd6E0vSs=; b=r5ACUERr0Ds2IOvukTagP/Avd8+zTivs9aSNlTskc+jrbMODN7MS11mqQBvwrLJFG7 ErsM1/S9ZJ7GIvd9Sm3rhKGHwgHDO/lOnLptoe4dtXT/2a+ps480DOn2akaHkfSZt5Ar XfcM6yS1bnk5bINhD6zUwSJlIj5lfpq3p7WLSOIY93jXj3UZ/5xMufUQPxrPh32opoVf SPydXNrIMfejARtKXjXLf5M0c44gRJmz4cOuvUCRW1rypuP4yJM6IgCLfgB5pm2v+7hb pZVdj9QdMpRQNbiOyIMBQBAFKxeT2Y029IsfKkRs/CYqyO7Ldu7UsmBsfGt1k5N/63Hm qeog== X-Gm-Message-State: AGRZ1gJC89/2dxDbGtIrjMFnQzN+URmJRH93K9bGZ75Ir4KuxiypfJOp 6TT/BMLZ9BQeQMMe/i8VCO1Qdg== X-Received: by 2002:a1c:38c5:: with SMTP id f188-v6mr6871687wma.19.1542016622433; Mon, 12 Nov 2018 01:57:02 -0800 (PST) Received: from localhost.localdomain ([93.68.220.21]) by smtp.gmail.com with ESMTPSA id r14-v6sm21273089wro.8.2018.11.12.01.56.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Nov 2018 01:57:01 -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 00/12] unify the interface of the proportional-share policy in blkio/io Date: Mon, 12 Nov 2018 10:56:20 +0100 Message-Id: <20181112095632.69114-1-paolo.valente@linaro.org> X-Mailer: git-send-email 2.16.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jens, Tejun, all, about nine months ago, we agreed on a solution for unifying the interface of the proportional-share policy in blkio/io [1]. Angelo and I finally completed it. Let me briefly recall the problem and the solution. The current implementation of cgroups doesn't allow two or more entities, e.g., I/O schedulers, to share the same files. So, if CFQ creates its files for the proportional-share policy, such as, e.g, weight files for blkio/io groups, BFQ cannot attach somehow to them. Thus, to enable people to set group weights with BFQ, I resorted to making BFQ create its own version of these common files, by prepending a bfq prefix. Actually, no legacy code uses these different names, or is likely to do so. Having these two sets of names is simply a source of confusion, as pointed out also, e.g., by Lennart Poettering (CCed here), and acknowledged by Tejun [2]. In [1] we agreed on a solution that solves this problem, by actually making it possible to share cgroups files. Both writing to and reading from a shared file trigger the appropriate operation for each of the entities that share the file. In particular, in case of reading, - if all entities produce the same output, the this common output is shown only once; - if the outputs differ, then every per-entity output is shown, preceded by the name of the entity that produced that output. With this solution, legacy code that, e.g., sets group weights, just works, regardless of the I/O scheduler actually implementing proportional share. But note that this extension is not restricted to only blkio/io. The general group interface now enables files to be shared among multiple entities of any kind. (I have also added a patch to fix some clerical errors in bfq doc, which I found while making the latter consistent with the new interface.) Thanks, Paolo [1] https://lkml.org/lkml/2018/1/4/667 [2] https://github.com/systemd/systemd/issues/7057 Angelo Ruocco (7): kernfs: add function to find kernfs_node without increasing ref counter cgroup: link cftypes of the same subsystem with the same name cgroup: add owner name to cftypes block, bfq: align min and default weights with cfq cgroup: make all functions of all cftypes be invoked block, cfq: allow cgroup files to be shared block, throttle: allow sharing cgroup statistic files Paolo Valente (5): cgroup: add hook seq_show_cft with also the owning cftype as parameter block, cgroup: pass cftype to functions that need to use it block, bfq: use standard file names for the proportional-share policy doc, bfq-iosched: fix a few clerical errors doc, bfq-iosched: make it consistent with the new cgroup interface Documentation/block/bfq-iosched.txt | 31 +++-- block/bfq-cgroup.c | 148 +++++++++++++------- block/bfq-iosched.h | 4 +- block/blk-cgroup.c | 22 +-- block/blk-throttle.c | 24 ++-- block/cfq-iosched.c | 105 +++++++++++---- fs/kernfs/dir.c | 13 ++ include/linux/blk-cgroup.h | 10 +- include/linux/cgroup-defs.h | 14 +- include/linux/cgroup.h | 13 ++ include/linux/kernfs.h | 7 + kernel/cgroup/cgroup.c | 262 +++++++++++++++++++++++++++++------- 12 files changed, 483 insertions(+), 170 deletions(-) -- 2.16.1