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/quota.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/quota.c')
-rw-r--r-- | fs/gfs2/quota.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 60cc50fe15b4..a08dabd6ce90 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -453,7 +453,7 @@ static void qdsb_put(struct gfs2_quota_data *qd) | |||
453 | int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid) | 453 | int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid) |
454 | { | 454 | { |
455 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 455 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
456 | struct gfs2_alloc *al = &ip->i_alloc; | 456 | struct gfs2_alloc *al = ip->i_alloc; |
457 | struct gfs2_quota_data **qd = al->al_qd; | 457 | struct gfs2_quota_data **qd = al->al_qd; |
458 | int error; | 458 | int error; |
459 | 459 | ||
@@ -501,7 +501,7 @@ out: | |||
501 | void gfs2_quota_unhold(struct gfs2_inode *ip) | 501 | void gfs2_quota_unhold(struct gfs2_inode *ip) |
502 | { | 502 | { |
503 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 503 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
504 | struct gfs2_alloc *al = &ip->i_alloc; | 504 | struct gfs2_alloc *al = ip->i_alloc; |
505 | unsigned int x; | 505 | unsigned int x; |
506 | 506 | ||
507 | gfs2_assert_warn(sdp, !test_bit(GIF_QD_LOCKED, &ip->i_flags)); | 507 | gfs2_assert_warn(sdp, !test_bit(GIF_QD_LOCKED, &ip->i_flags)); |
@@ -853,7 +853,7 @@ fail: | |||
853 | int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid) | 853 | int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid) |
854 | { | 854 | { |
855 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 855 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
856 | struct gfs2_alloc *al = &ip->i_alloc; | 856 | struct gfs2_alloc *al = ip->i_alloc; |
857 | unsigned int x; | 857 | unsigned int x; |
858 | int error = 0; | 858 | int error = 0; |
859 | 859 | ||
@@ -921,7 +921,7 @@ static int need_sync(struct gfs2_quota_data *qd) | |||
921 | 921 | ||
922 | void gfs2_quota_unlock(struct gfs2_inode *ip) | 922 | void gfs2_quota_unlock(struct gfs2_inode *ip) |
923 | { | 923 | { |
924 | struct gfs2_alloc *al = &ip->i_alloc; | 924 | struct gfs2_alloc *al = ip->i_alloc; |
925 | struct gfs2_quota_data *qda[4]; | 925 | struct gfs2_quota_data *qda[4]; |
926 | unsigned int count = 0; | 926 | unsigned int count = 0; |
927 | unsigned int x; | 927 | unsigned int x; |
@@ -969,7 +969,7 @@ static int print_message(struct gfs2_quota_data *qd, char *type) | |||
969 | int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid) | 969 | int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid) |
970 | { | 970 | { |
971 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 971 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
972 | struct gfs2_alloc *al = &ip->i_alloc; | 972 | struct gfs2_alloc *al = ip->i_alloc; |
973 | struct gfs2_quota_data *qd; | 973 | struct gfs2_quota_data *qd; |
974 | s64 value; | 974 | s64 value; |
975 | unsigned int x; | 975 | unsigned int x; |
@@ -1013,7 +1013,7 @@ int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid) | |||
1013 | void gfs2_quota_change(struct gfs2_inode *ip, s64 change, | 1013 | void gfs2_quota_change(struct gfs2_inode *ip, s64 change, |
1014 | u32 uid, u32 gid) | 1014 | u32 uid, u32 gid) |
1015 | { | 1015 | { |
1016 | struct gfs2_alloc *al = &ip->i_alloc; | 1016 | struct gfs2_alloc *al = ip->i_alloc; |
1017 | struct gfs2_quota_data *qd; | 1017 | struct gfs2_quota_data *qd; |
1018 | unsigned int x; | 1018 | unsigned int x; |
1019 | 1019 | ||