public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcin Kowalski <kowalski@datrix.co.za>
To: davem@redhat.com, viro@math.psu.edu
Cc: jgarzik@mandrakesoft.com, adilger@turbolinux.com,
	linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: [CFT][PATCH] Re: Fwd: Re: memory usage - dentry_cache
Date: Thu, 12 Apr 2001 14:27:24 +0200	[thread overview]
Message-ID: <01041214272403.11986@webman> (raw)
In-Reply-To: <3AD550F0.8058FAA@mandrakesoft.com> <Pine.GSO.4.21.0104120257070.18135-100000@weyl.math.psu.edu> <15061.27388.843554.687422@pizda.ninka.net>
In-Reply-To: <15061.27388.843554.687422@pizda.ninka.net>

Hi

Regarding the patch ....

I don't have experience with the linux kernel internals but could this patch 
not lead to a run-loop condition as the only thing that can break our of the 
for(;;) loop is the tmp==&dentry_unused statement. So if the required number 
of dentries does not exist and this condition is not satisfied we would have 
an infinate loop... sorry if this is a silly question.

Also the comment >/* If the dentry was recently referenced, don't free it. 
*/<, the code inside is excuted if the DCACHE_REFERENCED flags are set and in 
the code is is reversing the DCACHE_REFERENCED flag on the dentry and adding 
it to the dentry_unsed list??? So a Refrenched entry is set Not Referenced 
and place in the unsed list?? I am unclear about that... is the comment 
correct or is my understanding lacking (which is very probable :-))..

TIA
MarCin


FYI >-------- 

 void prune_dcache(int count)
{
        spin_lock(&dcache_lock);
        for (;;) {
                struct dentry *dentry;
                struct list_head *tmp;
 
                tmp = dentry_unused.prev;
 
                if (tmp == &dentry_unused)
                        break;
                list_del_init(tmp);
                dentry = list_entry(tmp, struct dentry, d_lru);
 
                /* If the dentry was recently referenced, don't free it. */
                if (dentry->d_flags & DCACHE_REFERENCED) {
                        dentry->d_flags &= ~DCACHE_REFERENCED;
                        list_add(&dentry->d_lru, &dentry_unused);
                        continue;
                }
                dentry_stat.nr_unused--;
 
                /* Unused dentry with a count? */
                if (atomic_read(&dentry->d_count))
                        BUG();
 
                prune_one_dentry(dentry);
                if (!--count)
                        break;
        }
        spin_unlock(&dcache_lock);
}

-----------------------------
     Marcin Kowalski
     Linux/Perl Developer
     Datrix Solutions
     Cel. 082-400-7603
      ***Open Source Kicks Ass***
-----------------------------

  reply	other threads:[~2001-04-12 12:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-11 11:36 Fwd: Re: memory usage - dentry_cache Marcin Kowalski
2001-04-12  4:48 ` Fwd: Re: memory usage - dentry_cacheg Andreas Dilger
2001-04-12  5:45   ` Alexander Viro
2001-04-12  6:53     ` [PATCH] " Jeff Garzik
2001-04-12  7:10       ` [CFT][PATCH] Re: Fwd: Re: memory usage - dentry_cache Alexander Viro
2001-04-12  8:44         ` David S. Miller
2001-04-12 12:27           ` Marcin Kowalski [this message]
2001-04-12 12:43             ` Yoann Vandoorselaere
2001-04-12 13:54             ` Alexander Viro
2001-04-12 17:27           ` Andreas Dilger
2001-04-12  7:00     ` Fwd: Re: memory usage - dentry_cacheg Andreas Dilger
2001-04-12  7:27       ` [race][RFC] d_flags use Alexander Viro
2001-04-12  8:01         ` David S. Miller
2001-04-12  8:06           ` Alexander Viro
2001-04-12 11:46     ` [PATCH] Re: memory usage - dentry_cacheg Ed Tomlinson
2001-04-12 14:56       ` Rik van Riel
2001-04-12 15:12         ` Alexander Viro
2001-04-13  1:34           ` Ed Tomlinson
2001-04-13  2:03             ` Alexander Viro
2001-04-13  4:45               ` Ed Tomlinson
2001-04-13 13:36                 ` Ed Tomlinson
2001-04-12 15:30       ` Marcin Kowalski
2001-04-14  3:28         ` Paul
2001-04-12 14:34     ` [PATCH] Re: Fwd: " Jan Harkes
2001-04-12 14:50       ` Alexander Viro
2001-04-12 15:07         ` Rik van Riel
2001-04-12 15:27           ` Alexander Viro
2001-04-12 15:42             ` Alexander Viro
2001-04-12 15:48               ` Rik van Riel

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=01041214272403.11986@webman \
    --to=kowalski@datrix.co.za \
    --cc=adilger@turbolinux.com \
    --cc=davem@redhat.com \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /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