Skip to content

Commit

Permalink
ext4: Use tracepoints for mb_history trace file
Browse files Browse the repository at this point in the history
The /proc/fs/ext4/<dev>/mb_history was maintained manually, and had a
number of problems: it required a largish amount of memory to be
allocated for each ext4 filesystem, and the s_mb_history_lock
introduced a CPU contention problem.  

By ripping out the mb_history code and replacing it with ftrace
tracepoints, and we get more functionality: timestamps, event
filtering, the ability to correlate mballoc history with other ext4
tracepoints, etc.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Theodore Ts'o committed Sep 30, 2009
1 parent 90576c0 commit 296c355
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 348 deletions.
1 change: 0 additions & 1 deletion Documentation/filesystems/proc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,6 @@ Table 1-12: Files in /proc/fs/ext4/<devname>
..............................................................................
File Content
mb_groups details of multiblock allocator buddy cache of free blocks
mb_history multiblock allocation history
..............................................................................


Expand Down
14 changes: 6 additions & 8 deletions fs/ext4/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ typedef __u32 ext4_lblk_t;
/* data type for block group number */
typedef unsigned int ext4_group_t;

/*
* Flags used in mballoc's allocation_context flags field.
*
* Also used to show what's going on for debugging purposes when the
* flag field is exported via the traceport interface
*/

/* prefer goal again. length */
#define EXT4_MB_HINT_MERGE 0x0001
Expand Down Expand Up @@ -971,14 +977,6 @@ struct ext4_sb_info {
unsigned long s_mb_last_group;
unsigned long s_mb_last_start;

/* history to debug policy */
struct ext4_mb_history *s_mb_history;
int s_mb_history_cur;
int s_mb_history_max;
int s_mb_history_num;
spinlock_t s_mb_history_lock;
int s_mb_history_filter;

/* stats for buddy allocator */
spinlock_t s_mb_pa_lock;
atomic_t s_bal_reqs; /* number of reqs with len > 1 */
Expand Down
Loading

0 comments on commit 296c355

Please sign in to comment.