public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Fix knfsd readahead cache in 2.4.15
@ 2001-11-26 13:50 Trond Myklebust
  2001-11-26 23:35 ` Neil Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Trond Myklebust @ 2001-11-26 13:50 UTC (permalink / raw)
  To: Neil Brown; +Cc: NFS maillist, Linux Kernel

Hi Neil,

  The following patch fixes a bug in the knfsd readahead code. The
memset() that is referenced in the patch below is clobbering the
pointer to the next list element (ra->p_next), thus reducing the inode
readahead cache to 1 entry upon the very first call to
nfsd_get_raparms().

  BTW: looking at the choice of cache size. Why is this set to number
of threads * 2? Isn't it better to have a minimum cache size? After
all, the fact that I have 8 threads running does not at all reflect
the number of inodes that I might have open on my various clients...

Cheers,
   Trond

--- linux-2.4.16-pre1/fs/nfsd/vfs.c.orig	Fri Oct  5 21:23:53 2001
+++ linux-2.4.16-pre1/fs/nfsd/vfs.c	Mon Nov 26 14:32:09 2001
@@ -560,9 +560,13 @@
 		return NULL;
 	rap = frap;
 	ra = *frap;
-	memset(ra, 0, sizeof(*ra));
 	ra->p_dev = dev;
 	ra->p_ino = ino;
+	ra->p_reada = 0;
+	ra->p_ramax = 0;
+	ra->p_raend = 0;
+	ra->p_ralen = 0;
+	ra->p_rawin = 0;
 found:
 	if (rap != &raparm_cache) {
 		*rap = ra->p_next;

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-11-28 21:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-26 13:50 Fix knfsd readahead cache in 2.4.15 Trond Myklebust
2001-11-26 23:35 ` Neil Brown
2001-11-26 23:53   ` David S. Miller
2001-11-27  0:05     ` David S. Miller
2001-11-27  0:29     ` Neil Brown
2001-11-27  0:33       ` David S. Miller
2001-11-27  1:25     ` [NFS] " Benjamin LaHaise
2001-11-27 13:54       ` Trond Myklebust
2001-11-27 15:23         ` Benjamin LaHaise
2001-11-27 15:44           ` Trond Myklebust
2001-11-28 21:03             ` Benjamin LaHaise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox