Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3823675imu; Mon, 28 Jan 2019 11:27:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN5raOuF0/4eTfjKWtP0/2vcEQoKQjwC5g9tG8LrqB0UhNNkfBVs5MrN4YwlHMSsOgTDX+OH X-Received: by 2002:a65:47ca:: with SMTP id f10mr14687564pgs.166.1548703645128; Mon, 28 Jan 2019 11:27:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548703645; cv=none; d=google.com; s=arc-20160816; b=y+uhNC7zWiCbklBB4JbZsUy619B161fTZ2b3IItZ6rbQtG2yVrk4PLv1EEwNB5rwtO 8Rb2zGfbXm9MexbtWub5TOqyxbWerKbu5Uk4IEeY6yZuXFgO4t4lt5J1a2iJnK55+u4f yNQb9g2hKDFbtVhSx1LCAo4xrWi0+zNFoFc/ZuFrHl0rhnkiYFTYRdxFWWS4ShqurerX J4VqKDLVCJq7mumKslsV2BTq7JGWuayRjoM6jPMxINLPxo3uLrZbnCZTJL2UUec7QIb2 bK01ICgEpLYsI71ax5dbztQruvHByzv4e17fD20WqC23ItPX4SHeoE9GaTwNzM2DaqP7 76ow== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rvvw2zaxPnh6AkqX61ABmtQ5O5YDCXmPOa6KpIXBnzo=; b=BxcPwQrPmvI1tUBNS0Bz1+gselYfDFFL/9wPVMff3U4UMXgy2/0WDaWCJlk/QdfFhN Mr1CH6ou26rOoNA7xYakK/RWJiMWMHLMjU+aw4ueAUKv7Pi4EqTbIzHnHht0U1WB4xI9 +BZubH31FLrclakn+DsPOU8CI0qisx9TfvPhq4gyY79x+v+l6NSyHaBKD31499gP2La1 JAhwMvcN+9XIQVFZL3NMFsV1HHytBOu/ohMXzrd7dKlXijwi3JV8DIP2H2EDN6sbiENd trYrRRgLU8BFg5M5/8a2h43pFFzO7IJ90VKJ72f4AyY77F1o21R7vboIa2B5mPDA7u1K ZvcQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si8189420pgh.18.2019.01.28.11.27.08; Mon, 28 Jan 2019 11:27:25 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727771AbfA1T0W (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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