From a2f8d83ca49bb60f6bc6c7c94160d739b6641611 Mon Sep 17 00:00:00 2001 From: Ajaykumar Hotchandani Date: Thu, 16 Apr 2015 14:35:39 -0700 Subject: [PATCH] rds: avoid call to flush_mrs() in specific condition This is to reduce process spawn time. When user provides 0 values for cookie and flags in rds_free_mr() call, avoid calling flush_mr() skgxp uses cookie 0 and flag 0 combination for checking whether transport is RDMA capable or not. This is short term hack for customer escalation. Customer is having other processes which are calling flush_mrs() and that is causing mutex contention. skgxp change is fairly significant, and we want to provide minimal change in customer environment. Risk factor here is, if there is any other use of cookie 0 and flag 0 combination (like freeing up unused MRs), then that will be impacted. Code inspection by Leo/Avneesh at skgxp and skgnfs suggests that, this combination not being used anywhere. Long term solution for this requires changes in RDS as well as skgxp application, which should be done in next UEK release. Required RDS changes are present in UEK4; however, skgxp changes are still remaining. Since this was escalation from major customer, we require this hack in UEK4. Orabug: 24656750 Tested-by: Sujatha Tolstoy Signed-off-by: Ajaykumar Hotchandani Reviewed-by: Leo Tominna Reviewed-by: Avneesh Pant Reviewed-by: John Sobecki Signed-off-by: Guangyu Sun --- net/rds/rdma.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/net/rds/rdma.c b/net/rds/rdma.c index e49d4b1cc8f4..37b99465ab77 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -366,6 +366,16 @@ int rds_free_mr(struct rds_sock *rs, char __user *optval, int optlen) sizeof(struct rds_free_mr_args))) return -EFAULT; + /* + * 20366776 workaround. + * Let process spawn quickly by avoiding call to flush_mrs() + */ + if (args.cookie == 0 && args.flags == 0) { + if (!rs->rs_transport || !rs->rs_transport->flush_mrs) + return -EINVAL; + return 0; + } + /* Special case - a null cookie means flush all unused MRs */ if (args.cookie == 0) { if (!rs->rs_transport || !rs->rs_transport->flush_mrs) -- 2.50.1