lkml.org 
[lkml]   [1999]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] fixed 2.2.1 inode-leakage due bogus design of the free_inodes algorithm [was [Re: [showstopper] Memory leak in 2.2.1]]
On Wed, 3 Feb 1999, Oleg Drokin wrote:

> I've got Andrea's IKD patch for 2.2.1 and here is the results (output of
> diff between "dosum" output before and after copying).

The IKD info is been very useful. I just noticed and fixed the leak. The
bug is a _design_ bug. There was a performance optimization that make tons
of sense in a dynamic (shrinkable) structure but it's completly bogus in a
not shrinkable sturcutre like the inode pool is.

Here the fix against 2.2.1:

Index: fs/inode.c
===================================================================
RCS file: /var/cvs/linux/fs/inode.c,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 inode.c
--- inode.c 1999/01/31 22:44:49 1.1.2.4
+++ linux/fs/inode.c 1999/02/04 00:40:17
@@ -331,9 +331,9 @@
{
struct list_head *tmp, *head = &inode_in_use;
LIST_HEAD(freeable);
- int found = 0, depth = goal << 1;
+ int found = 0;

- while ((tmp = head->prev) != head && depth--) {
+ while ((tmp = head->prev) != head) {
struct inode * inode = list_entry(tmp, struct inode, i_list);
list_del(tmp);
if (CAN_UNUSE(inode)) {

Apply it and be happy ;).


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.072 / U:1.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site