Whamcloud - gitweb
LU-17078 ldlm: do not spin up thread for local cancels 92/52192/5
authorPatrick Farrell <pfarrell@whamcloud.com>
Thu, 31 Aug 2023 00:07:03 +0000 (20:07 -0400)
committerOleg Drokin <green@whamcloud.com>
Sun, 4 Feb 2024 08:27:36 +0000 (08:27 +0000)
When doing lockless IO on the client, the server is
responsible for taking LDLM locks for each IO.

Currently, the server sends these locks to a separate
thread for cancellation.  This behavior is necessary on the
client where a lock may protect a large number of cached
pages, so cancelling it in a user thread may introduce
unacceptable delays.  But the server doesn't have cached
pages, so it makes more sense for the server to do the
cancellation in the same thread.

We do this by not spinning up an ldlm_bl thread for
cancellations of local (server side only) locks.

This improves 4K DIO random read performance by about 9%.

Without patch, maximum server IOPs on 4K reads:
2864k IOPS

With patch:
3118k IOPS

This is the maximum performance achieved with many clients
and client threads doing 4K random AIO reads from different
files.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Ia996732780d278c5d0bc290c5484e3bc325a347a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52192
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/ldlm/ldlm_lock.c

index 849e039..987c253 100644 (file)
@@ -886,7 +886,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, enum ldlm_mode mode)
                if (ldlm_is_fail_loc(lock))
                        CFS_RACE(OBD_FAIL_LDLM_CP_BL_RACE);
 
-               if (ldlm_is_atomic_cb(lock) ||
+               if (ldlm_is_atomic_cb(lock) || ldlm_is_local(lock) ||
                     ldlm_bl_to_thread_lock(ns, NULL, lock) != 0)
                        ldlm_handle_bl_callback(ns, NULL, lock);
         } else if (ns_is_client(ns) &&