diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2007-08-16 02:24:43 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-15 02:38:23 -0400 |
commit | 1cb51258758d725028e9ee9688d462de125a053d (patch) | |
tree | 2306dcf367cd7e105b878ddf03bd8cb9e164be7d /fs/xfs/xfs_log.c | |
parent | 40906630f18fdf5ac27f5928c20f76eeac8fb0f0 (diff) |
[XFS] choose single default logbuf count & size
Remove sizing of logbuf size & count based on physical memory; this was
never a very good gauge as it's looking at global memory, but deciding on
sizing per-filesystem; no account is made of the total number of
filesystems, for example.
For now just take the largest "default" case, as was set for machines with
>400MB - 8 x 32k buffers. This can always be tuned higher or lower with
mount options if necessary. Removes one more user of xfs_physmem.
SGI-PV: 968563
SGI-Modid: xfs-linux-melb:xfs-kern:29323a
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r-- | fs/xfs/xfs_log.c | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index db09e1ea5cf3..4f4d20b2721c 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -1025,10 +1025,7 @@ xlog_bdstrat_cb(struct xfs_buf *bp) | |||
1025 | /* | 1025 | /* |
1026 | * Return size of each in-core log record buffer. | 1026 | * Return size of each in-core log record buffer. |
1027 | * | 1027 | * |
1028 | * Low memory machines only get 2 16KB buffers. We don't want to waste | 1028 | * All machines get 8 x 32KB buffers by default, unless tuned otherwise. |
1029 | * memory here. However, all other machines get at least 2 32KB buffers. | ||
1030 | * The number is hard coded because we don't care about the minimum | ||
1031 | * memory size, just 32MB systems. | ||
1032 | * | 1029 | * |
1033 | * If the filesystem blocksize is too large, we may need to choose a | 1030 | * If the filesystem blocksize is too large, we may need to choose a |
1034 | * larger size since the directory code currently logs entire blocks. | 1031 | * larger size since the directory code currently logs entire blocks. |
@@ -1041,17 +1038,10 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp, | |||
1041 | int size; | 1038 | int size; |
1042 | int xhdrs; | 1039 | int xhdrs; |
1043 | 1040 | ||
1044 | if (mp->m_logbufs <= 0) { | 1041 | if (mp->m_logbufs <= 0) |
1045 | if (xfs_physmem <= btoc(128*1024*1024)) { | 1042 | log->l_iclog_bufs = XLOG_MAX_ICLOGS; |
1046 | log->l_iclog_bufs = XLOG_MIN_ICLOGS; | 1043 | else |
1047 | } else if (xfs_physmem <= btoc(400*1024*1024)) { | ||
1048 | log->l_iclog_bufs = XLOG_MED_ICLOGS; | ||
1049 | } else { /* 256K with 32K bufs */ | ||
1050 | log->l_iclog_bufs = XLOG_MAX_ICLOGS; | ||
1051 | } | ||
1052 | } else { | ||
1053 | log->l_iclog_bufs = mp->m_logbufs; | 1044 | log->l_iclog_bufs = mp->m_logbufs; |
1054 | } | ||
1055 | 1045 | ||
1056 | /* | 1046 | /* |
1057 | * Buffer size passed in from mount system call. | 1047 | * Buffer size passed in from mount system call. |
@@ -1082,18 +1072,9 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp, | |||
1082 | goto done; | 1072 | goto done; |
1083 | } | 1073 | } |
1084 | 1074 | ||
1085 | /* | 1075 | /* All machines use 32KB buffers by default. */ |
1086 | * Special case machines that have less than 32MB of memory. | 1076 | log->l_iclog_size = XLOG_BIG_RECORD_BSIZE; |
1087 | * All machines with more memory use 32KB buffers. | 1077 | log->l_iclog_size_log = XLOG_BIG_RECORD_BSHIFT; |
1088 | */ | ||
1089 | if (xfs_physmem <= btoc(32*1024*1024)) { | ||
1090 | /* Don't change; min configuration */ | ||
1091 | log->l_iclog_size = XLOG_RECORD_BSIZE; /* 16k */ | ||
1092 | log->l_iclog_size_log = XLOG_RECORD_BSHIFT; | ||
1093 | } else { | ||
1094 | log->l_iclog_size = XLOG_BIG_RECORD_BSIZE; /* 32k */ | ||
1095 | log->l_iclog_size_log = XLOG_BIG_RECORD_BSHIFT; | ||
1096 | } | ||
1097 | 1078 | ||
1098 | /* the default log size is 16k or 32k which is one header sector */ | 1079 | /* the default log size is 16k or 32k which is one header sector */ |
1099 | log->l_iclog_hsize = BBSIZE; | 1080 | log->l_iclog_hsize = BBSIZE; |