The nfs_rpc_enqueue_req is called by the producer and nfs_rpc_dequeue_req is called by the consumer. Here is the high level view of those functions.
In particular, if a consumer finds no request in the queue, and then attempts to go to sleep, but before he adds himself to the wait list (before step 2b), if producer adds another request at that instant, the producer would find the wait list empty and couldn't wake up any consumer. Later the consumer would add himself to the wait list and goes to sleep (in a loop actually due to timedwait call. This will continue if there was no other request coming in. Am I missing something? nfs_rpc_dequeue_req() { 1. request = nfs_rpc_consume_req() 2. if (request == NULL) { /* no work to do */ a) set Wqe_LFlag_WaitSync flag b) add itself to the wait list c) while not Wqe_LFlag_SyncDone { pthread_cond_timedwait(5 seconds) } goto step 1; /* woke up with SyncDone */ } } nfs_rpc_enqueue_req() { 1. add request to the list 2. if (wait list is not empty) { a) pick up first waiting thread. b) set Wqe_LFlag_SyncDone c) if Wqe_LFlag_WaitSync() pthread_cond_signal(). } } ------------------------------------------------------------------------------ Monitor Your Dynamic Infrastructure at Any Scale With Datadog! Get real-time metrics from all of your servers, apps and tools in one place. SourceForge users - Click here to start your Free Trial of Datadog now! http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 _______________________________________________ Nfs-ganesha-devel mailing list Nfs-ganesha-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel