[openib-general] [PATCHv2] sdp: remove in_atomic usage

Michael S. Tsirkin mst at mellanox.co.il
Tue Aug 9 08:44:32 PDT 2005


Libor commented that performance suffers for him from this patch.
Its somewhat surprising since most operations are now done from under
conn->lock.slock.
This is hopefully addressed now that send iocbs can be unlocked
in interrupt context.

Please try/comment.
Tom, please dont commit this yet :)

--- 

SDP used in_atomic to detect atomic context, which, according to
Andrew's comment, doesnt actually catch all atomic conditions.
And there doesnt seem to exist a reliable way to detect atomic
environment. So lets use iocb flags instead, and always schedule
work for a receive iocb.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: linux-2.6.12.2/drivers/infiniband/ulp/sdp/sdp_iocb.c
===================================================================
--- linux-2.6.12.2.orig/drivers/infiniband/ulp/sdp/sdp_iocb.c	2005-08-09 17:20:38.000000000 +0300
+++ linux-2.6.12.2/drivers/infiniband/ulp/sdp/sdp_iocb.c	2005-08-09 17:21:15.000000000 +0300
@@ -326,11 +326,13 @@ void sdp_iocb_complete(struct sdpc_iocb 
 {
 	iocb->status = status;
 
-	if (in_atomic() || irqs_disabled()) {
-		INIT_WORK(&iocb->completion, do_iocb_complete, (void *)iocb);
-		schedule_work(&iocb->completion);
-	} else
+	if (!(iocb->flags & SDP_IOCB_F_LOCKED) ||
+	    !(iocb->flags & SDP_IOCB_F_RECV))
 		do_iocb_complete(iocb);
+	else {
+		INIT_WORK(&iocb->completion, do_iocb_complete, iocb);
+		schedule_work(&iocb->completion);
+	}
 }
 
 /*

-- 
MST



More information about the general mailing list