[sheepdog] [PATCH, RFC] sheep: rewrite blocked notifications

Liu Yuan namei.unix at gmail.com
Wed May 16 16:14:13 CEST 2012


On 05/16/2012 03:04 PM, Christoph Hellwig wrote:

> The prime AIM of this patch is to fix the racy access to sys->pending_list
> in do_cluster_op, but it actually cleans up the surrounding code massively
> as well.
> 
> It contains three tightly related changes:
> 
>  - split a new ->block operation from ->notify.  It is used to tell the
>    cluster driver to block new events, but does not contain a message by
>    itself yet.
>  - the block_cb callback previously passed to ->notify is not passed to
>    ->block any more, but a new sd_block_handler callback is provided
>    that can be called from the cluster driver in main thread context.
>    sd_block_handler takes care of grabbing the first request from
>    sys->pending list in the main thread, and then scheduling a workqueue
>    to handle the cluster operation
>  - a new ->unblock cluster operation is added which is called from the
>    ->done handler of the block workqueue to tell the cluster driver
>    to unblock the event processing, as well as sending the message with
>    the results from the main processing (or simplify the cluster wide
>    notification if there is no work routine in the ops table)


The whole idea looks decent to me. Code block() and unblock() explicitly
makes the whole path much more readable.

Yunkai, would you please help review the zookeeper part modification
Need your ack about it.

Thanks,
Yuan



More information about the sheepdog mailing list