]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: allocate struct ext4_allocation_context from a kmem cache
authorEric Sandeen <sandeen@redhat.com>
Sun, 10 Feb 2008 06:13:33 +0000 (01:13 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 10 Feb 2008 06:13:33 +0000 (01:13 -0500)
commit604f68f44cca9489a1abe6c2f8e72aad89c09863
treee8c16516bba080b4e40eccebb5a3ea5fb25cf5fd
parent36f4630f369c450c5d4c08b9c428e9c2e21e738e
ext4: allocate struct ext4_allocation_context from a kmem cache

struct ext4_allocation_context is rather large, and this bloats
the stack of many functions which use it.  Allocating it from
a named slab cache will alleviate this.

For example, with this change (on top of the noinline patch sent earlier):

-ext4_mb_new_blocks 200
+ext4_mb_new_blocks  40

-ext4_mb_free_blocks 344
+ext4_mb_free_blocks 168

-ext4_mb_release_inode_pa 216
+ext4_mb_release_inode_pa  40

-ext4_mb_release_group_pa 192
+ext4_mb_release_group_pa  24

Most of these stack-allocated structs are actually used only for
mballoc history; and in those cases often a smaller struct would do.
So changing that may be another way around it, at least for those
functions, if preferred.  For now, in those cases where the ac
is only for history, an allocation failure simply skips the history
recording, and does not cause any other failures.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/mballoc.c