diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2010-12-29 02:26:03 -0500 |
---|---|---|
committer | Joel Becker <jlbec@evilplan.org> | 2011-02-20 06:56:07 -0500 |
commit | 5bc970e803ad2b1f26771f39376a79dbf0f5bf64 (patch) | |
tree | cc2c0dd4a49ddad9691d0ef0312475db76bc6464 /fs/ocfs2/ocfs2.h | |
parent | 0cc9d5257857608ba85885b75fcada13d359b5d1 (diff) |
ocfs2: Use hrtimer to track ocfs2 fs lock stats
Patch makes use of the hrtimer to track times in ocfs2 lock stats.
The patch is a bit involved to ensure no additional impact on the memory
footprint. The size of ocfs2_inode_cache remains 1280 bytes on 32-bit systems.
A related change was to modify the unit of the max wait time from nanosec to
microsec allowing us to track max time larger than 4 secs. This change
necessitated the bumping of the output version in the debugfs file,
locking_state, from 2 to 3.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r-- | fs/ocfs2/ocfs2.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 51cd6898e7f1..4e3d3c1363f3 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -147,6 +147,17 @@ struct ocfs2_lock_res_ops; | |||
147 | 147 | ||
148 | typedef void (*ocfs2_lock_callback)(int status, unsigned long data); | 148 | typedef void (*ocfs2_lock_callback)(int status, unsigned long data); |
149 | 149 | ||
150 | #ifdef CONFIG_OCFS2_FS_STATS | ||
151 | struct ocfs2_lock_stats { | ||
152 | u64 ls_total; /* Total wait in NSEC */ | ||
153 | u32 ls_gets; /* Num acquires */ | ||
154 | u32 ls_fail; /* Num failed acquires */ | ||
155 | |||
156 | /* Storing max wait in usecs saves 24 bytes per inode */ | ||
157 | u32 ls_max; /* Max wait in USEC */ | ||
158 | }; | ||
159 | #endif | ||
160 | |||
150 | struct ocfs2_lock_res { | 161 | struct ocfs2_lock_res { |
151 | void *l_priv; | 162 | void *l_priv; |
152 | struct ocfs2_lock_res_ops *l_ops; | 163 | struct ocfs2_lock_res_ops *l_ops; |
@@ -182,15 +193,9 @@ struct ocfs2_lock_res { | |||
182 | struct list_head l_debug_list; | 193 | struct list_head l_debug_list; |
183 | 194 | ||
184 | #ifdef CONFIG_OCFS2_FS_STATS | 195 | #ifdef CONFIG_OCFS2_FS_STATS |
185 | unsigned long long l_lock_num_prmode; /* PR acquires */ | 196 | struct ocfs2_lock_stats l_lock_prmode; /* PR mode stats */ |
186 | unsigned long long l_lock_num_exmode; /* EX acquires */ | 197 | u32 l_lock_refresh; /* Disk refreshes */ |
187 | unsigned int l_lock_num_prmode_failed; /* Failed PR gets */ | 198 | struct ocfs2_lock_stats l_lock_exmode; /* EX mode stats */ |
188 | unsigned int l_lock_num_exmode_failed; /* Failed EX gets */ | ||
189 | unsigned long long l_lock_total_prmode; /* Tot wait for PR */ | ||
190 | unsigned long long l_lock_total_exmode; /* Tot wait for EX */ | ||
191 | unsigned int l_lock_max_prmode; /* Max wait for PR */ | ||
192 | unsigned int l_lock_max_exmode; /* Max wait for EX */ | ||
193 | unsigned int l_lock_refresh; /* Disk refreshes */ | ||
194 | #endif | 199 | #endif |
195 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 200 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
196 | struct lockdep_map l_lockdep_map; | 201 | struct lockdep_map l_lockdep_map; |