diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-10 10:18:55 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-25 03:18:25 -0500 |
commit | 6dbd822487d0a9f14432cb4680415b80656b63a2 (patch) | |
tree | f0391d598c27cd7c39c67cfa13799a784f4c389a /fs/gfs2/inode.c | |
parent | ac39aadd0440ae696e6dacaa8006ce1737b17008 (diff) |
[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>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 53bca9978fb5..c84764ad82b3 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -711,9 +711,10 @@ static int alloc_dinode(struct gfs2_inode *dip, u64 *no_addr, u64 *generation) | |||
711 | struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); | 711 | struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); |
712 | int error; | 712 | int error; |
713 | 713 | ||
714 | gfs2_alloc_get(dip); | 714 | if (gfs2_alloc_get(dip) == NULL) |
715 | return -ENOMEM; | ||
715 | 716 | ||
716 | dip->i_alloc.al_requested = RES_DINODE; | 717 | dip->i_alloc->al_requested = RES_DINODE; |
717 | error = gfs2_inplace_reserve(dip); | 718 | error = gfs2_inplace_reserve(dip); |
718 | if (error) | 719 | if (error) |
719 | goto out; | 720 | goto out; |
@@ -900,7 +901,7 @@ fail_end_trans: | |||
900 | gfs2_trans_end(sdp); | 901 | gfs2_trans_end(sdp); |
901 | 902 | ||
902 | fail_ipreserv: | 903 | fail_ipreserv: |
903 | if (dip->i_alloc.al_rgd) | 904 | if (dip->i_alloc->al_rgd) |
904 | gfs2_inplace_release(dip); | 905 | gfs2_inplace_release(dip); |
905 | 906 | ||
906 | fail_quota_locks: | 907 | fail_quota_locks: |