Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3479123imu; Fri, 18 Jan 2019 11:05:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN6K5SEHwacDS5AjROg1ISkjVs1FYil+97EA5yOw4+J5JJ8KVMa17kLOkwd86+FddUH972Vz X-Received: by 2002:a17:902:14b:: with SMTP id 69mr20562097plb.52.1547838330329; Fri, 18 Jan 2019 11:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547838330; cv=none; d=google.com; s=arc-20160816; b=nXM9NSVC99flqsWSxn8iuiolHGWGS6o7puoEgDgKxP+953GjZeWQcA4LuuPFo+Zs8A WkF1ktoPxH563bzVOC4pIuqh/1Bsf2Gw7pS3siiMNi2xWeRl99I0Ak27XcbAqhdHewKk xWnC6Pk0w/dSuAMW9npn2Ip6jwH0GFnyvIy5Bvkiisa5BvF6RTrudrI5EfrftUKndUju 7jQgK5DxaI2XRQpnYq5yDF4h2mIqfLegEzNLNpWGn4nG2V3HUzvXJGl+ghMfBBrftAiE PENJH5IyD6CIGdMj2I9agqTwZReQ7BUfCP1lvpbhlvec00XE4beboBbbqTfs9VSwqQ+Q 2onA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1UMa4yCXmM3OK38bryfUjoNkHrVdY+842bxFOYwuFrA=; b=LatkBZwWTcSsoTgaWe5KXQJCvhNdu7L3xs7DBXsR6MSX31ZxQJz3ajxS3rf9GEyWsB Ylr0g3BGiYqjP1lMwGqTwJeV76+snlsLU2nkSKQfsRbYAfibjHAt+vlJtULT9XfsXJ1s aHZaM2rTLRENIMoEOf4oCWsK5jYR5OyEdJQBIFvbutUArQUc490Cjp8zFUVlMbU44HQl VPN8MBiiVynDFDQsCWGcQpZ7+w6QCe2UfY9rFghKtI6HDtCllEmzIOmpJRPphHtLMNq6 zuN7wSUWhfbm+OWKwKMfh5o7xy4L3D8+hFmN/k/Dhm6Y0jqtZXklryhOp+HsnIvHn1bC aXgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hLAJqvdq; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b11si4948824pgt.289.2019.01.18.11.05.14; Fri, 18 Jan 2019 11:05:30 -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=@gmail.com header.s=20161025 header.b=hLAJqvdq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729176AbfARTCb (ORCPT + 99 others); Fri, 18 Jan 2019 14:02:31 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:45667 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728583AbfARTCb (ORCPT ); Fri, 18 Jan 2019 14:02:31 -0500 Received: by mail-wr1-f67.google.com with SMTP id t6so16292145wrr.12; Fri, 18 Jan 2019 11:02:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1UMa4yCXmM3OK38bryfUjoNkHrVdY+842bxFOYwuFrA=; b=hLAJqvdqa5AmoAZ8dykKzHIvpLwfc/1enH5Qndq2pLDg3c0WHNnomUGTN6V8M/h03L wDSs5wP2dW+1ktrRparURlTqi4fwUyCW02xYH6j0Xydo9r9u/rX8DVlKeuAljhAVHRlq Z1IHAnvmvyGRMJJYYu6KSArZ/p1wbzjiLIplwznGq9ZzG7JH6yTmEu0tTjOo3vCS6iAA vMj5S58YJeklAQZiAQ/hn9k7Ac0BaEJcfb+LYKuGlQf9En0H1Xp58H6bvlc/X7xBQ1LR 8+FaBdcMoGLfxmPnjWR8DRKYpukSxJIcmLAT1j+vMOaBE73QYxV5lNxz1aEMJj4DEWX/ mZLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1UMa4yCXmM3OK38bryfUjoNkHrVdY+842bxFOYwuFrA=; b=FP7gU75BpobA3SwOWx70xUYusDBvmqd8PMjLbh63oUqdY3yJmJv9lyY+cnd3DpqOtZ JVq9OXhDs96KibvI+Hyfon9s1RmCsguiJQxuIhb2xS2a6t5LnS8AL4iPgkbkjo/1mtyn Pt4IioXXqn5F3z0ka9eAYG8WXaOcsCmPygNYQgUYRRb7DRr/x9T/5FWwa4zSm8nlVoRP ASlC1iXh5cg/HXI7IXe6mYrPIzi7W+ddze+4pGHR4uXX2JG3xvMM3bl1stp2KB8b7Wt9 h4bka8OpsNokGY/yuaw1cTlcOMtZgK5NnT4063RO9MxcyyqpdKeqAyUp7XxldLt8lBEA 0ZaQ== X-Gm-Message-State: AJcUukc/IisineDMV1KGVofaE0O6jEHV6BUy3SbPwtp9ncAdftxe5OTD fj6HOOZy3+FYoj1CHdR8tg== X-Received: by 2002:adf:f848:: with SMTP id d8mr18850760wrq.178.1547838148828; Fri, 18 Jan 2019 11:02:28 -0800 (PST) Received: from localhost (host89-130-dynamic.43-79-r.retail.telecomitalia.it. [79.43.130.89]) by smtp.gmail.com with ESMTPSA id l20sm175173029wrb.93.2019.01.18.11.02.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 11:02:28 -0800 (PST) Date: Fri, 18 Jan 2019 20:02:27 +0100 From: Andrea Righi To: Paolo Valente Cc: Josef Bacik , Tejun Heo , Li Zefan , Johannes Weiner , Jens Axboe , Vivek Goyal , Dennis Zhou , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/3] cgroup: fsio throttle controller Message-ID: <20190118190227.GC1535@xps-13> References: <20190118103127.325-1-righi.andrea@gmail.com> <20190118163530.w5wpzpjkcnkektsp@macbook-pro-91.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 18, 2019 at 06:07:45PM +0100, Paolo Valente wrote: > > > > Il giorno 18 gen 2019, alle ore 17:35, Josef Bacik ha scritto: > > > > On Fri, Jan 18, 2019 at 11:31:24AM +0100, Andrea Righi wrote: > >> This is a redesign of my old cgroup-io-throttle controller: > >> https://lwn.net/Articles/330531/ > >> > >> I'm resuming this old patch to point out a problem that I think is still > >> not solved completely. > >> > >> = Problem = > >> > >> The io.max controller works really well at limiting synchronous I/O > >> (READs), but a lot of I/O requests are initiated outside the context of > >> the process that is ultimately responsible for its creation (e.g., > >> WRITEs). > >> > >> Throttling at the block layer in some cases is too late and we may end > >> up slowing down processes that are not responsible for the I/O that > >> is being processed at that level. > > > > How so? The writeback threads are per-cgroup and have the cgroup stuff set > > properly. So if you dirty a bunch of pages, they are associated with your > > cgroup, and then writeback happens and it's done in the writeback thread > > associated with your cgroup and then that is throttled. Then you are throttled > > at balance_dirty_pages() because the writeout is taking longer. > > > > IIUC, Andrea described this problem: certain processes in a certain group dirty a > lot of pages, causing write back to start. Then some other blameless > process in the same group experiences very high latency, in spite of > the fact that it has to do little I/O. > > Does your blk_cgroup_congested() stuff solves this issue? > > Or simply I didn't get what Andrea meant at all :) > > Thanks, > Paolo Yes, there is also this problem: provide fairness among processes running inside the same cgroup. This is a tough one, because once the I/O limit is reached whoever process comes next gets punished, even if it hasn't done any I/O before. Well, my proposal doesn't solve this problem. To solve this one in the "throttling" scenario, we should probably save some information about the previously generated I/O activity and apply a delay proportional to that (like a dynamic weight for each process inside each cgroup). AFAICS the io.max controller doesn't solve this problem either. -Andrea