public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Dave Chinner <dgc@sgi.com>
Cc: lord@xfs.org, linux-kernel@vger.kernel.org, linux-xfs@oss.sgi.com
Subject: Re: Major XFS problems...
Date: Thu, 9 Sep 2004 01:10:07 -0700	[thread overview]
Message-ID: <20040909011007.42f98641.akpm@osdl.org> (raw)
In-Reply-To: <20040909165255.C2738@melbourne.sgi.com>

Dave Chinner <dgc@sgi.com> wrote:
>
> If the dentry_stat.nr_unused is less than 100, then we'll return 0
>  due to integer division (99/100 = 0), and the shrinker calculations
>  will see this as a slab that does not need shrinking because:
> 
>  185         list_for_each_entry(shrinker, &shrinker_list, list) {
>  186                 unsigned long long delta;
>  187 
>  188                 delta = (4 * scanned) / shrinker->seeks;
>  189                 delta *= (*shrinker->shrinker)(0, gfp_mask);
>                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  190                 do_div(delta, lru_pages + 1);
>  191                 shrinker->nr += delta;
>  192                 if (shrinker->nr < 0)
>  193                         shrinker->nr = LONG_MAX;        /* It wrapped! */
>  194 
>  195                 if (shrinker->nr <= SHRINK_BATCH)
>  196                         continue;
> 
>  because we returned zero and therefore delta becomes zero and
>  shrinker->nr never gets larger than SHRINK_BATCH.
> 
>  Hence in low memory conditions when you've already reaped most of
>  the unused dentries, you can't free up the last 99 unused dentries.
>  Maybe this is intentional (anyone?) because there isn't very much to
>  free up in this case, but some memory freed is better than none when
>  you have nothing at all left.

Yes, it's intentional.  Or at least, it's known-and-not-cared about ;)

The last 99 unused dentries will not be reaped.

  reply	other threads:[~2004-09-09  8:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040908133954.GB390@unthought.net>
     [not found] ` <20040909074533.B3958243@wobbly.melbourne.sgi.com>
     [not found]   ` <413F823F.3020507@xfs.org>
2004-09-09  6:52     ` Major XFS problems Dave Chinner
2004-09-09  8:10       ` Andrew Morton [this message]
     [not found] <2Ca3I-2kY-7@gated-at.bofh.it>
     [not found] ` <2Cdl9-4Pc-65@gated-at.bofh.it>
2004-09-11  9:21   ` ADH
2004-09-08 15:24 Piszcz, Justin Michael
  -- strict thread matches above, loose matches on Subject: below --
2004-09-08 13:07 Piszcz, Justin Michael
2004-09-08 13:26 ` Jakob Oestergaard
2004-09-08 12:35 Jakob Oestergaard
2004-09-08 15:04 ` Anando Bhattacharya
2004-09-08 15:44   ` Jakob Oestergaard
2004-09-08 16:36     ` Greg Banks
2004-09-08 17:30       ` Jakob Oestergaard
2004-09-09  2:42         ` Greg Banks
2004-09-08 19:06       ` Bill Davidsen
2004-09-09  3:23         ` Greg Banks
2004-09-09 14:00       ` Jakob Oestergaard
2004-09-10  2:40         ` Greg Banks
2004-09-10  3:04           ` Kyle Moffett
2004-09-10  3:24             ` Greg Banks
2004-09-13  7:29         ` Jakob Oestergaard
2004-09-08 16:16 ` Jan-Frode Myklebust
2004-09-08 21:40 ` Nathan Scott
2004-09-08 23:22   ` Jakob Oestergaard
2004-09-08 23:42     ` Nathan Scott
2004-09-09 12:11       ` Jakob Oestergaard
2004-09-09 18:09         ` Chris Wedgwood
2004-09-11 11:39 ` Grzegorz Piotr Jaskiewicz
2004-09-11 13:03   ` Bjoern Brauel
2004-09-11 13:38   ` Anton Blanchard
2004-09-11 14:54     ` Miquel van Smoorenburg
2004-09-11 18:20     ` Grzegorz Piotr Jaskiewicz
2004-09-11 13:58 ` Clemens Schwaighofer

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=20040909011007.42f98641.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dgc@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@oss.sgi.com \
    --cc=lord@xfs.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