Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Use a pool cache for namei buffers -- it's faster to all...



details:   https://anonhg.NetBSD.org/src/rev/36a09eae416f
branches:  trunk
changeset: 516162:36a09eae416f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Oct 17 23:33:29 2001 +0000

description:
Use a pool cache for namei buffers -- it's faster to allocate from
a pool cache than a pool.

diffstat:

 sys/kern/vfs_init.c   |  5 +++--
 sys/kern/vfs_lookup.c |  3 ++-
 sys/sys/namei.h       |  7 ++++---
 3 files changed, 9 insertions(+), 6 deletions(-)

diffs (61 lines):

diff -r 7a79e3d9e791 -r 36a09eae416f sys/kern/vfs_init.c
--- a/sys/kern/vfs_init.c       Wed Oct 17 23:28:19 2001 +0000
+++ b/sys/kern/vfs_init.c       Wed Oct 17 23:33:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_init.c,v 1.18 2001/01/22 12:17:41 jdolecek Exp $   */
+/*     $NetBSD: vfs_init.c,v 1.19 2001/10/17 23:33:29 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -324,10 +324,11 @@
        int i;
 
        /*
-        * Initialize the namei pathname buffer pool.
+        * Initialize the namei pathname buffer pool and cache.
         */
        pool_init(&pnbuf_pool, MAXPATHLEN, 0, 0, 0, "pnbufpl",
             0, pool_page_alloc_nointr,  pool_page_free_nointr, M_NAMEI);
+       pool_cache_init(&pnbuf_cache, &pnbuf_pool, NULL, NULL, NULL);
 
        /*
         * Initialize the vnode table
diff -r 7a79e3d9e791 -r 36a09eae416f sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c     Wed Oct 17 23:28:19 2001 +0000
+++ b/sys/kern/vfs_lookup.c     Wed Oct 17 23:33:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_lookup.c,v 1.36 2001/09/08 02:02:04 christos Exp $ */
+/*     $NetBSD: vfs_lookup.c,v 1.37 2001/10/17 23:33:29 thorpej Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -59,6 +59,7 @@
 #endif
 
 struct pool pnbuf_pool;                /* pathname buffer pool */
+struct pool_cache pnbuf_cache; /* pathname buffer cache */
 
 /*
  * Convert a pathname into a pointer to a locked inode.
diff -r 7a79e3d9e791 -r 36a09eae416f sys/sys/namei.h
--- a/sys/sys/namei.h   Wed Oct 17 23:28:19 2001 +0000
+++ b/sys/sys/namei.h   Wed Oct 17 23:33:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: namei.h,v 1.22 2001/09/24 06:01:13 chs Exp $   */
+/*     $NetBSD: namei.h,v 1.23 2001/10/17 23:33:29 thorpej Exp $       */
 
 /*
  * Copyright (c) 1985, 1989, 1991, 1993
@@ -178,9 +178,10 @@
 #include <sys/pool.h>
 
 extern struct pool pnbuf_pool;         /* pathname buffer pool */
+extern struct pool_cache pnbuf_cache;  /* pathname buffer cache */
 
-#define        PNBUF_GET()     pool_get(&pnbuf_pool, PR_WAITOK)
-#define        PNBUF_PUT(pnb)  pool_put(&pnbuf_pool, (pnb))
+#define        PNBUF_GET()     pool_cache_get(&pnbuf_cache, PR_WAITOK)
+#define        PNBUF_PUT(pnb)  pool_cache_put(&pnbuf_cache, (pnb))
 
 int    namei __P((struct nameidata *ndp));
 int    lookup __P((struct nameidata *ndp));



Home | Main Index | Thread Index | Old Index