All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: viro@ZenIV.linux.org.uk
Cc: jack@suse.cz, david@fromorbit.com, linux-fsdevel@vger.kernel.org,
	kernel-team@fb.com
Subject: Re: [PATCH] fs: don't set *REFERENCED on single use objects
Date: Thu, 27 Apr 2017 15:43:14 -0400	[thread overview]
Message-ID: <20170427194313.GA6299@destiny> (raw)
In-Reply-To: <1492545857-3695-1-git-send-email-jbacik@fb.com>

On Tue, Apr 18, 2017 at 04:04:17PM -0400, Josef Bacik wrote:
> By default we set DCACHE_REFERENCED and I_REFERENCED on any dentry or
> inode we create.  This is problematic as this means that it takes two
> trips through the LRU for any of these objects to be reclaimed,
> regardless of their actual lifetime.  With enough pressure from these
> caches we can easily evict our working set from page cache with single
> use objects.  So instead only set *REFERENCED if we've already been
> added to the LRU list.  This means that we've been touched since the
> first time we were accessed, and so more likely to need to hang out in
> cache.
> 
> To illustrate this issue I wrote the following scripts
> 
> https://github.com/josefbacik/debug-scripts/tree/master/cache-pressure
> 
> on my test box.  It is a single socket 4 core CPU with 16gib of RAM and
> I tested on an Intel 2tib NVME drive.  The cache-pressure.sh script
> creates a new file system and creates 2 6.5gib files in order to take up
> 13gib of the 16gib of ram with pagecache.  Then it runs a test program
> that reads these 2 files in a loop, and keeps track of how often it has
> to read bytes for each loop.  On an ideal system with no pressure we
> should have to read 0 bytes indefinitely.  The second thing this script
> does is start a fs_mark job that creates a ton of 0 length files,
> putting pressure on the system with slab only allocations.  On exit the
> script prints out how many bytes were read by the read-file program.
> The results are as follows
> 
> Without patch:
> /mnt/btrfs-test/reads/file1: total read during loops 27262988288
> /mnt/btrfs-test/reads/file2: total read during loops 27262976000
> 
> With patch:
> /mnt/btrfs-test/reads/file2: total read during loops 18640457728
> /mnt/btrfs-test/reads/file1: total read during loops 9565376512
> 
> This patch results in a 50% reduction of the amount of pages evicted
> from our working set.
> 
> Signed-off-by: Josef Bacik <jbacik@fb.com>

Hello Al,

Can we get this included in the upcoming merge window?  Thanks,

Josef

      parent reply	other threads:[~2017-04-27 19:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 20:04 [PATCH] fs: don't set *REFERENCED on single use objects Josef Bacik
2017-04-19  7:02 ` Jan Kara
2017-04-19 18:02   ` [PATCH] " Josef Bacik
2017-04-20 11:56     ` Jan Kara
2017-04-27 19:43 ` Josef Bacik [this message]

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=20170427194313.GA6299@destiny \
    --to=josef@toxicpanda.com \
    --cc=david@fromorbit.com \
    --cc=jack@suse.cz \
    --cc=kernel-team@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.