|
About
TODO
Blog
RSS
Old blog
Projects
Gallery
Notes
Thu, 28 Jun 2007
Device mapper sucks or recent changes in distributed storage development. /devel/dst :: Link / Comments (0)
Device mapper stack.
__split_bio()->__clone_and_map()->__map_bio()->target's map callback.First codepath is used to flush all in-flight BIOs on demand and is not a common path. Second one is a common way. It is performed in process context (either via ->readpage()
and do_generic_mapping_read() or via pdflush during writing)
and thus can sleep, there is no serialization lock anywhere in the path,
but block layer ensures that only one make_request_fn() callback runs at a time for given queue.
In case when make_request_fn() is already running, new BIO will be queued.This allows not to implement any kind of locking in target's mapping function, but there is an issue with dispatching work for different remote storages. Let's assume we have two remote devices, one of which is connected via very slow link (I seriously doubt one can build a distributed storage on top of slow links, but it is an example - node can be overloaded or down and effect will be the same), so sending/receiving data to/from that device will take a lot of time, if processing function will sleep, this essentially means that target's map callback should not be allowed to sleep and thus will not perform any processing itself. Having async AIO or at least in-kernel event dispatching would be great here, but I closed kevent which fits perfectly here, so I will implement some ->poll() based
dispatching/awakening mechanism to process non-blocking requests on behalf of special thread.So, target mapping callback will issue a non-blocking request without queueing (checking ->poll()
first is a good idea), if it is not fully completed, the rest will be done in dispatching state machine
in dedicated thread.
/devel/dst :: Link / Comments (0)
Job status. /devel/other :: Link / Comments (0) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||