diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-10-31 18:54:14 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-02-06 20:19:23 +0300 |
commit | 6c1e875ca6f3a47b40dce715bd07fdfdb8388d55 (patch) | |
tree | b30ab51df8df7c4ed9ef3adb68b234064816497f /drivers/mtd/ubi/scan.h | |
parent | 7950d023c562823345892aac2e7c6a49f8de9ad1 (diff) | |
download | linux-6c1e875ca6f3a47b40dce715bd07fdfdb8388d55.tar.xz |
UBI: add slab cache for ubi_scan_leb objects
During scanning UBI allocates one struct ubi_scan_leb object for each PEB,
so it can end up allocating thousands of them. Use slab cache to reduce
memory consumption for these 48-byte objects, because currently used
'kmalloc()' ends up allocating 64 bytes per object, instead of 48.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/scan.h')
-rw-r--r-- | drivers/mtd/ubi/scan.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h index a3264f0bef2b..d48aef15ab5d 100644 --- a/drivers/mtd/ubi/scan.h +++ b/drivers/mtd/ubi/scan.h @@ -109,6 +109,7 @@ struct ubi_scan_volume { * @mean_ec: mean erase counter value * @ec_sum: a temporary variable used when calculating @mean_ec * @ec_count: a temporary variable used when calculating @mean_ec + * @scan_leb_slab: slab cache for &struct ubi_scan_leb objects * * This data structure contains the result of scanning and may be used by other * UBI sub-systems to build final UBI data structures, further error-recovery @@ -134,6 +135,7 @@ struct ubi_scan_info { int mean_ec; uint64_t ec_sum; int ec_count; + struct kmem_cache *scan_leb_slab; }; struct ubi_device; |