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.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 A720DC04EBF for ; Mon, 23 Sep 2019 14:52:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 694AD20835 for ; Mon, 23 Sep 2019 14:52:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f5PeulYO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 694AD20835 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 134CB6B000A; Mon, 23 Sep 2019 10:52:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10BF86B000C; Mon, 23 Sep 2019 10:52:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 021E46B000D; Mon, 23 Sep 2019 10:52:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0152.hostedemail.com [216.40.44.152]) by kanga.kvack.org (Postfix) with ESMTP id D5B386B000A for ; Mon, 23 Sep 2019 10:52:49 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 7E6D699B5 for ; Mon, 23 Sep 2019 14:52:49 +0000 (UTC) X-FDA: 75966477258.16.print69_35b424bca772a X-HE-Tag: print69_35b424bca772a X-Filterd-Recvd-Size: 5021 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Sep 2019 14:52:48 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id y189so15694258qkc.3 for ; Mon, 23 Sep 2019 07:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Cihsrcy+ZQVZz5JC0vGFiq3Z/PSPrpGVXhPvhqb+rOY=; b=f5PeulYORxhz3WOQ1pPfWQefeKSMX3DPFUhK6IX+3ZFGl5J4YZs+OspShWQzSTKSva iMCdV8LoKrybDSHIBYC3Rfql3TW5h7dtClAKrcf1+r1YFgdmM0IFmundcDdlaQYW09JR EfnmvcJCzdsdjBdbl5HsRYQffRHm86zVj/QIDDNc32WrkBax+kAk0j2ZBqfADL0CoxHl b45EfOJnUZKMZ9yNtraikYrWb8G12pXoUiUZ9FfYIDeDXtStUF9BTGl4gfSIqG0x1/od q9T2f9Gf4zu60KYNVq7TTAPX40S27yxar+7oXy1wO86A9nyO0PSPXfdJMU1eRHxs6pU2 SOAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Cihsrcy+ZQVZz5JC0vGFiq3Z/PSPrpGVXhPvhqb+rOY=; b=S6CckrznqutgNkvE0epNAlD5kBKPRc8OXrQWy8UPkrkjiBiPEQ0H/OOf2LVSOf6vkX +hqgUJnl8fSH3PkIKACyvTJUtv8dxodchUB0SgHsZhZyDMs7QMjuam05OIVybTr06PO+ 9hMRNNOFn1am6KmCPenQuoN94h1zUg+JIWmS0EmzJl9knLEIEZePoS6HqMs2boOKAYcX NiIESIFI9KzjFpn44hbYuGiv/ryg6vl0GPdkyq4SRMUjihBk+SxvPbyOIRyIvGB28pDF GzoMb4TCos+r5C5ZYNLrK3WcwuHEy5xHXApi/PXHVOLlEiQG99/jjZQYvqkKR29lPDqW e3Qw== X-Gm-Message-State: APjAAAWiCNnCAz1dfQKFhAf9OLOMquZ9P/TfwT46gJF0U8yyBT+L03g8 98x/mtOVu2mMXII5YitrZtk= X-Google-Smtp-Source: APXvYqy7dWYRYJUZoj7yaS2c2MFY0Vo92w266qDfaXXxHEbj9rKr3hlKotaEugAkVtOD0VsMg19YpQ== X-Received: by 2002:a37:6fc1:: with SMTP id k184mr153829qkc.237.1569250368172; Mon, 23 Sep 2019 07:52:48 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::1:83ca]) by smtp.gmail.com with ESMTPSA id u39sm6397581qtj.34.2019.09.23.07.52.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Sep 2019 07:52:46 -0700 (PDT) Date: Mon, 23 Sep 2019 07:52:42 -0700 From: Tejun Heo To: Konstantin Khlebnikov Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jens Axboe , Michal Hocko , Dave Chinner , Mel Gorman , Johannes Weiner , Linus Torvalds Subject: Re: [PATCH v2] mm: implement write-behind policy for sequential file writes Message-ID: <20190923145242.GF2233839@devbig004.ftw2.facebook.com> References: <156896493723.4334.13340481207144634918.stgit@buzz> <875f3b55-4fe1-e2c3-5bee-ca79e4668e72@yandex-team.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875f3b55-4fe1-e2c3-5bee-ca79e4668e72@yandex-team.ru> User-Agent: Mutt/1.5.21 (2010-09-15) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hello, Konstantin. On Fri, Sep 20, 2019 at 10:39:33AM +0300, Konstantin Khlebnikov wrote: > With vm.dirty_write_behind 1 or 2 files are written even faster and Is the faster speed reproducible? I don't quite understand why this would be. > during copying amount of dirty memory always stays around at 16MiB. The following is the test part of a slightly modified version of your test script which should run fine on any modern systems. for mode in 0 1; do if [ $mode == 0 ]; then prefix='' else prefix='systemd-run --user --scope -p MemoryMax=64M' fi echo COPY time $prefix cp -r dummy copy grep Dirty /proc/meminfo echo SYNC time sync rm -fr copy done and the result looks like the following. $ ./test-writebehind.sh SIZE 3.3G dummy COPY real 0m2.859s user 0m0.015s sys 0m2.843s Dirty: 3416780 kB SYNC real 0m34.008s user 0m0.000s sys 0m0.008s COPY Running scope as unit: run-r69dca5326a9a435d80e036435ff9e1da.scope real 0m32.267s user 0m0.032s sys 0m4.186s Dirty: 14304 kB SYNC real 0m1.783s user 0m0.000s sys 0m0.006s This is how we are solving the massive dirtier problem. It's easy, works pretty well and can easily be tailored to the specific requirements. Generic write-behind would definitely have other benefits and also a bunch of regression possibilities. I'm not trying to say that write-behind isn't a good idea but it'd be useful to consider that a good portion of the benefits can already be obtained fairly easily. Thanks. -- tejun