public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vasily Averin <vvs@sw.ru>
To: David Howells <dhowells@redhat.com>
Cc: Neil Brown <neilb@suse.de>, Jan Blunck <jblunck@suse.de>,
	Olaf Hering <olh@suse.de>, Balbir Singh <balbir@in.ibm.com>,
	Kirill Korotaev <dev@openvz.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	devel@openvz.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [Q] missing unused dentry in prune_dcache()?
Date: Thu, 26 Oct 2006 15:36:53 +0400	[thread overview]
Message-ID: <45409DD5.7050306@sw.ru> (raw)
In-Reply-To: <21393.1161786209@redhat.com>

Hello David

David Howells wrote:
> Vasily Averin <vvs@sw.ru> wrote:
>>>> The patch adds this dentry into tail of the dentry_unused list.
>>> I think that's reasonable.  I wonder if we can avoid removing it from the
>>> list in the first place, but I suspect it's less optimal.
>> Could you please explain this place in details, I do not understand why tail
>> of the list is better than head.  Also I do not understand why we should go
>> to out in this case. Why we cannot use next dentry in the list instead?
> 
> I meant adding it back into the list is reasonable; I didn't actually consider
> where you were adding it back.
> 
> So, given that the three ops that affect this are very unlikely to be happening
> at any one time, it's probably worth just slapping it at the head and ignoring
> it.  The main thing is that it's reinserted somewhere.

I don't like to insert this dentry into tail of list because of it prevents
shrink_dcache_memory. It finds "skipped" dentry at the tail of the list, does
not free it and goes to out without any progress.

Therefore I've removed break of cycle and insert this dentry to head of the
list. Theoretically it can lead to the second using of the same dentry, however
I do not think that it is a big problem.

Signed-off-by:	Vasily Averin <vvs@sw.ru>

--- linux-2.6.19-rc3/fs/dcache.c.prdch	2006-10-25 16:09:19.000000000 +0400
+++ linux-2.6.19-rc3/fs/dcache.c	2006-10-26 15:14:51.000000000 +0400
@@ -478,11 +478,9 @@ static void prune_dcache(int count, stru
 			up_read(s_umount);
 		}
 		spin_unlock(&dentry->d_lock);
-		/* Cannot remove the first dentry, and it isn't appropriate
-		 * to move it to the head of the list, so give up, and try
-		 * later
-		 */
-		break;
+		/* Inserting dentry to tail of the list leads to cycle */
+ 		list_add(&dentry->d_lru, &dentry_unused);
+		dentry_stat.nr_unused++;
 	}
 	spin_unlock(&dcache_lock);
 }


  reply	other threads:[~2006-10-26 11:37 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-25 12:30 [Q] missing unused dentry in prune_dcache()? Vasily Averin
2006-10-25 13:51 ` David Howells
2006-10-25 13:58   ` Vasily Averin
2006-10-25 14:23     ` David Howells
2006-10-26 11:36       ` Vasily Averin [this message]
2006-10-26 13:25         ` David Howells
2006-10-27  8:05           ` Vasily Averin
2006-10-27 10:42             ` David Howells
2006-10-27 11:50               ` Vasily Averin
2006-10-27 12:11                 ` David Howells
2006-10-27 13:47                   ` Vasily Averin
2006-10-27 14:29                     ` David Howells
2006-10-27 14:39                       ` Kirill Korotaev
2006-10-27 14:05                   ` [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list Vasily Averin
2006-10-27 18:06                     ` Andrew Morton
2006-10-30 14:24                       ` Vasily Averin
2006-10-30 15:08                         ` Eric Dumazet
2006-10-30 15:34                           ` Kirill Korotaev
2006-10-30 16:09                             ` Eric Dumazet
2006-10-30 15:14                       ` Kirill Korotaev
2006-10-30  4:24                     ` David Chinner
2006-10-30  6:28                       ` [Devel] " Kirill Korotaev
2006-10-31  4:38                         ` Neil Brown
2006-10-31 10:40                           ` David Howells
2006-11-01  6:32                             ` Neil Brown
2006-11-01 13:32                               ` Vasily Averin
2006-11-14  5:44                                 ` Neil Brown
2006-11-14  6:12                                   ` Vasily Averin
2006-10-31 13:08                           ` Vasily Averin
2006-11-01 10:55                           ` [Devel] " Kirill Korotaev
2006-11-14  4:51                             ` Neil Brown
2006-11-14  9:29                               ` David Howells
2006-10-27 13:42       ` [PATCH 2.6.19-rc3] VFS: missing unused dentry in prune_dcache() Vasily Averin
2006-10-27 14:24         ` David Howells
2006-10-26 11:49 ` [Q] missing unused dentry in prune_dcache()? Vasily Averin
2006-10-26 12:33   ` David Howells
2006-10-26 13:23   ` David Howells
2006-10-26 13:58     ` Vasily Averin
2006-10-26 14:07       ` David Howells
2006-10-27  6:32     ` Vasily Averin
2006-10-27  6:50       ` Vasily Averin
2006-10-27  9:36         ` David Howells
2006-10-31 13:24 ` [Q] missing ->d_delete() in shrink_dcache_for_umount()? Vasily Averin
2006-10-31 15:06   ` David Howells

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=45409DD5.7050306@sw.ru \
    --to=vvs@sw.ru \
    --cc=akpm@osdl.org \
    --cc=balbir@in.ibm.com \
    --cc=dev@openvz.org \
    --cc=devel@openvz.org \
    --cc=dhowells@redhat.com \
    --cc=jblunck@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=olh@suse.de \
    /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