gfs2: Glock dump performance regression fix
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 8 Jan 2018 21:35:43 +0000 (22:35 +0100)
committerBob Peterson <rpeterso@redhat.com>
Thu, 1 Feb 2018 18:27:11 +0000 (11:27 -0700)
commit7ac07fdaf840f9b141c6d5c286805107227c0e68
treeedfefcd997343e552b05fed68cd2f439dd55ae54
parentdcb2cd55cf43fe06ada66265c1e088a4b08d3e3d
gfs2: Glock dump performance regression fix

Restore an optimization removed in commit 7f19449553 "Fix debugfs glocks
dump": keep the glock hash table iterator active while the glock dump
file is held open.  This avoids having to rescan the hash table from the
start for each read, with quadratically rising runtime.

In addition, use rhastable_walk_peek for resuming a glock dump at the
current position: when a glock doesn't fit in the provided buffer
anymore, the next read must revisit the same glock.

Finally, also restart the dump from the first entry when we notice that
the hash table has been resized in gfs2_glock_seq_start.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/glock.c