[Ocfs2-commits] mfasheh commits r1276 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Jul 15 17:58:49 CDT 2004
Author: mfasheh
Date: 2004-07-15 16:58:48 -0500 (Thu, 15 Jul 2004)
New Revision: 1276
Modified:
trunk/src/journal.c
trunk/src/ocfs.h
trunk/src/super.c
Log:
* give delayed lock contexts (ocfs_journal_lock) their own
slab. There's tons of them generated even for a simple kernel untar.
Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c 2004-07-15 21:51:17 UTC (rev 1275)
+++ trunk/src/journal.c 2004-07-15 21:58:48 UTC (rev 1276)
@@ -463,7 +463,7 @@
iput(lock->inode);
list_del(&(lock->lock_list));
handle->num_locks--;
- kfree(lock);
+ kmem_cache_free(OcfsGlobalCtxt.lock_cache, lock);
}
LOG_EXIT_STATUS(status);
@@ -957,7 +957,7 @@
LOG_ENTRY_ARGS("(id=%llu, type=%u, flags=%u, bh=%p)\n",
(unsigned long long)bh->b_blocknr, type, flags, bh);
- lock = ocfs_malloc(sizeof(ocfs_journal_lock));
+ lock = kmem_cache_alloc(OcfsGlobalCtxt.lock_cache, GFP_NOFS);
if (lock == NULL) {
LOG_ERROR_STR("Out of memory -- cannot add lock to release.");
LOG_ERROR_STATUS(-ENOMEM);
Modified: trunk/src/ocfs.h
===================================================================
--- trunk/src/ocfs.h 2004-07-15 21:51:17 UTC (rev 1275)
+++ trunk/src/ocfs.h 2004-07-15 21:58:48 UTC (rev 1276)
@@ -656,6 +656,7 @@
struct list_head osb_next; /* List of all volumes */
kmem_cache_t *inode_cache;
kmem_cache_t *extent_cache;
+ kmem_cache_t *lock_cache;
__u32 flags;
__s16 pref_node_num; /* preferred... osb has the real one */
ocfs_guid guid; /* uniquely identifies a node */
Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c 2004-07-15 21:51:17 UTC (rev 1275)
+++ trunk/src/super.c 2004-07-15 21:58:48 UTC (rev 1276)
@@ -783,6 +783,10 @@
OcfsGlobalCtxt.extent_cache = kmem_cache_create ("ocfs2_extent",
sizeof(ocfs_extent) + sizeof(void*), 0, SLAB_NO_REAP | SLAB_HWCACHE_ALIGN,
NULL, NULL);
+
+ OcfsGlobalCtxt.lock_cache = kmem_cache_create ("ocfs2_lock",
+ sizeof(ocfs_journal_lock), 0, SLAB_NO_REAP | SLAB_HWCACHE_ALIGN,
+ NULL, NULL);
OCFS_SET_FLAG (OcfsGlobalCtxt.flags, OCFS_FLAG_MEM_LISTS_INITIALIZED);
@@ -797,6 +801,7 @@
{
kmem_cache_destroy (OcfsGlobalCtxt.inode_cache);
kmem_cache_destroy (OcfsGlobalCtxt.extent_cache);
+ kmem_cache_destroy (OcfsGlobalCtxt.lock_cache);
OCFS_CLEAR_FLAG (OcfsGlobalCtxt.flags, OCFS_FLAG_MEM_LISTS_INITIALIZED);
} /* ocfs_free_mem_lists */
More information about the Ocfs2-commits
mailing list