staging: lustre: mdc: document mdc_rpc_lock
authorNed Bass <bass6@llnl.gov>
Tue, 5 Apr 2016 01:36:57 +0000 (21:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 03:47:10 +0000 (20:47 -0700)
As this lock can be a bottleneck, clarifying why it is needed may be
helpful to those working on client performance.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3443
Reviewed-on: http://review.whamcloud.com/6593
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lustre_mdc.h

index af77eb359c434333476e47bac1a6f87815fcfd35..f267ff8a6ec83b74026a6d76196f8772c6d6bc65 100644 (file)
@@ -64,9 +64,27 @@ struct obd_export;
 struct ptlrpc_request;
 struct obd_device;
 
+/**
+ * Serializes in-flight MDT-modifying RPC requests to preserve idempotency.
+ *
+ * This mutex is used to implement execute-once semantics on the MDT.
+ * The MDT stores the last transaction ID and result for every client in
+ * its last_rcvd file. If the client doesn't get a reply, it can safely
+ * resend the request and the MDT will reconstruct the reply being aware
+ * that the request has already been executed. Without this lock,
+ * execution status of concurrent in-flight requests would be
+ * overwritten.
+ *
+ * This design limits the extent to which we can keep a full pipeline of
+ * in-flight requests from a single client.  This limitation could be
+ * overcome by allowing multiple slots per client in the last_rcvd file.
+ */
 struct mdc_rpc_lock {
+       /** Lock protecting in-flight RPC concurrency. */
        struct mutex            rpcl_mutex;
+       /** Intent associated with currently executing request. */
        struct lookup_intent    *rpcl_it;
+       /** Used for MDS/RPC load testing purposes. */
        int                     rpcl_fakes;
 };