]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
ceph: reduce contention in ceph_check_delayed_caps()
authorLuis Henriques <lhenriques@suse.de>
Tue, 6 Jul 2021 13:52:41 +0000 (14:52 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 24 Sep 2021 10:27:26 +0000 (12:27 +0200)
commita5084d83f2aee95d2a19659436290f29744565a0
tree69127f40d48eaaad0339ab088f9c114d0274c171
parent75cfd5d8a375afbfa603bcd38d07942629c237ee
ceph: reduce contention in ceph_check_delayed_caps()

BugLink: https://bugs.launchpad.net/bugs/1944202
commit bf2ba432213fade50dd39f2e348085b758c0726e upstream.

Function ceph_check_delayed_caps() is called from the mdsc->delayed_work
workqueue and it can be kept looping for quite some time if caps keep
being added back to the mdsc->cap_delay_list.  This may result in the
watchdog tainting the kernel with the softlockup flag.

This patch breaks this loop if the caps have been recently (i.e. during
the loop execution).  Any new caps added to the list will be handled in
the next run.

Also, allow schedule_delayed() callers to explicitly set the delay value
instead of defaulting to 5s, so we can ensure that it runs soon
afterward if it looks like there is more work.

Cc: stable@vger.kernel.org
URL: https://tracker.ceph.com/issues/46284
Signed-off-by: Luis Henriques <lhenriques@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/ceph/caps.c
fs/ceph/mds_client.c
fs/ceph/super.h