mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
slab allocators: Remove SLAB_DEBUG_INITIAL flag
I have never seen a use of SLAB_DEBUG_INITIAL. It is only supported by SLAB. I think its purpose was to have a callback after an object has been freed to verify that the state is the constructor state again? The callback is performed before each freeing of an object. I would think that it is much easier to check the object state manually before the free. That also places the check near the code object manipulation of the object. Also the SLAB_DEBUG_INITIAL callback is only performed if the kernel was compiled with SLAB debugging on. If there would be code in a constructor handling SLAB_DEBUG_INITIAL then it would have to be conditional on SLAB_DEBUG otherwise it would just be dead code. But there is no such code in the kernel. I think SLUB_DEBUG_INITIAL is too problematic to make real use of, difficult to understand and there are easier ways to accomplish the same effect (i.e. add debug code before kfree). There is a related flag SLAB_CTOR_VERIFY that is frequently checked to be clear in fs inode caches. Remove the pointless checks (they would even be pointless without removeal of SLAB_DEBUG_INITIAL) from the fs constructors. This is the last slab flag that SLUB did not support. Remove the check for unimplemented flags from SLUB. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
1 parent
4b1d89290b
commit
50953fe9e0
55 files changed
+55
-136
No files matched your search
@@ -71,8 +71,7 @@ spufs_init_once(void *p, struct kmem_cache * cachep, unsigned long flags)
|
||||
{
|
||||
struct spufs_inode_info *ei = p;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -940,8 +940,7 @@ static void ltree_entry_ctor(void *obj, struct kmem_cache *cache,
|
||||
{
|
||||
struct ltree_entry *le = obj;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) !=
|
||||
SLAB_CTOR_CONSTRUCTOR)
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
return;
|
||||
|
||||
le->users = 0;
|
||||
|
||||
+1
-2
@@ -232,8 +232,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct adfs_inode_info *ei = (struct adfs_inode_info *) foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR)
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -87,8 +87,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct affs_inode_info *ei = (struct affs_inode_info *) foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
init_MUTEX(&ei->i_link_lock);
|
||||
init_MUTEX(&ei->i_ext_lock);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
|
||||
+1
-2
@@ -453,8 +453,7 @@ static void afs_i_init_once(void *_vnode, struct kmem_cache *cachep,
|
||||
{
|
||||
struct afs_vnode *vnode = _vnode;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
memset(vnode, 0, sizeof(*vnode));
|
||||
inode_init_once(&vnode->vfs_inode);
|
||||
init_waitqueue_head(&vnode->update_waitq);
|
||||
|
||||
+1
-2
@@ -293,8 +293,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct befs_inode_info *bi = (struct befs_inode_info *) foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
inode_init_once(&bi->vfs_inode);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -248,8 +248,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct bfs_inode_info *bi = foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR)
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&bi->vfs_inode);
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -457,9 +457,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
struct bdev_inode *ei = (struct bdev_inode *) foo;
|
||||
struct block_device *bdev = &ei->bdev;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR)
|
||||
{
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
memset(bdev, 0, sizeof(*bdev));
|
||||
mutex_init(&bdev->bd_mutex);
|
||||
sema_init(&bdev->bd_mount_sem, 1);
|
||||
|
||||
+1
-2
@@ -2953,8 +2953,7 @@ EXPORT_SYMBOL(free_buffer_head);
|
||||
static void
|
||||
init_buffer_head(void *data, struct kmem_cache *cachep, unsigned long flags)
|
||||
{
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
struct buffer_head * bh = (struct buffer_head *)data;
|
||||
|
||||
memset(bh, 0, sizeof(*bh));
|
||||
|
||||
+1
-2
@@ -701,8 +701,7 @@ cifs_init_once(void *inode, struct kmem_cache * cachep, unsigned long flags)
|
||||
{
|
||||
struct cifsInodeInfo *cifsi = inode;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
inode_init_once(&cifsi->vfs_inode);
|
||||
INIT_LIST_HEAD(&cifsi->lockList);
|
||||
}
|
||||
|
||||
+1
-2
@@ -62,8 +62,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct coda_inode_info *ei = (struct coda_inode_info *) foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR)
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -583,8 +583,7 @@ inode_info_init_once(void *vptr, struct kmem_cache *cachep, unsigned long flags)
|
||||
{
|
||||
struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR)
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -72,8 +72,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct efs_inode_info *ei = (struct efs_inode_info *) foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR)
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -160,8 +160,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct ext2_inode_info *ei = (struct ext2_inode_info *) foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
rwlock_init(&ei->i_meta_lock);
|
||||
#ifdef CONFIG_EXT2_FS_XATTR
|
||||
init_rwsem(&ei->xattr_sem);
|
||||
|
||||
+1
-2
@@ -466,8 +466,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct ext3_inode_info *ei = (struct ext3_inode_info *) foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
INIT_LIST_HEAD(&ei->i_orphan);
|
||||
#ifdef CONFIG_EXT3_FS_XATTR
|
||||
init_rwsem(&ei->xattr_sem);
|
||||
|
||||
+1
-2
@@ -517,8 +517,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
INIT_LIST_HEAD(&ei->i_orphan);
|
||||
#ifdef CONFIG_EXT4DEV_FS_XATTR
|
||||
init_rwsem(&ei->xattr_sem);
|
||||
|
||||
+1
-2
@@ -40,8 +40,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
|
||||
{
|
||||
struct fat_cache *cache = (struct fat_cache *)foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR)
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
INIT_LIST_HEAD(&cache->cache_list);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -499,8 +499,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
||||
{
|
||||
struct msdos_inode_info *ei = (struct msdos_inode_info *)foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
spin_lock_init(&ei->cache_lru_lock);
|
||||
ei->nr_caches = 0;
|
||||
ei->cache_valid_id = FAT_CACHE_VALID + 1;
|
||||
|
||||
+1
-2
@@ -685,8 +685,7 @@ static void fuse_inode_init_once(void *foo, struct kmem_cache *cachep,
|
||||
{
|
||||
struct inode * inode = foo;
|
||||
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR)
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(inode);
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -27,8 +27,7 @@
|
||||
static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
|
||||
{
|
||||
struct gfs2_inode *ip = foo;
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
inode_init_once(&ip->i_inode);
|
||||
spin_lock_init(&ip->i_spin);
|
||||
init_rwsem(&ip->i_rw_mutex);
|
||||
@@ -39,8 +38,7 @@ static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned
|
||||
static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
|
||||
{
|
||||
struct gfs2_glock *gl = foo;
|
||||
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
|
||||
SLAB_CTOR_CONSTRUCTOR) {
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
INIT_HLIST_NODE(&gl->gl_list);
|
||||
spin_lock_init(&gl->gl_spin);
|
||||
INIT_LIST_HEAD(&gl->gl_holders);
|
||||
|
||||
Loaded 20 of 55 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user