[GFS2] Shrink gfs2_inode memory by half
Here is something I spotted (while looking for something entirely different) the other day. Rather than using a completion in each and every struct gfs2_holder, this removes it in favour of hashed wait queues, thus saving a considerable amount of memory both on the stack (where a number of gfs2_holder structures are allocated) and in particular in the gfs2_inode which has 8 gfs2_holder structures embedded within it. As a result on x86_64 the gfs2_inode shrinks from 2488 bytes to 1912 bytes, a saving of 576 bytes per inode (no thats not a typo!). In actual practice we get a much better result than that since now that a gfs2_inode is under the 2048 byte barrier, we get two per 4k slab page effectively halving the amount of memory required to store gfs2_inodes. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
@@ -128,6 +128,7 @@ enum {
|
||||
HIF_HOLDER = 6,
|
||||
HIF_FIRST = 7,
|
||||
HIF_ABORTED = 9,
|
||||
HIF_WAIT = 10,
|
||||
};
|
||||
|
||||
struct gfs2_holder {
|
||||
@@ -140,7 +141,6 @@ struct gfs2_holder {
|
||||
|
||||
int gh_error;
|
||||
unsigned long gh_iflags;
|
||||
struct completion gh_wait;
|
||||
unsigned long gh_ip;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user