Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3006176imu; Fri, 18 Jan 2019 03:11:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN6C8KVD9VJNp2Z8oy46ZLOlnleWANZHISY0I0ZQW1cSoxZAanLC3kOl3suFDz4ezTCttn15 X-Received: by 2002:a63:cc4e:: with SMTP id q14mr16995039pgi.291.1547809894505; Fri, 18 Jan 2019 03:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547809894; cv=none; d=google.com; s=arc-20160816; b=eft9XuKcp1QZMVPxke8kxzt1pmcxwIOu1MlB9RZY0ozlOHX+R8zeBd2Mh1m+Kf1rn6 2Dbo8jZVX17DL7iVrvr/Ata8HCynTLH0/zTlfh2ocyEc6TAnuPONvI21MOexawCdCkx6 dELJwLjzeSi63YZnyTlfLFKoRa5839fWeHsvSoKUdu0HHoXhHaj0dxrMDhgvgxblcIAJ xRInHL4fncrzexYBJnh/aUOlLxjEkAl4uRKD/tAnximydrr80Vrzj3+GY52rVudv0oHk mEO0kk1miGH1ES6x6DV1Hk+/yBrpXl+seCu6jd0Rvr26Nbz2AmJWop/+0uj/sy9fDp/t zPGg== 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=i9Jz6mADl+SAlcH6gEeO3JwA6zj1h7g3kXeXLvf3Qh4=; b=AgyhNwNYfv+XFO/4Ui/QgtlXTz14hvGKb3wIw5m7Q0cii55zuzSa7TRY1sGJY3hLPg FsA4kdpgvEO6goEFDztF+cKSSYE969XV91UOZcVUPyxzFDnPUmS2IKDnzdIfaeSllieL SdK50UtBYwaz0cvYrvXPmjN2/mIsSnyciy1eTjxVp536u7Njvq026BzVUV2ZZ7vYI7NA 7Bvfmd4Hf08GmraznspT7GKPbvrakrVeeGYGTlo+6xbmaSL8w9y0+dNWMzMqT0ej9UD3 79vdxCF7/p9DxHQpO7BvSEETrqcBrSsF06/dIvFJvVM58IcxfpIDsB+e+owWL77oTVMz wGvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c7Ovutsp; 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 k33si4401613pld.374.2019.01.18.03.11.17; Fri, 18 Jan 2019 03:11:34 -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=c7Ovutsp; 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 S1727037AbfARLKM (ORCPT + 99 others); Fri, 18 Jan 2019 06:10:12 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33507 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725982AbfARLKL (ORCPT ); Fri, 18 Jan 2019 06:10:11 -0500 Received: by mail-wr1-f66.google.com with SMTP id c14so14605263wrr.0; Fri, 18 Jan 2019 03:10:10 -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=i9Jz6mADl+SAlcH6gEeO3JwA6zj1h7g3kXeXLvf3Qh4=; b=c7OvutspFyLKMOanYTqFOhtdpU7ojaNNVvJVsg4XAm+1GYeuC7XX9Xu+fKTrDD6Huu HJQC3lrph0tk/EsV0XUd1Uf2YVoCFHoBspiiB6qOnYfiJisjF8hdIXAyPe5z0IHOoERf d+ZVQ0rTBjEHLZ350xYAXGHdc5PO3yHvLCpmBlgXIoF5PgovBkJrD0JFOG83e9eW/pQo 0UN0MNfCoR8n6vvDrnB2feSg8BPvSiNlewlZInoDo6eYsvbChrGuKDovg3aeWkKNVf2/ g7lCxkVgPp/ab1W9Eygu/cE19L/uL89L1PKjNyjA2ytquXYqi+lv1HgVlHIxy9u+eEsx nYZQ== 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=i9Jz6mADl+SAlcH6gEeO3JwA6zj1h7g3kXeXLvf3Qh4=; b=MlUOETbAVi3c5ofXvwmaWp0ofaMdGFBlB29/etjtZF3+pApi0gXtLY5RmzJTD2yXPr 7PjrVadXh3382dJLeCvV5YNrx1sdqLIvv/xSPrXqOlEHbkgedZ9ydA+u1S+jXas3le2u TONZhWp0bP5lQrxhSyFA0gmLVnRHaaWLX8PbRoXaLNmJlzmA+zuHOWD0QI4Eykh+CDGz KQs1gaHyUUoO3rtYmXlaK76OxC37I/Vm+uZhq1TB0A6PyUr5JCQ1SnT+ykvt/7IE1QAn EhNNMP2bAl7mHUYdJKqC4A0E0bMPFOjuBMXHCsK+Sxo4xtp7+Ay8mhXEqZF8VmaI14Lz cKTQ== X-Gm-Message-State: AJcUukdF/d56bvffC8HizOjy+FonSMjpkIBtLzk6T8USeBwZOuQ9jw53 DKPnklcpkYySGGLJddYL4g== X-Received: by 2002:adf:dcd0:: with SMTP id x16mr15760897wrm.143.1547809809868; Fri, 18 Jan 2019 03:10:09 -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 o81sm69625423wmd.10.2019.01.18.03.10.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 03:10:09 -0800 (PST) Date: Fri, 18 Jan 2019 12:10:08 +0100 From: Andrea Righi To: Paolo Valente Cc: Tejun Heo , Li Zefan , Johannes Weiner , Jens Axboe , Vivek Goyal , Josef Bacik , 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: <20190118111008.GA25335@xps-13> References: <20190118103127.325-1-righi.andrea@gmail.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 12:04:17PM +0100, Paolo Valente wrote: > > > > Il giorno 18 gen 2019, alle ore 11:31, Andrea Righi ha scritto: > > > > 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. > > > > = Proposed solution = > > > > The main idea of this controller is to split I/O measurement and I/O > > throttling: I/O is measured at the block layer for READS, at page cache > > (dirty pages) for WRITEs, and processes are limited while they're > > generating I/O at the VFS level, based on the measured I/O. > > > > Hi Andrea, > what the about the case where two processes are dirtying the same > pages? Which will be charged? > > Thanks, > Paolo Hi Paolo, in this case only the first one will be charged for the I/O activity (the one that changes a page from clean to dirty). This is probably not totally fair in some cases, but I think it's a good compromise, at the end rewriting the same page over and over while it's already dirty doesn't actually generate I/O activity, until the page is flushed back to disk. Obviously I'm open to other better ideas and suggestions. Thanks! -Andrea