From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel@redhat.com
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
"Eric W. Biederman" <ebiederm@xmission.com>
Subject: [PATCH 0/5] gfs2: debugfs PID reporting improvements
Date: Tue, 28 Jun 2022 22:46:06 +0200 [thread overview]
Message-ID: <20220628204611.651126-1-agruenba@redhat.com> (raw)
Currently, all glock holders in the "glocks" dump file are reported as
being associated with the process that acquired them, even for holders
that are actually associated with the filesystem itself (like the
journal glock holder) or with cached inodes (like iopen and flock glock
holders). This is confusing when those holders outlive the processes
that have acquired them, and it trips up utilities that analyze lock
dependencies. For example, the following two glocks were acquired by
pid 10821 during the initial mount, which has since terminated:
G: s:EX n:9/0 f:qb t:EX d:EX/0 a:0 v:0 r:3 m:200 p:0
H: s:EX f:ecH e:0 p:10821 [(ended)] init_inodes+0x5c2/0xb10 [gfs2]
G: s:EX n:2/805f f:qob t:EX d:EX/0 a:0 v:0 r:4 m:200 p:1
H: s:EX f:H e:0 p:10821 [(ended)] gfs2_fill_super+0x92b/0xcc0 [gfs2]
I: n:6/32863 t:8 f:0x00 d:0x00000201 s:24 p:0
This patch queue tries to fix this problem in two ways:
* Glock holders which are not held by the process that acquired them
are marked as GL_NOPID. For those holders, the PID is reported as 0,
and the process name is reported as "(none)".
* With this change alone, we would have a much harder time detecting
locking cycles involving iopen or flock glocks: in both cases, a
process which has a file descriptor open depends on the iopen and
flock glock of the corresponding inode / file. To keep track of
these dependencies, we introduce a new "glockfd" dump file that
reports which file descriptors of which processes are holding which
glocks.
A utility that checks for locking problems using this additional
information is forthcoming, but hasn't been completed so far.
NEW EXPORTS
This patch queue requires iterating through all file descriptors of all
processes, which is made easier by exporting find_ge_pid() and
task_lookup_next_fd_rcu(); copying Eric W. Biederman and the
linux-kernel and linux-fsdevel lists to make sure that's okay.
Thanks,
Andreas
Andreas Gruenbacher (5):
gfs2: Add glockfd debugfs file
gfs2: Add flocks to glockfd debugfs file
gfs2: Add GL_NOPID flag for process-independent glock holders
gfs2: Mark flock glock holders as GL_NOPID
gfs2: Mark the remaining process-independent glock holders as GL_NOPID
fs/file.c | 1 +
fs/gfs2/file.c | 29 +++++-
fs/gfs2/glock.c | 211 +++++++++++++++++++++++++++++++++++++++++--
fs/gfs2/glock.h | 1 +
fs/gfs2/inode.c | 6 +-
fs/gfs2/ops_fstype.c | 14 +--
fs/gfs2/super.c | 3 +-
fs/gfs2/util.c | 6 +-
kernel/pid.c | 1 +
9 files changed, 247 insertions(+), 25 deletions(-)
--
2.35.1
next reply other threads:[~2022-06-28 20:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 20:46 Andreas Gruenbacher [this message]
2022-06-28 20:46 ` [PATCH 1/5] gfs2: Add glockfd debugfs file Andreas Gruenbacher
2022-06-28 20:46 ` [PATCH 2/5] gfs2: Add flocks to " Andreas Gruenbacher
2022-06-28 20:46 ` [PATCH 3/5] gfs2: Add GL_NOPID flag for process-independent glock holders Andreas Gruenbacher
2022-06-28 20:46 ` [PATCH 4/5] gfs2: Mark flock glock holders as GL_NOPID Andreas Gruenbacher
2022-06-28 20:46 ` [PATCH 5/5] gfs2: Mark the remaining process-independent " Andreas Gruenbacher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220628204611.651126-1-agruenba@redhat.com \
--to=agruenba@redhat.com \
--cc=cluster-devel@redhat.com \
--cc=ebiederm@xmission.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).