]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: avoid uneeded calls to ext4_mb_load_buddy() while reading mb_groups
authorAditya Kali <adityakali@google.com>
Sat, 30 Jun 2012 23:10:57 +0000 (19:10 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 30 Jun 2012 23:10:57 +0000 (19:10 -0400)
commite2438575ea67d3d5fe786d905d7f086f4d79f3f7
tree432621e536d959468f6206b8001a6023e9306fe7
parent3b15e0f7495f5dcfda3ad9d09b0aa6894191804f
ext4: avoid uneeded calls to ext4_mb_load_buddy() while reading mb_groups

Currently ext4_mb_load_buddy is called for every group, irrespective
of whether the group info is already in memory, while reading
/proc/fs/ext4/<partition>/mb_groups proc file.  For the purpose of
mb_groups proc file, it is unnecessary to load the file group info
from disk if it was loaded in past.  These calls to ext4_mb_load_buddy
make reading the mb_groups proc file expensive.

Also, the locks around ext4_get_group_info are not required.

This patch modifies the code to call ext4_mb_load_buddy only if the
group info had never been loaded into memory in past. It also removes
the mb group locking around ext4_get_group_info call.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/mballoc.c