Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp874692ybn; Wed, 25 Sep 2019 08:59:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXKyRq8yHJIiNbTq5hV/liIkLLkYGfdmiSNG9+KQV5HfZBKD6fW4CS3s5dYd+0GhdYy4gF X-Received: by 2002:a17:907:41db:: with SMTP id og19mr4789084ejb.307.1569427171671; Wed, 25 Sep 2019 08:59:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569427171; cv=none; d=google.com; s=arc-20160816; b=FhT3qTJZRVuV5OzCqSa7nKkJIfs2L8n5X5KyWdDVl/jhPLXSkuMo25XXS/bBfHS9PD jmAEofQBXHIxv/DiFbamn9yejfncpNJSwC/rRdKsOXbJ7kXbBKVuF8zDh+IpeMK2RVr+ Lndz5Aip57ZM4FF3tZgevnZw9xbApajj1WdFchcr3vsN/WpNYHmYLHROTCBXXMvbCnPB MambRJNw+DYjLqVeguJyFovoezfgmTLkC/bfzi/c0cRqEWWW+3kzZ8cdsDUnrhJYMzCT BE7DX6b4d0h5o3ZyMtCZyHIo1F7xW6ebEfvVEL6tStIIq+Q95d7VCjGOlgNFDxYU99zs 3Ecw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=IXcoUvIXF995IhaYye9MIGZQTDEPJgvaMrA8NeaSgm4=; b=pAED2DrDgPvPHHa6dNkF+/QmsPDdVythQVUHJ4XFFoseqCaz63HWtNlCt7EPG208DN Vkh9ZsvsBthfyLISFQIdnsrZKipwe7MuOJPcloJ+vQ0Pwo3PDZDvcVWAgMyMtoWU9qJZ NMfY+ZqAsKGznyfeMRnv3eaqVhfK73y0LViyPMBKbEu74kKNot17RwvViChH8yz/wRua 6Cc0qGeRc0xABcaiKVjCjMOgT0J00IYgLzsR3g8uNyHakws8q8xj4jA/hOnxIaHwVx9q ityry6fnX30ZgIb13U/eIA0jz1588ejqNxIiF1wKOp7Xc2cBbZUKwN0n4f/NVHzlordC kYlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=IeVleuB0; 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=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e18si3407779eds.68.2019.09.25.08.59.07; Wed, 25 Sep 2019 08:59:31 -0700 (PDT) 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=@yandex-team.ru header.s=default header.b=IeVleuB0; 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=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387889AbfIWQGA (ORCPT + 99 others); Mon, 23 Sep 2019 12:06:00 -0400 Received: from forwardcorp1p.mail.yandex.net ([77.88.29.217]:38112 "EHLO forwardcorp1p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387866AbfIWQGA (ORCPT ); Mon, 23 Sep 2019 12:06:00 -0400 Received: from mxbackcorp1j.mail.yandex.net (mxbackcorp1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::162]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id 0B7432E1493; Mon, 23 Sep 2019 19:05:57 +0300 (MSK) Received: from myt5-6212ef07a9ec.qloud-c.yandex.net (myt5-6212ef07a9ec.qloud-c.yandex.net [2a02:6b8:c12:3b2d:0:640:6212:ef07]) by mxbackcorp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 5DFzfrorlR-5uE8IrZq; Mon, 23 Sep 2019 19:05:57 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1569254757; bh=IXcoUvIXF995IhaYye9MIGZQTDEPJgvaMrA8NeaSgm4=; h=In-Reply-To:Message-ID:From:Date:References:To:Subject:Cc; b=IeVleuB0zPc0Ac/Wy3UG/+YJdbPerDRmG86tkmfYqhk6L4jnUbAL9UAlFmedok+Ee BHflD7BFVXSvcRZ9KDAbKF/exr68OX1tyy5z8z6v33qaYDuFel1WGJl0mOlA19dKWp HC665E7zR8I0cHJLG5taFdeOEfoQNaLaKrItvI5w= Authentication-Results: mxbackcorp1j.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:3d4d:a9cb:ef29:4bb1]) by myt5-6212ef07a9ec.qloud-c.yandex.net (nwsmtp/Yandex) with ESMTPSA id YPqHsg4d3K-5uIK39Dl; Mon, 23 Sep 2019 19:05:56 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: Re: [PATCH v2] mm: implement write-behind policy for sequential file writes To: Jens Axboe , Linus Torvalds Cc: linux-fsdevel , Linux-MM , Linux Kernel Mailing List , Michal Hocko , Dave Chinner , Mel Gorman , Johannes Weiner , Tejun Heo References: <156896493723.4334.13340481207144634918.stgit@buzz> <1882a6da-a599-b820-6257-11bbac02b220@kernel.dk> From: Konstantin Khlebnikov Message-ID: Date: Mon, 23 Sep 2019 19:05:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1882a6da-a599-b820-6257-11bbac02b220@kernel.dk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/09/2019 18.36, Jens Axboe wrote: > On 9/20/19 5:10 PM, Linus Torvalds wrote: >> On Fri, Sep 20, 2019 at 4:05 PM Linus Torvalds >> wrote: >>> >>> >>> Now, I hear you say "those are so small these days that it doesn't >>> matter". And maybe you're right. But particularly for slow media, >>> triggering good streaming write behavior has been a problem in the >>> past. >> >> Which reminds me: the writebehind trigger should likely be tied to the >> estimate of the bdi write speed. >> >> We _do_ have that avg_write_bandwidth thing in the bdi_writeback >> structure, it sounds like a potentially good idea to try to use that >> to estimate when to do writebehind. >> >> No? > > I really like the feature, and agree it should be tied to the bdi write > speed. How about just making the tunable acceptable time of write behind > dirty? Eg if write_behind_msec is 1000, allow 1s of pending dirty before > starting writbeack. > I haven't digged into it yet. But IIRR writeback speed estimation has some problems: There is no "slow start" - initial speed is 100MiB/s. This is especially bad for slow usb disks - right after plugging we'll accumulate too much dirty cache before starting writeback. And I've seen problems with cgroup-writeback: each cgroup has own estimation, doesn't work well for short-living cgroups.