linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: Tejun Heo <tj@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Michal Hocko <mhocko@suse.com>,
	Dave Chinner <david@fromorbit.com>, Mel Gorman <mgorman@suse.de>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v2] mm: implement write-behind policy for sequential file writes
Date: Mon, 23 Sep 2019 18:06:46 +0300	[thread overview]
Message-ID: <ed5d930c-88c6-c8e4-4a6c-529701caa993@yandex-team.ru> (raw)
In-Reply-To: <20190923145242.GF2233839@devbig004.ftw2.facebook.com>

On 23/09/2019 17.52, Tejun Heo wrote:
> 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.

Writing to disk simply starts earlier.

> 
>> 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.
> 

I'm afraid this could end badly if each simple task like file copying
will require own systemd job and container with manual tuning.

  reply	other threads:[~2019-09-23 15:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20  7:35 [PATCH v2] mm: implement write-behind policy for sequential file writes Konstantin Khlebnikov
2019-09-20  7:39 ` Konstantin Khlebnikov
2019-09-23 14:52   ` Tejun Heo
2019-09-23 15:06     ` Konstantin Khlebnikov [this message]
2019-09-23 15:19       ` Tejun Heo
2019-09-24  7:39       ` Dave Chinner
2019-09-24  9:00         ` Konstantin Khlebnikov
2019-09-25  7:18           ` Dave Chinner
2019-09-25  8:15             ` Konstantin Khlebnikov
2019-09-25 23:25               ` Dave Chinner
2019-09-25 12:54             ` Theodore Y. Ts'o
2019-09-24 19:08         ` Linus Torvalds
2019-09-25  8:00           ` Dave Chinner
2019-09-20 23:05 ` Linus Torvalds
2019-09-20 23:10   ` Linus Torvalds
2019-09-23 15:36     ` Jens Axboe
2019-09-23 16:05       ` Konstantin Khlebnikov
2019-09-24  9:29   ` Konstantin Khlebnikov
2019-09-22  7:47 ` kbuild test robot
2019-09-23  0:36 ` [mm] e0e7df8d5b: will-it-scale.per_process_ops -7.3% regression kernel test robot
2019-09-23 19:11   ` Konstantin Khlebnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed5d930c-88c6-c8e4-4a6c-529701caa993@yandex-team.ru \
    --to=khlebnikov@yandex-team.ru \
    --cc=axboe@kernel.dk \
    --cc=david@fromorbit.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).