All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org>
To: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
Cc: Andrea Arcangeli
	<aarcange-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Rik van Riel <riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Nick Piggin <npiggin-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>,
	Pavel Emelyanov <xemul-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Hugh Dickins <hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	James Bottomley
	<JBottomley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>,
	Dave Hansen
	<dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3 0/4] Per-container dcache limitation
Date: Wed, 17 Aug 2011 15:43:43 +1000	[thread overview]
Message-ID: <20110817054343.GM26978__9316.50470379299$1313560007$gmane$org@dastard> (raw)
In-Reply-To: <1313334832-1150-1-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>

On Sun, Aug 14, 2011 at 07:13:48PM +0400, Glauber Costa wrote:
> Hello,
> 
> This series is just like v2, except it addresses
> Eric's comments regarding percpu variables.
> 
> Let me know if there are further comments, and
> I'll promply address them as well. Otherwise,
> I feel this is ready for inclusion

Just out of couriousity, one thing I've noticed about dentries is
that in general at any given point in time most dentries are unused.
Under the workloads I'm testing, even when I have a million cached
dentries, I only have roughly 7,000 accounted as used.  That is, most
of the dentries in the system are on a LRU and accounted in
sb->s_nr_dentry_unused of their owner superblock.

So rather than introduce a bunch of new infrastructure to track the
number of dentries allocated, why not simply limit the number of
dentries allowed on the LRU? We already track that, and the shrinker
already operates on the LRU, so we don't really need any new
infrastructure.

The limiting can be lazily - we don't need to limit the growth of
dentries until we start to run out of memory. If the superblock
shrinker is aware of the limits, then when it gets called by memory
reclaim it can do all the work of reducing the number of items on
the LRU down to the threshold at that time.

IOWs, the limit has no impact on performance until memory is scarce,
at which time memory reclaim enforces the limits on LRU size and
clean up happens automatically.

This also avoids all the problems of setting a limit lower than the
number of active dentries required for the workload (i.e. avoids
spurious ENOMEM errors trying to allocate dentries), allows
overcommitment when memory is plentiful (which will benefit
performance) but it brings the caches back to defined limits when
memory is not plentiful (which solves the problem you are having).

That seems like a much better solution to me, because it doesn't
impact the normal working of workloads in the containers and avoids
having to work out what the correct minimum size of the cache for
each workload is. It's much easier to work out how many extra cached
dentries you want the container to be able to have when memory is
scarce...

What do you think?

Cheers,

Dave.

-- 
Dave Chinner
david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org

  parent reply	other threads:[~2011-08-17  5:43 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-14 15:13 [PATCH v3 0/4] Per-container dcache limitation Glauber Costa
2011-08-14 15:13 ` Glauber Costa
     [not found] ` <1313334832-1150-1-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-14 15:13   ` [PATCH v3 1/4] factor out single-shrinker code Glauber Costa
2011-08-14 15:13     ` Glauber Costa
2011-08-15  6:43     ` Dave Chinner
     [not found]     ` <1313334832-1150-2-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-15  6:43       ` Dave Chinner
2011-08-14 15:13   ` [PATCH v3 2/4] Keep nr_dentry per super block Glauber Costa
2011-08-14 15:13     ` Glauber Costa
2011-08-14 17:38     ` Eric Dumazet
2011-08-14 17:38       ` Eric Dumazet
     [not found]     ` <1313334832-1150-3-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-14 17:38       ` Eric Dumazet
2011-08-14 15:13   ` [PATCH v3 3/4] limit nr_dentries per superblock Glauber Costa
2011-08-14 15:13     ` Glauber Costa
     [not found]     ` <1313334832-1150-4-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-15  7:03       ` Dave Chinner
2011-08-15  7:12       ` Pekka Enberg
2011-08-15  7:03     ` Dave Chinner
2011-08-15  7:12     ` Pekka Enberg
     [not found]       ` <CAOJsxLFYD9DkEU5R+9fZr-uaznteP8-BUC_Ti+FnNFqtbOCHSw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-15 10:46         ` Dave Chinner
2011-08-15 10:46       ` Dave Chinner
2011-08-15 10:58         ` Pekka Enberg
     [not found]           ` <CAOJsxLGFJmqO-W=itQbO4Mh4DxSD4wrHOC8gQ5bWL5aE1YYeQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-15 11:05             ` Pavel Emelyanov
2011-08-15 11:05           ` Pavel Emelyanov
2011-08-15 11:05             ` Pavel Emelyanov
2011-08-15 11:14             ` Pekka Enberg
2011-08-15 11:14               ` Pekka Enberg
2011-08-15 11:32               ` Pavel Emelyanov
2011-08-15 11:32                 ` Pavel Emelyanov
2011-08-15 11:55                 ` Pekka Enberg
2011-08-15 11:55                   ` Pekka Enberg
2011-08-15 12:12                   ` Pavel Emelyanov
2011-08-15 12:12                     ` Pavel Emelyanov
2011-08-15 12:23                     ` Pekka Enberg
2011-08-15 12:23                       ` Pekka Enberg
2011-08-15 12:37                       ` Pavel Emelyanov
2011-08-15 12:37                         ` Pavel Emelyanov
     [not found]                       ` <CAOJsxLEVfGrzUQv0fOpOyw3AaOLOHcWbvLJL1NdrHS6M2j5o1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-15 12:37                         ` Pavel Emelyanov
     [not found]                     ` <4E490D47.8050105-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-15 12:23                       ` Pekka Enberg
     [not found]                   ` <CAOJsxLErFcxuuqnWkRbOAHEFbeGrKp3YMZ-144=m16oBXCHJ2g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-15 12:12                     ` Pavel Emelyanov
     [not found]                 ` <4E4903C1.9050207-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-15 11:55                   ` Pekka Enberg
     [not found]               ` <CAOJsxLFjZffC9i5kQsBWjGy3eWdj3VMB5awz=yPcwgeKb5BG0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-15 11:32                 ` Pavel Emelyanov
2011-08-16  2:11                 ` Dave Chinner
2011-08-16  2:11               ` Dave Chinner
2011-08-16  2:11                 ` Dave Chinner
     [not found]             ` <4E48FD8A.90401-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-15 11:14               ` Pekka Enberg
2011-08-15 10:58         ` Pekka Enberg
2011-08-14 15:13   ` [PATCH v3 4/4] parse options in the vfs level Glauber Costa
2011-08-14 15:13     ` Glauber Costa
2011-08-14 15:39     ` Vasiliy Kulikov
2011-08-15  0:03       ` Glauber Costa
2011-08-15  0:03       ` Glauber Costa
     [not found]     ` <1313334832-1150-5-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-14 15:39       ` Vasiliy Kulikov
2011-08-15  7:09       ` Dave Chinner
2011-08-15  7:09     ` Dave Chinner
2011-08-24  2:19       ` Glauber Costa
2011-08-24  2:19       ` Glauber Costa
2011-08-17  5:43   ` Dave Chinner [this message]
2011-08-17  5:43 ` [PATCH v3 0/4] Per-container dcache limitation Dave Chinner
2011-08-17 18:44   ` Glauber Costa
2011-08-17 18:44   ` Glauber Costa
2011-08-18  1:27     ` Dave Chinner
2011-08-18  1:27       ` Dave Chinner
2011-08-22 11:42       ` Glauber Costa
2011-08-22 11:42       ` Glauber Costa
2011-08-22 11:42         ` Glauber Costa
     [not found]     ` <4E4C0C25.3-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-18  1:27       ` Dave Chinner

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='20110817054343.GM26978__9316.50470379299$1313560007$gmane$org@dastard' \
    --to=david-fqsqvqoi3ljby3ivrkzq2a@public.gmane.org \
    --cc=JBottomley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
    --cc=aarcange-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
    --cc=hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=npiggin-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
    --cc=xemul-bzQdu9zFT3WakBO8gow8eQ@public.gmane.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 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.