Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1693942

Re: [PATCH v2 3/4] fs/dcache: Enable automatic pruning of negative dentries

From James Bottomley <James.Bottomley@HansenPartnership.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/4] fs/dcache: Enable automatic pruning of negative dentries
Date 2017-07-21 21:40 +0200
Message-ID <u5LWh-ru-3@gated-at.bofh.it> (permalink)
References <u5Gtz-5u8-5@gated-at.bofh.it> <u5GtA-5u8-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2017-07-21 at 09:43 -0400, Waiman Long wrote:
> Having a limit for the number of negative dentries does have an
> undesirable side effect that no new negative dentries will be allowed
> when the limit is reached. This will have performance implication
> for some types of workloads.

This really seems like a significant problem: negative dentries should
be released in strict lru order because the chances are no-one cares
about the least recently used one, but they may care about having the
most recently created one.

[...]
> @@ -323,6 +329,16 @@ static void __neg_dentry_inc(struct dentry
> *dentry)
>  	 */
>  	if (!cnt)
>  		dentry->d_flags |= DCACHE_KILL_NEGATIVE;
> +
> +	/*
> +	 * Initiate negative dentry pruning if free pool has less
> than
> +	 * 1/4 of its initial value.
> +	 */
> +	if (READ_ONCE(ndblk.nfree) < neg_dentry_nfree_init/4) {
> +		WRITE_ONCE(ndblk.prune_sb, dentry->d_sb);
> +		schedule_delayed_work(&prune_neg_dentry_work,
> +				      NEG_PRUNING_DELAY);
> +	}

So here, why not run the negative dentry shrinker synchronously to see
if we can shrink the cache and avoid killing the current negative
dentry.  If there are context problems doing that, we should at least
make the effort to track down the least recently used negative dentry
and mark that for killing instead.

James

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/4] fs/dcache: Limit # of negative dentries Waiman Long <longman@redhat.com> - 2017-07-21 15:50 +0200
  [PATCH v2 1/4] fs/dcache: Limit numbers of negative dentries Waiman Long <longman@redhat.com> - 2017-07-21 15:50 +0200
  [PATCH v2 2/4] fs/dcache: Report negative dentry number in dentry-state Waiman Long <longman@redhat.com> - 2017-07-21 15:50 +0200
  [PATCH v2 3/4] fs/dcache: Enable automatic pruning of negative dentries Waiman Long <longman@redhat.com> - 2017-07-21 15:50 +0200
    Re: [PATCH v2 3/4] fs/dcache: Enable automatic pruning of negative  dentries James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-07-21 21:40 +0200
      Re: [PATCH v2 3/4] fs/dcache: Enable automatic pruning of negative  dentries Waiman Long <longman@redhat.com> - 2017-07-21 22:20 +0200
        Re: [PATCH v2 3/4] fs/dcache: Enable automatic pruning of negative  dentries James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-07-22 01:10 +0200
          Re: [PATCH v2 3/4] fs/dcache: Enable automatic pruning of negative  dentries Waiman Long <longman@redhat.com> - 2017-07-24 18:00 +0200
  [PATCH v2 4/4] fs/dcache: Protect negative dentry pruning from racing with umount Waiman Long <longman@redhat.com> - 2017-07-21 15:50 +0200

csiph-web