After thinking a bit about Zoran's comment I think Neels patch is ok as it is.

The current patch fixes the problem reported by the ticket and it does not 
introduce any new problem.
The optimization/simplification issue Zoran points to has always been there, 
should be tiny in its
effect and posibly has no real perforamnce impact at all. 

The risk is rather that we introduce some new silly bug when trying do that 
cleanup.
So lets only do that cleanup later as an enhancement.

If the performance issue was serious, then I would see it as a defect.

/AndersBj

-----Original Message-----
From: Anders Björnerstedt 
Sent: den 8 september 2014 10:43
To: Zoran Milinkovic; reddy.neelaka...@oracle.com; 
surender.khethav...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1 of 1] imm:Return AIS_OK when m_NCS_IPC_RECEIVE receives 
NULL in dispatch block[#937]

While I agree that this code semms more compicated than it needs be, I think in 
practice the optimization would not never happen.
Th dispatch functions should only be called as a result of poll triggering on a 
selection object related to the dispatch. 
I dont see how poll would get triggered if there is no callback.

Maybe it can happen, but I hpe it is not often, since that would really Be a 
performance problem in that threads/processes get scheduled to do Empty work.

/AndersBj

-----Original Message-----
From: Zoran Milinkovic
Sent: den 8 september 2014 10:28
To: reddy.neelaka...@oracle.com; Anders Björnerstedt; 
surender.khethav...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1 of 1] imm:Return AIS_OK when m_NCS_IPC_RECEIVE receives 
NULL in dispatch block[#937]

Reviewed, but not tested.
Ack from me.

One comment not related to the ticket.
Looking at the code after this change, "while" loop can be improved, and save 
some time in execution. "while(1)" can be replaced with "while(callback)", then 
"if (callback) {" and the false branch are not needed.
With this small change, unnecessary lock/unlock and table lookup can be skipped 
if the first "callback" is NULL.

Best regards,
Zoran

-----Original Message-----
From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com]
Sent: den 4 september 2014 15:19
To: Anders Björnerstedt; Zoran Milinkovic; surender.khethav...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm:Return AIS_OK when m_NCS_IPC_RECEIVE receives NULL 
in dispatch block[#937]

 osaf/libs/agents/saf/imma/imma_proc.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


callbk_mbx can fail only when handle is finalized.If a NULL is returned by 
m_NCS_IPC_RECEIVE then handle is considered as finalized and is a valid 
case.so, SA_AIS_OK will be returned*/

diff --git a/osaf/libs/agents/saf/imma/imma_proc.c 
b/osaf/libs/agents/saf/imma/imma_proc.c
--- a/osaf/libs/agents/saf/imma/imma_proc.c
+++ b/osaf/libs/agents/saf/imma/imma_proc.c
@@ -1758,7 +1758,11 @@ uint32_t imma_hdl_callbk_dispatch_block(
                        }
                } else {
                        m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
-                       return SA_AIS_ERR_LIBRARY;
+                       /* callbk_mbx can fail only when handle is finalized
+                          If a NULL is returned by m_NCS_IPC_RECEIVE then 
handle is
+                          considered as finalized and is a valid case. 
+                          so, SA_AIS_OK will be returned*/
+                       return SA_AIS_OK;
                }
 
                callback = (IMMA_CALLBACK_INFO *)m_NCS_IPC_RECEIVE(callbk_mbx, 
NULL);

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to