linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Viro <viro@math.psu.edu>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] prune_icache() fix
Date: Sat, 28 Apr 2001 22:09:40 -0400 (EDT)	[thread overview]
Message-ID: <Pine.GSO.4.21.0104282201130.321-100000@weyl.math.psu.edu> (raw)

	Look and enjoy. If prune_icache() doesn't shoot its goal, it
tries to sync some dirty inodes and look for freeable ones one more
time. The sad thing being, counter is not reset on the second pass.
I.e. you end up with nr_unused decremented by 2 * freed_at_the_first_pass +
freed_at_the_second_pass.
	Result: underestimated nr_unused. Since that's what we use for
determining the pressure on icache...

	Seeing negative number in /proc/sys/fs/inode-nr is... well, an
interesting experience.
 
	Please, apply the patch below.
								Al
PS: _Ouch_. 6 hours of hunting for this one.

diff -urN S4/fs/inode.c S4-prune_icache/fs/inode.c
--- S4/fs/inode.c	Sat Apr 28 02:12:56 2001
+++ S4-prune_icache/fs/inode.c	Sat Apr 28 21:37:25 2001
@@ -612,12 +612,13 @@
 {
 	LIST_HEAD(list);
 	struct list_head *entry, *freeable = &list;
-	int count = 0, synced = 0;
+	int count, synced = 0;
 	struct inode * inode;
 
 	spin_lock(&inode_lock);
 
 free_unused:
+	count = 0;
 	entry = inode_unused.prev;
 	while (entry != &inode_unused)
 	{


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

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.GSO.4.21.0104282201130.321-100000@weyl.math.psu.edu \
    --to=viro@math.psu.edu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=torvalds@transmeta.com \
    /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;
as well as URLs for NNTP newsgroup(s).