|
@@ -170,6 +170,7 @@ void gfs2_glock_add_to_lru(struct gfs2_glock *gl)
|
|
|
atomic_inc(&lru_count);
|
|
|
|
|
|
list_add_tail(&gl->gl_lru, &lru_list);
|
|
|
+ set_bit(GLF_LRU, &gl->gl_flags);
|
|
|
spin_unlock(&lru_lock);
|
|
|
}
|
|
|
|
|
@@ -1364,6 +1365,7 @@ static int gfs2_shrink_glock_memory(struct shrinker *shrink, int nr, gfp_t gfp_m
|
|
|
while(nr && !list_empty(&lru_list)) {
|
|
|
gl = list_entry(lru_list.next, struct gfs2_glock, gl_lru);
|
|
|
list_del_init(&gl->gl_lru);
|
|
|
+ clear_bit(GLF_LRU, &gl->gl_flags);
|
|
|
atomic_dec(&lru_count);
|
|
|
|
|
|
/* Test for being demotable */
|
|
@@ -1386,6 +1388,7 @@ static int gfs2_shrink_glock_memory(struct shrinker *shrink, int nr, gfp_t gfp_m
|
|
|
}
|
|
|
nr_skipped++;
|
|
|
list_add(&gl->gl_lru, &skipped);
|
|
|
+ set_bit(GLF_LRU, &gl->gl_flags);
|
|
|
}
|
|
|
list_splice(&skipped, &lru_list);
|
|
|
atomic_add(nr_skipped, &lru_count);
|
|
@@ -1598,9 +1601,11 @@ static int dump_holder(struct seq_file *seq, const struct gfs2_holder *gh)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static const char *gflags2str(char *buf, const unsigned long *gflags)
|
|
|
+static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
|
|
|
{
|
|
|
+ const unsigned long *gflags = &gl->gl_flags;
|
|
|
char *p = buf;
|
|
|
+
|
|
|
if (test_bit(GLF_LOCK, gflags))
|
|
|
*p++ = 'l';
|
|
|
if (test_bit(GLF_DEMOTE, gflags))
|
|
@@ -1623,6 +1628,10 @@ static const char *gflags2str(char *buf, const unsigned long *gflags)
|
|
|
*p++ = 'F';
|
|
|
if (test_bit(GLF_QUEUED, gflags))
|
|
|
*p++ = 'q';
|
|
|
+ if (test_bit(GLF_LRU, gflags))
|
|
|
+ *p++ = 'L';
|
|
|
+ if (gl->gl_object)
|
|
|
+ *p++ = 'o';
|
|
|
*p = 0;
|
|
|
return buf;
|
|
|
}
|
|
@@ -1661,7 +1670,7 @@ static int __dump_glock(struct seq_file *seq, const struct gfs2_glock *gl)
|
|
|
state2str(gl->gl_state),
|
|
|
gl->gl_name.ln_type,
|
|
|
(unsigned long long)gl->gl_name.ln_number,
|
|
|
- gflags2str(gflags_buf, &gl->gl_flags),
|
|
|
+ gflags2str(gflags_buf, gl),
|
|
|
state2str(gl->gl_target),
|
|
|
state2str(gl->gl_demote_state), dtime,
|
|
|
atomic_read(&gl->gl_ail_count),
|