From: Mikulas Patocka Date: Thu, 2 Apr 2009 18:55:24 +0000 (+0100) Subject: dm raid1: switch read_record from kmalloc to slab to save memory X-Git-Tag: v2.6.30-rc1~230^2~34 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95f8fac8dc6139fedfb87746e0c8fda9b803cb46;p=pandora-kernel.git dm raid1: switch read_record from kmalloc to slab to save memory With my previous patch to save bi_io_vec, the size of dm_raid1_read_record is significantly increased (the vector list takes 3072 bytes on 32-bit machines and 4096 bytes on 64-bit machines). The structure dm_raid1_read_record used to be allocated with kmalloc, but kmalloc aligns the size on the next power-of-two so an object slightly greater than 4096 will allocate 8192 bytes of memory and half of that memory will be wasted. This patch turns kmalloc into a slab cache which doesn't have this padding so it will reduce the memory consumed. Cc: stable@kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon --- Reading git-diff-tree failed