Whamcloud - gitweb
LU-13705 utils: improve llstat/llobdstat usability
[fs/lustre-release.git] / lustre / llite / lproc_llite.c
index 73f5e1a..697c4c1 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 #define DEBUG_SUBSYSTEM S_LLITE
 
@@ -458,6 +457,7 @@ static int ll_max_cached_mb_seq_show(struct seq_file *m, void *v)
        struct super_block     *sb    = m->private;
        struct ll_sb_info      *sbi   = ll_s2sbi(sb);
        struct cl_client_cache *cache = sbi->ll_cache;
+       struct ll_ra_info *ra = &sbi->ll_ra_info;
        long max_cached_mb;
        long unused_mb;
 
@@ -465,16 +465,21 @@ static int ll_max_cached_mb_seq_show(struct seq_file *m, void *v)
        max_cached_mb = PAGES_TO_MiB(cache->ccc_lru_max);
        unused_mb = PAGES_TO_MiB(atomic_long_read(&cache->ccc_lru_left));
        mutex_unlock(&cache->ccc_max_cache_mb_lock);
+
        seq_printf(m, "users: %d\n"
                      "max_cached_mb: %ld\n"
                      "used_mb: %ld\n"
                      "unused_mb: %ld\n"
-                     "reclaim_count: %u\n",
+                     "reclaim_count: %u\n"
+                     "max_read_ahead_mb: %lu\n"
+                     "used_read_ahead_mb: %d\n",
                   atomic_read(&cache->ccc_users),
                   max_cached_mb,
                   max_cached_mb - unused_mb,
                   unused_mb,
-                  cache->ccc_lru_shrinkers);
+                  cache->ccc_lru_shrinkers,
+                  PAGES_TO_MiB(ra->ra_max_pages),
+                  PAGES_TO_MiB(atomic_read(&ra->ra_cur_pages)));
        return 0;
 }
 
@@ -1648,22 +1653,22 @@ void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, long count)
 EXPORT_SYMBOL(ll_stats_ops_tally);
 
 static const char *const ra_stat_string[] = {
-       [RA_STAT_HIT] = "hits",
-       [RA_STAT_MISS] = "misses",
-       [RA_STAT_DISTANT_READPAGE] = "readpage not consecutive",
-       [RA_STAT_MISS_IN_WINDOW] = "miss inside window",
-       [RA_STAT_FAILED_GRAB_PAGE] = "failed grab_cache_page",
-       [RA_STAT_FAILED_MATCH] = "failed lock match",
-       [RA_STAT_DISCARDED] = "read but discarded",
-       [RA_STAT_ZERO_LEN] = "zero length file",
-       [RA_STAT_ZERO_WINDOW] = "zero size window",
-       [RA_STAT_EOF] = "read-ahead to EOF",
-       [RA_STAT_MAX_IN_FLIGHT] = "hit max r-a issue",
-       [RA_STAT_WRONG_GRAB_PAGE] = "wrong page from grab_cache_page",
-       [RA_STAT_FAILED_REACH_END] = "failed to reach end",
-       [RA_STAT_ASYNC] = "async readahead",
-       [RA_STAT_FAILED_FAST_READ] = "failed to fast read",
-       [RA_STAT_MMAP_RANGE_READ] = "mmap range read",
+       [RA_STAT_HIT]                   = "hits",
+       [RA_STAT_MISS]                  = "misses",
+       [RA_STAT_DISTANT_READPAGE]      = "readpage_not_consecutive",
+       [RA_STAT_MISS_IN_WINDOW]        = "miss_inside_window",
+       [RA_STAT_FAILED_GRAB_PAGE]      = "failed_grab_cache_page",
+       [RA_STAT_FAILED_MATCH]          = "failed_lock_match",
+       [RA_STAT_DISCARDED]             = "read_but_discarded",
+       [RA_STAT_ZERO_LEN]              = "zero_length_file",
+       [RA_STAT_ZERO_WINDOW]           = "zero_size_window",
+       [RA_STAT_EOF]                   = "readahead_to_eof",
+       [RA_STAT_MAX_IN_FLIGHT]         = "hit_max_readahead_issue",
+       [RA_STAT_WRONG_GRAB_PAGE]       = "wrong_page_from_grab_cache_page",
+       [RA_STAT_FAILED_REACH_END]      = "failed_to_reach_end",
+       [RA_STAT_ASYNC]                 = "async_readahead",
+       [RA_STAT_FAILED_FAST_READ]      = "failed_to_fast_read",
+       [RA_STAT_MMAP_RANGE_READ]       = "mmap_range_read",
 };
 
 int ll_debugfs_register_super(struct super_block *sb, const char *name)