]> git.baikalelectronics.ru Git - 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Aug 2021 06:56:57 +0000 (08:56 +0200)
commit8059157a34d51d49a592823d79969484676425ba
treeb5ca3439ece5a8e3a41fc7d4c74801f5accd35a7
parentde46099c79830df717c1dcec107f01a1feccb9e8
ceph: reduce contention in ceph_check_delayed_caps()

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>
fs/ceph/caps.c
fs/ceph/mds_client.c
fs/ceph/super.h