Blame gfs2/man/glocktop.8

Packit Service 360c39
.TH glocktop 8
Packit Service 360c39
Packit Service 360c39
.SH NAME
Packit Service 360c39
glocktop - Display or print active GFS2 locks.
Packit Service 360c39
Packit Service 360c39
.SH SYNOPSIS
Packit Service 360c39
.B glocktop
Packit Service 360c39
[\fIOPTIONS\fR]
Packit Service 360c39
Packit Service 360c39
.SH DESCRIPTION
Packit Service 360c39
The glocktop tool is used to display active GFS2 inter-node locks,
Packit Service 360c39
also known as glocks. Simply put, it's a tool to filter and interpret the
Packit Service 360c39
contents of the glocks debugfs file. The glocks debugfs file shows
Packit Service 360c39
all glocks known to GFS2, their holders, and technical data such as flags.
Packit Service 360c39
The glocktop tool will only show the glocks that are important: glocks that
Packit Service 360c39
are being held or for which there are waiters. It also interprets the debugfs
Packit Service 360c39
file of DLM (Distributed Lock Manager).
Packit Service 360c39
Packit Service 360c39
.SH OPTIONS
Packit Service 360c39
.TP
Packit Service 360c39
\fB-d\fP \fI<delay>\fP
Packit Service 360c39
Specify a time delay (in seconds) between reports. (Default is 30 seconds)
Packit Service 360c39
.TP
Packit Service 360c39
\fB-h\fP
Packit Service 360c39
Print help information.
Packit Service 360c39
.TP
Packit Service 360c39
\fB-i\fP
Packit Service 360c39
Interactive mode. In this mode, glocktop acts more like the top command.
Packit Service 360c39
It shows the pertinent glocks on the terminal session (as many as it can
Packit Service 360c39
fit). The advantage is that it uses different colors to draw attention to
Packit Service 360c39
what's important. The disadvantage is that it's limited by the size of
Packit Service 360c39
your display, so you may not see all the glocks.
Packit Service 360c39
.TP
Packit Service 360c39
\fB-D\fP
Packit Service 360c39
Omit DLM status. This may be used to reduce the amount of output for
Packit Service 360c39
interactive mode.
Packit Service 360c39
.TP
Packit Service 360c39
\fB-n\fP \fI<iterations>\fP
Packit Service 360c39
End the program after the specified number of iterations (reports). The
Packit Service 360c39
default is to keep running until interrupted.
Packit Service 360c39
.TP
Packit Service 360c39
\fB-r\fP
Packit Service 360c39
Show resource group reservation information. Normally, glocktop omits
Packit Service 360c39
resource group reservation information to condense the output. This
Packit Service 360c39
information is only important when debugging information related to the
Packit Service 360c39
GFS2 block allocator and file system fragmentation.
Packit Service 360c39
.TP
Packit Service 360c39
\fB-s\fP \fI<freq>\fR
Packit Service 360c39
Print glock summary information every \fI<freq>\fR reports.
Packit Service 360c39
The glock summary information is bulky and often not needed, so it's
Packit Service 360c39
only printed once every 10 reports. You can eliminate it entirely from
Packit Service 360c39
the output by specifying a value of 0. If you want the statistics to
Packit Service 360c39
print after every report, specify freq as 1.
Packit Service 360c39
.TP
Packit Service 360c39
\fB-t\fP
Packit Service 360c39
Trace directory path. A lot of GFS2 glock performance problems are caused
Packit Service 360c39
by an application's contention for one or two directories. These show up
Packit Service 360c39
as regular inodes in the output, but there's no good way to tell from the
Packit Service 360c39
output which directory is contended. Ordinarily, glocktop won't try to
Packit Service 360c39
look up the full pathname of a contended directory because it's slow,
Packit Service 360c39
especially if there are millions of glocks. This option instructs glocktop
Packit Service 360c39
to try to determine the full directory path names when it can, so you can
Packit Service 360c39
tell the full path (within the mount point) of contended directories.
Packit Service 360c39
.TP
Packit Service 360c39
\fB-H\fP
Packit Service 360c39
Don't show Held glocks, unless there are also waiters for the lock.
Packit Service 360c39
Ordinarily, glocktop will show glocks that are held (but not iopen
Packit Service 360c39
glocks which are almost always held by the thousands) as well as glocks
Packit Service 360c39
for which there are waiters. If it only showed glocks with waiters, you
Packit Service 360c39
could see, for example, that a glock is being blocked on one node,
Packit Service 360c39
but you couldn't see the information for a different node currently
Packit Service 360c39
holding the lock and thus, blocking the waiter. This option forces glocktop to
Packit Service 360c39
stop printing information for glocks with no waiters (on that node).
Packit Service 360c39
The advantage is that the output is smaller and easier to look at.
Packit Service 360c39
The disadvantage is that you can't see information from the node that's
Packit Service 360c39
blocking the waiter, unless both waiter and holder are on the same node.
Packit Service 360c39
.SH OUTPUT LINES
Packit Service 360c39
.TP
Packit Service 360c39
\fB@ name\fP
Packit Service 360c39
This is the GFS2 file system name for which the information is printed. It
Packit Service 360c39
also gives the time stamp of the report, and the cluster node name.
Packit Service 360c39
.TP
Packit Service 360c39
\fBG:\fP
Packit Service 360c39
This line represents a glock (internode GFS2 lock).
Packit Service 360c39
 G:  s:UN n:2/609b4 f:lIqob t:EX d:EX/0 a:0 v:0 r:3 m:200 (inode)
Packit Service 360c39
.TP
Packit Service 360c39
\fBD:\fP
Packit Service 360c39
This line gives you glocktop's interpretation of the glock's state as
Packit Service 360c39
far as DLM (distributed lock manager) is concerned.
Packit Service 360c39
  D: Granted PR on node 2 to pid 17511 [python]
Packit Service 360c39
.TP
Packit Service 360c39
\fBH:\fP
Packit Service 360c39
This line represents a glock holder: a process that's either holding the
Packit Service 360c39
glock, or is waiting to hold it. The value after S: represents how this
Packit Service 360c39
holder needs the lock: EX (Exclusive), SH (Shared), PR (Protected Read),
Packit Service 360c39
or UN (Unlocked). The value after F: indicates the holder flags: a W
Packit Service 360c39
indicates the holder is Waiting for the lock to be granted. An H indicates
Packit Service 360c39
the holder is currently holding the lock.
Packit Service 360c39
  H: s:EX f:W e:0 p:17511 [python] gfs2_unlink+0x7e/0x250 [gfs2]
Packit Service 360c39
.TP
Packit Service 360c39
\fBU:\fP
Packit Service 360c39
These lines represent glocktop's user interpretation of the data, both glock
Packit Service 360c39
and holder. Lines that begin with (N/A:...) can probably be ignored because
Packit Service 360c39
they ought to be unimportant: system files such as journals, etc.
Packit Service 360c39
  U:  W inode      183f5     Is:Shared, Want:Exclusive   [Demote pending, Reply pending, Queued, Blocking]
Packit Service 360c39
  U:  W  --->  waiting pid 17511 [python]  (Granted PR on node 2 to pid 17511 [python])
Packit Service 360c39
.TP
Packit Service 360c39
\fBC:\fP
Packit Service 360c39
These lines give you the call trace (call stack) of the process that's
Packit Service 360c39
either holding or waiting to hold the glock.
Packit Service 360c39
.TP
Packit Service 360c39
\fBS\fP
Packit Service 360c39
These lines give you the summary of all glocks for this file system: How many of
Packit Service 360c39
each category are unlocked, locked, how many are held in EX, SH, and DF, and how
Packit Service 360c39
many are waiting. G Waiting is how many glocks have waiters. P Waiting is
Packit Service 360c39
how many processes are waiting. Thus, you could have one glock that's got
Packit Service 360c39
ten processes waiting, or ten glocks that have ten processes waiting.
Packit Service 360c39
.SH EXAMPLE OUTPUT
Packit Service 360c39
.nf
Packit Service 360c39
.RS
Packit Service 360c39
# glocktop
Packit Service 360c39
.PP
Packit Service 360c39
@ nate_bob1       Wed Jan 27 07:24:14 2016  @host-050
Packit Service 360c39
 G:  s:EX n:9/1 f:Iqb t:EX d:EX/0 a:0 v:0 r:2 m:200 (journal)
Packit Service 360c39
  D: Granted EX on node 2 to pid 17468 [ended]
Packit Service 360c39
  H: s:EX f:eH e:0 p:17468 [(ended)] gfs2_glock_nq_num+0x5b/0xa0 [gfs2]
Packit Service 360c39
  U: (N/A:Journl)  H journal    1         Held:Exclusive   [Queued, Blocking]
Packit Service 360c39
  U: (N/A:Journl)  H  --->  held by pid 17468 [(ended)]  (Granted EX on node 2 to pid 17468 [ended])
Packit Service 360c39
 G:  s:SH n:1/1 f:Iqb t:SH d:EX/0 a:0 v:0 r:2 m:200 (non-disk)
Packit Service 360c39
  D: Granted PR on node 2 to pid 17468 [ended]
Packit Service 360c39
  H: s:SH f:eEH e:0 p:17468 [(ended)] gfs2_glock_nq_num+0x5b/0xa0 [gfs2]
Packit Service 360c39
  U: (N/A:Not EX)  H non-disk   1         Held:Shared   [Queued, Blocking]
Packit Service 360c39
  U: (N/A:Not EX)  H  --->  held by pid 17468 [(ended)]  (Granted PR on node 2 to pid 17468 [ended])
Packit Service 360c39
 G:  s:EX n:2/181ec f:yIqob t:EX d:EX/0 a:1 v:0 r:3 m:200 (inode)
Packit Service 360c39
  D: Granted EX on this node to pid 17468 [ended]
Packit Service 360c39
  H: s:EX f:H e:0 p:17468 [(ended)] init_per_node+0x17d/0x280 [gfs2]
Packit Service 360c39
  I: n:12/98796 t:8 f:0x00 d:0x00000201 s:24
Packit Service 360c39
  U: (N/A:System)  H inode      181ec     Held:Exclusive   [Dirty, Queued, Blocking]
Packit Service 360c39
  U: (N/A:System)  H  --->  held by pid 17468 [(ended)]  (Granted EX on this node to pid 17468 [ended])
Packit Service 360c39
 G:  s:EX n:2/181ed f:Iqob t:EX d:EX/0 a:0 v:0 r:3 m:200 (inode)
Packit Service 360c39
  D: Granted EX on this node to pid 17468 [ended]
Packit Service 360c39
  H: s:EX f:H e:0 p:17468 [(ended)] init_per_node+0x1b0/0x280 [gfs2]
Packit Service 360c39
  I: n:13/98797 t:8 f:0x00 d:0x00000200 s:1048576
Packit Service 360c39
  U: (N/A:System)  H inode      181ed     Held:Exclusive   [Queued, Blocking]
Packit Service 360c39
  U: (N/A:System)  H  --->  held by pid 17468 [(ended)]  (Granted EX on this node to pid 17468 [ended])
Packit Service 360c39
 G:  s:SH n:2/183f5 f:ldrIqob t:EX d:UN/0 a:0 v:0 r:5 m:10 (inode)
Packit Service 360c39
  D: Granted PR on node 2 to pid 17511 [python]
Packit Service 360c39
  H: s:EX f:W e:0 p:17511 [python] gfs2_unlink+0x7e/0x250 [gfs2]
Packit Service 360c39
  I: n:1/99317 t:4 f:0x00 d:0x00000003 s:2048
Packit Service 360c39
  U:  W inode      183f5     Is:Shared, Want:Exclusive   [Demote pending, Reply pending, Queued, Blocking]
Packit Service 360c39
  U:  W  --->  waiting pid 17511 [python]  (Granted PR on node 2 to pid 17511 [python])
Packit Service 360c39
  C:              gfs2_unlink+0xdc/0x250 [gfs2]
Packit Service 360c39
  C:              vfs_unlink+0xa0/0xf0
Packit Service 360c39
  C:              do_unlinkat+0x163/0x260
Packit Service 360c39
  C:              sys_unlink+0x16/0x20
Packit Service 360c39
 G:  s:SH n:2/805b f:Iqob t:SH d:EX/0 a:0 v:0 r:3 m:200 (inode)
Packit Service 360c39
  D: Granted PR on node 2 to pid 17468 [ended]
Packit Service 360c39
  H: s:SH f:eEcH e:0 p:17468 [(ended)] init_journal+0x185/0x500 [gfs2]
Packit Service 360c39
  I: n:5/32859 t:8 f:0x01 d:0x00000200 s:134217728
Packit Service 360c39
  U: (N/A:Not EX)  H inode      805b      Held:Shared   [Queued, Blocking]
Packit Service 360c39
  U: (N/A:Not EX)  H  --->  held by pid 17468 [(ended)]  (Granted PR on node 2 to pid 17468 [ended])
Packit Service 360c39
S    glocks  nondisk    inode    rgrp   iopen   flock quota jrnl    Total
Packit Service 360c39
S  --------- ------- -------- ------- ------- ------- ----- ---- --------
Packit Service 360c39
S  Unlocked:       1        5       4       0       0     0    0       10
Packit Service 360c39
S    Locked:       2      245       6      58       0     0    1      313
Packit Service 360c39
S     Total:       3      250      10      58       0     0    1      323
Packit Service 360c39
S
Packit Service 360c39
S   Held EX:       0        2       0       0       0     0    1        3
Packit Service 360c39
S   Held SH:       1        1       0      57       0     0    0       59
Packit Service 360c39
S   Held DF:       0        0       0       0       0     0    0        0
Packit Service 360c39
S G Waiting:       0        1       0       0       0     0    0        1
Packit Service 360c39
S P Waiting:       0        1       0       0       0     0    0        1
Packit Service 360c39
S  DLM wait:       0
Packit Service 360c39
Packit Service 360c39
@ nate_bob0       Wed Jan 27 07:24:14 2016  @host-050
Packit Service 360c39
 G:  s:EX n:2/180e9 f:yIqob t:EX d:EX/0 a:1 v:0 r:3 m:200 (inode)
Packit Service 360c39
  D: Granted EX on this node to pid 17465 [ended]
Packit Service 360c39
  H: s:EX f:H e:0 p:17465 [(ended)] init_per_node+0x17d/0x280 [gfs2]
Packit Service 360c39
  I: n:9/98537 t:8 f:0x00 d:0x00000201 s:24
Packit Service 360c39
  U: (N/A:System)  H inode      180e9     Held:Exclusive   [Dirty, Queued, Blocking]
Packit Service 360c39
  U: (N/A:System)  H  --->  held by pid 17465 [(ended)]  (Granted EX on this node to pid 17465 [ended])
Packit Service 360c39
 G:  s:UN n:2/609b4 f:lIqob t:EX d:EX/0 a:0 v:0 r:3 m:200 (inode)
Packit Service 360c39
  D: Granted EX on node 2 to pid 14367 [ended]
Packit Service 360c39
  H: s:EX f:W e:0 p:16297 [delete_workqueu] gfs2_delete_inode+0x9d/0x450 [gfs2]
Packit Service 360c39
  U:  W inode      609b4     Is:Unlocked, Want:Exclusive   [Queued, Blocking]
Packit Service 360c39
  U:  W  --->  waiting pid 16297 [delete_workqueu]  (Granted EX on node 2 to pid 14367 [ended])
Packit Service 360c39
  C:              gfs2_delete_inode+0xa5/0x450 [gfs2]
Packit Service 360c39
  C:              generic_delete_inode+0xde/0x1d0
Packit Service 360c39
  C:              generic_drop_inode+0x65/0x80
Packit Service 360c39
  C:              gfs2_drop_inode+0x37/0x40 [gfs2]
Packit Service 360c39
 G:  s:SH n:2/19 f:Iqob t:SH d:EX/0 a:0 v:0 r:3 m:200 (inode)
Packit Service 360c39
  D: Granted PR on this node to pid 17465 [ended]
Packit Service 360c39
  H: s:SH f:eEcH e:0 p:17465 [(ended)] init_journal+0x185/0x500 [gfs2]
Packit Service 360c39
  I: n:4/25 t:8 f:0x01 d:0x00000200 s:134217728
Packit Service 360c39
  U: (N/A:Not EX)  H inode      19        Held:Shared   [Queued, Blocking]
Packit Service 360c39
  U: (N/A:Not EX)  H  --->  held by pid 17465 [(ended)]  (Granted PR on this node to pid 17465 [ended])
Packit Service 360c39
 G:  s:EX n:2/180ea f:Iqob t:EX d:EX/0 a:0 v:0 r:3 m:200 (inode)
Packit Service 360c39
  D: Granted EX on this node to pid 17465 [ended]
Packit Service 360c39
  H: s:EX f:H e:0 p:17465 [(ended)] init_per_node+0x1b0/0x280 [gfs2]
Packit Service 360c39
  I: n:10/98538 t:8 f:0x00 d:0x00000200 s:1048576
Packit Service 360c39
  U: (N/A:System)  H inode      180ea     Held:Exclusive   [Queued, Blocking]
Packit Service 360c39
  U: (N/A:System)  H  --->  held by pid 17465 [(ended)]  (Granted EX on this node to pid 17465 [ended])
Packit Service 360c39
 G:  s:EX n:9/0 f:Iqb t:EX d:EX/0 a:0 v:0 r:2 m:200 (journal)
Packit Service 360c39
  D: Granted EX on this node to pid 17465 [ended]
Packit Service 360c39
  H: s:EX f:eH e:0 p:17465 [(ended)] gfs2_glock_nq_num+0x5b/0xa0 [gfs2]
Packit Service 360c39
  U: (N/A:Journl)  H journal    0         Held:Exclusive   [Queued, Blocking]
Packit Service 360c39
  U: (N/A:Journl)  H  --->  held by pid 17465 [(ended)]  (Granted EX on this node to pid 17465 [ended])
Packit Service 360c39
 G:  s:UN n:2/4fe12 f:ldIqob t:EX d:UN/0 a:0 v:0 r:4 m:10 (inode)
Packit Service 360c39
  H: s:EX f:W e:0 p:17523 [python] gfs2_rename+0x344/0x8b0 [gfs2]
Packit Service 360c39
  H: s:SH f:AW e:0 p:17527 [python] gfs2_permission+0x176/0x210 [gfs2]
Packit Service 360c39
  U:  W inode      4fe12     Is:Unlocked, Want:Exclusive   [Demote pending, Queued, Blocking]
Packit Service 360c39
  U:  W  --->  waiting pid 17523 [python]
Packit Service 360c39
  C:              gfs2_permission+0x17f/0x210 [gfs2]
Packit Service 360c39
  C:              __link_path_walk+0xb3/0x1000
Packit Service 360c39
  C:              path_walk+0x6a/0xe0
Packit Service 360c39
  C:              filename_lookup+0x6b/0xc0
Packit Service 360c39
  U:  W  --->  waiting pid 17527 [python]
Packit Service 360c39
  C:              do_unlinkat+0x107/0x260
Packit Service 360c39
  C:              sys_unlink+0x16/0x20
Packit Service 360c39
  C:              system_call_fastpath+0x16/0x1b
Packit Service 360c39
  C:              0xffffffffffffffff
Packit Service 360c39
 G:  s:SH n:1/1 f:Iqb t:SH d:EX/0 a:0 v:0 r:2 m:200 (non-disk)
Packit Service 360c39
  D: Granted PR on node 2 to pid 14285 [ended]
Packit Service 360c39
  D: Granted PR on this node to pid 17465 [ended]
Packit Service 360c39
  H: s:SH f:eEH e:0 p:17465 [(ended)] gfs2_glock_nq_num+0x5b/0xa0 [gfs2]
Packit Service 360c39
  U: (N/A:Not EX)  H non-disk   1         Held:Shared   [Queued, Blocking]
Packit Service 360c39
  U: (N/A:Not EX)  H  --->  held by pid 17465 [(ended)]  (Granted PR on node 2 to pid 14285 [ended]) (Granted PR on this node to pid 17465 [ended])
Packit Service 360c39
S    glocks  nondisk    inode    rgrp   iopen   flock quota jrnl    Total
Packit Service 360c39
S  --------- ------- -------- ------- ------- ------- ----- ---- --------
Packit Service 360c39
S  Unlocked:       1        8       7       0       0     0    0       16
Packit Service 360c39
S    Locked:       2      208       3      41       0     0    1      256
Packit Service 360c39
S     Total:       3      216      10      41       0     0    1      272
Packit Service 360c39
S
Packit Service 360c39
S   Held EX:       0        2       0       0       0     0    1        3
Packit Service 360c39
S   Held SH:       1        1       0      41       0     0    0       43
Packit Service 360c39
S   Held DF:       0        0       0       0       0     0    0        0
Packit Service 360c39
S G Waiting:       0        2       0       0       0     0    0        2
Packit Service 360c39
S P Waiting:       0        3       0       0       0     0    0        3
Packit Service 360c39
S  DLM wait:       0
Packit Service 360c39
.RE
Packit Service 360c39
.fi
Packit Service 360c39
.PP
Packit Service 360c39
From this example output, we can see there are two GFS2 file systems
Packit Service 360c39
mounted on system host-050: nate_bob1 and nate_bob0. In nate_bob1, we can
Packit Service 360c39
see six glocks, but we can ignore all of them marked (N/A:...) because they
Packit Service 360c39
are system files or held in SHared mode, and therefore other nodes should
Packit Service 360c39
be able to hold the lock in SHared as well.
Packit Service 360c39
.PP
Packit Service 360c39
There is one glock, for inode 183f5, which is has a process waiting to
Packit Service 360c39
hold it. The lock is currently in SHared mode (s:SH on the G: line) but
Packit Service 360c39
process 17511 (python) wants to hold the lock in EXclusive mode (S:EX
Packit Service 360c39
on the H: line). That process has a call stack that indicates it is trying
Packit Service 360c39
to hold the glock from gfs2_unlink. The DLM says the lock is currently
Packit Service 360c39
granted on node 2 in PR (Protected Read) mode.
Packit Service 360c39
.PP
Packit Service 360c39
For file system nate_bob0, there are 7 glocks listed. All but two are
Packit Service 360c39
uninteresting. Locks 2/609b4 and 2/4fe12 have processes waiting to
Packit Service 360c39
hold them.
Packit Service 360c39
.PP
Packit Service 360c39
In the summary data for nate_bob0, you can see there are 3 processes waiting
Packit Service 360c39
for 2 inode glocks (so one of those glocks has multiple processes waiting).
Packit Service 360c39
.PP
Packit Service 360c39
Since DLM wait is 0 in the summary data for both GFS2 mount points,
Packit Service 360c39
nobody is waiting for DLM to grant the lock.
Packit Service 360c39
Packit Service 360c39
.SH KNOWN BUGS AND LIMITATIONS
Packit Service 360c39
.PP
Packit Service 360c39
Since the GFS2 debugfs files are completely separate from the DLM debugfs
Packit Service 360c39
files, and locks can change status in a few nanoseconds time, there will
Packit Service 360c39
always be a lag between the GFS2 view of a lock and the DLM view of a lock.
Packit Service 360c39
If there is some kind of long-term hang, they are more likely to match.
Packit Service 360c39
However, under ordinary conditions, by the time glocktop gets around to
Packit Service 360c39
fetching the DLM status of a lock, the information has changed. Therefore,
Packit Service 360c39
don't be surprised if the DLM's view of a lock is at odds with its glock.
Packit Service 360c39
.PP
Packit Service 360c39
Since iopen glocks are held by the thousands, glocktop skips most of the
Packit Service 360c39
information related to them unless there's a waiter. For that reason,
Packit Service 360c39
iopen lock problems may be difficult to debug with glocktop.
Packit Service 360c39
.PP
Packit Service 360c39
It doesn't handle very large numbers (millions) of glocks.
Packit Service 360c39