ext4: use dedicated slab caches for group_info structures
authorCurt Wohlgemuth <curtw@google.com>
Thu, 28 Oct 2010 01:29:12 +0000 (21:29 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 28 Oct 2010 01:29:12 +0000 (21:29 -0400)
commitfb1813f4a8a27bbd4735967e46931e61fc837a3e
treec9d7c9d851c81663a8e501ba5c14f2a4b332f893
parentb853fd364810a241050778124842a8c415c72a69
ext4: use dedicated slab caches for group_info structures

ext4_group_info structures are currently allocated with kmalloc().
With a typical 4K block size, these are 136 bytes each -- meaning
they'll each consume a 256-byte slab object.  On a system with many
ext4 large partitions, that's a lot of wasted kernel slab space.
(E.g., a single 1TB partition will have about 8000 block groups, using
about 2MB of slab, of which nearly 1MB is wasted.)

This patch creates an array of slab pointers created as needed --
depending on the superblock block size -- and uses these slabs to
allocate the group info objects.

Google-Bug-Id: 2980809

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/mballoc.c