From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7827C282C8 for ; Mon, 28 Jan 2019 19:26:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DC2F2148E for ; Mon, 28 Jan 2019 19:26:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727033AbfA1T0W (ORCPT ); Mon, 28 Jan 2019 14:26:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51312 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbfA1T0W (ORCPT ); Mon, 28 Jan 2019 14:26:22 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7058988308; Mon, 28 Jan 2019 19:26:21 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F0EB61786; Mon, 28 Jan 2019 19:26:21 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 9094D22386D; Mon, 28 Jan 2019 14:26:20 -0500 (EST) Date: Mon, 28 Jan 2019 14:26:20 -0500 From: Vivek Goyal To: Andrea Righi Cc: Josef Bacik , Tejun Heo , Li Zefan , Johannes Weiner , Jens Axboe , 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: <20190128192620.GB10240@redhat.com> References: <20190118103127.325-1-righi.andrea@gmail.com> <20190118163530.w5wpzpjkcnkektsp@macbook-pro-91.dhcp.thefacebook.com> <20190118184403.GB1535@xps-13> <20190118194652.gg5j2yz3h2llecpj@macbook-pro-91.dhcp.thefacebook.com> <20190119100827.GA1630@xps-13> <20190121214715.GA27713@redhat.com> <20190128174129.GB8272@xps-13> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190128174129.GB8272@xps-13> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 28 Jan 2019 19:26:22 +0000 (UTC) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Jan 28, 2019 at 06:41:29PM +0100, Andrea Righi wrote: > Hi Vivek, > > sorry for the late reply. > > On Mon, Jan 21, 2019 at 04:47:15PM -0500, Vivek Goyal wrote: > > On Sat, Jan 19, 2019 at 11:08:27AM +0100, Andrea Righi wrote: > > > > [..] > > > Alright, let's skip the root cgroup for now. I think the point here is > > > if we want to provide sync() isolation among cgroups or not. > > > > > > According to the manpage: > > > > > > sync() causes all pending modifications to filesystem metadata and cached file data to be > > > written to the underlying filesystems. > > > > > > And: > > > According to the standard specification (e.g., POSIX.1-2001), sync() schedules the writes, but > > > may return before the actual writing is done. However Linux waits for I/O completions, and > > > thus sync() or syncfs() provide the same guarantees as fsync called on every file in the sys‐ > > > tem or filesystem respectively. > > > > > > Excluding the root cgroup, do you think a sync() issued inside a > > > specific cgroup should wait for I/O completions only for the writes that > > > have been generated by that cgroup? > > > > Can we account I/O towards the cgroup which issued "sync" only if write > > rate of sync cgroup is higher than cgroup to which page belongs to. Will > > that solve problem, assuming its doable? > > Maybe this would mitigate the problem, in part, but it doesn't solve it. > > The thing is, if a dirty page belongs to a slow cgroup and a fast cgroup > issues "sync", the fast cgroup needs to wait a lot, because writeback is > happening at the speed of the slow cgroup. Hi Andrea, But that's true only for I/O which has already been submitted to block layer, right? Any new I/O yet to be submitted could still be attributed to faster cgroup requesting sync. Until and unless cgroups limits are absurdly low, it should not take very long for already submitted I/O to finish. If yes, then in practice, it might not be a big problem? Vivek > > Ideally in this case we should bump up the writeback speed, maybe even > temporarily inherit the write rate of the sync cgroup, similarly to a > priority-inversion locking scenario, but I think it's not doable at the > moment without applying big changes. > > Or we could isolate the sync domain, meaning that a cgroup issuing a > sync will only wait for the syncing of the pages that belong to that > sync cgroup. But probably also this method requires big changes... > > -Andrea