[GFS2] Reduce inode size by moving i_alloc out of line

It is possible to reduce the size of GFS2 inodes by taking the i_alloc
structure out of the gfs2_inode. This patch allocates the i_alloc
structure whenever its needed, and frees it afterward. This decreases
the amount of low memory we use at the expense of requiring a memory
allocation for each page or partial page that we write. A quick test
with postmark shows that the overhead is not measurable and I also note
that OCFS2 use the same approach.

In the future I'd like to solve the problem by shrinking down the size
of the members of the i_alloc structure, but for now, this reduces the
immediate problem of using too much low-memory on x86 and doesn't add
too much overhead.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
Steven Whitehouse
2008-01-10 15:18:55 +00:00
parent ac39aadd04
commit 6dbd822487
12 changed files with 39 additions and 36 deletions

View File

@ -711,9 +711,10 @@ static int alloc_dinode(struct gfs2_inode *dip, u64 *no_addr, u64 *generation)
struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
int error;
gfs2_alloc_get(dip);
if (gfs2_alloc_get(dip) == NULL)
return -ENOMEM;
dip->i_alloc.al_requested = RES_DINODE;
dip->i_alloc->al_requested = RES_DINODE;
error = gfs2_inplace_reserve(dip);
if (error)
goto out;
@ -900,7 +901,7 @@ fail_end_trans:
gfs2_trans_end(sdp);
fail_ipreserv:
if (dip->i_alloc.al_rgd)
if (dip->i_alloc->al_rgd)
gfs2_inplace_release(dip);
fail_quota_locks: