gfs2: Report when glocks cannot be freed for a long time
When glocks cannot be freed for a long time, avoid the "task blocked for more than N seconds" messages and report how many glocks are still outstanding, instead. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
+15
-3
@@ -2248,13 +2248,25 @@ void gfs2_gl_dq_holders(struct gfs2_sbd *sdp)
|
||||
|
||||
void gfs2_gl_hash_clear(struct gfs2_sbd *sdp)
|
||||
{
|
||||
unsigned long start = jiffies;
|
||||
bool timed_out = false;
|
||||
|
||||
set_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags);
|
||||
flush_workqueue(glock_workqueue);
|
||||
glock_hash_walk(clear_glock, sdp);
|
||||
flush_workqueue(glock_workqueue);
|
||||
wait_event_timeout(sdp->sd_kill_wait,
|
||||
atomic_read(&sdp->sd_glock_disposal) == 0,
|
||||
HZ * 600);
|
||||
while (!timed_out) {
|
||||
wait_event_timeout(sdp->sd_kill_wait,
|
||||
!atomic_read(&sdp->sd_glock_disposal),
|
||||
HZ * 60);
|
||||
if (!atomic_read(&sdp->sd_glock_disposal))
|
||||
break;
|
||||
timed_out = time_after(jiffies, start + (HZ * 600));
|
||||
fs_warn(sdp, "%u glocks left after %u seconds%s\n",
|
||||
atomic_read(&sdp->sd_glock_disposal),
|
||||
jiffies_to_msecs(jiffies - start) / 1000,
|
||||
timed_out ? ":" : "; still waiting");
|
||||
}
|
||||
gfs2_lm_unmount(sdp);
|
||||
gfs2_free_dead_glocks(sdp);
|
||||
glock_hash_walk(dump_glock_func, sdp);
|
||||
|
||||
Reference in New Issue
Block a user