xfs
[Top] [All Lists]

Re: Major XFS problems...

To: Dave Chinner <dgc@xxxxxxx>
Subject: Re: Major XFS problems...
From: Andrew Morton <akpm@xxxxxxxx>
Date: Thu, 9 Sep 2004 01:10:07 -0700
Cc: lord@xxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxx
In-reply-to: <20040909165255.C2738@xxxxxxxxxxxxxxxxx>
References: <20040908133954.GB390@xxxxxxxxxxxxx> <20040909074533.B3958243@xxxxxxxxxxxxxxxxxxxxxxxx> <413F823F.3020507@xxxxxxx> <20040909165255.C2738@xxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
Dave Chinner <dgc@xxxxxxx> 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.


<Prev in Thread] Current Thread [Next in Thread>