[Pvfs2-developers] request unify and cleanup

Sam Lang slang at mcs.anl.gov
Fri Feb 8 19:27:08 EST 2008


The attached patch tries to cleanup some of our server request code,  
so that adding a new server request+state machine doesn't mean  
searching for all the places where we perform a switch/case on the  
server op enum.  It was motivated by the need for a more generic  
prelude state machine and request scheduler, but its been something  
that I've been itching to knock out for a while now.  I think there  
are still improvements that can be made here, especially to the  
encoding/decoding and request scheduler, but this gives me the  
functionality that I needed, so I decided its a good place to stop.

What it does in summary:

The normal path for a server request operation is to jump to the  
prelude state machine, which tries schedule the request based on the  
handle+fsid.  This meant that the request scheduler code had a switch/ 
case returning the handle+fsid for each request we defined.  The  
function was also overloaded with a readonly parameter (whether the  
request modified any objects on the server), and a scheduling policy  
parameter (as the return code), which specified whether the request  
scheduling could be bypassed for this request.

I moved all that to a per-request parameter structure, that gets  
specified within the server state machine for the request.  Now there  
is one array of server requests (moved to pvfs2-server-req.c) which  
the request scheduler and prelude state machine can poke at to get  
parameters (defined in the state machine for that request), and based  
decisions on.

The patch includes some other minor changes:

* A fix to the BMI addr ref count increment/decrement.  Previously,  
the addr ref count was being incremented/decremented in the prelude/ 
final-response state machines.  That requires that those state  
machines get invoked, which I don't want to have to depend on.  I've  
moved the INC call to the unexpected_sm, and the DEC call to where the  
state machine gets finished in the server.  That way we don't have to  
worry about whether we're using prelude/final-response.

* Cleanup of the request scheduler.  The way we were changing the mode  
from normal to admin was sort of embedded into the request scheduling  
code, so we had to hack the mode change from prelude_sm instead of in  
setparam.  Also, the request scheduler had to be aware of the setparam  
fields in the request.  I've moved the mode change code to separate  
request scheduler and job calls.  I think something similar could be  
done for the timer code (it doesn't really belong in the request  
scheduler), but I'll leave that for another patch.

* Changed the way we compile the server binary in Makefile.in to allow  
for multiple object files.

Let me know what you think.

Thanks,
-sam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: request-unify.patch
Type: application/octet-stream
Size: 97730 bytes
Desc: not available
Url : http://www.beowulf-underground.org/pipermail/pvfs2-developers/attachments/20080208/e523ee74/request-unify-0001.obj
-------------- next part --------------






More information about the Pvfs2-developers mailing list