[sheepdog] [PATCH v2 1/3] sheep: make {register, unregister}_event thread safe
Hitoshi Mitake
mitake.hitoshi at gmail.com
Tue Dec 17 08:33:58 CET 2013
At Tue, 17 Dec 2013 15:11:30 +0800,
Liu Yuan wrote:
> >
> > From the perspective of
> > maintenance and debugging, I cannot agree with this patch. Adding a
> > new workqueue for register/unregister in the main loop will save lots
> > of our time in the future.
>
> I think this approach will not work for async request handling, e.g,
>
> + uatomic_inc(&iocb->count);
> + req->iocb = iocb;
> + register_event(req->local_req_efd, local_req_async_handler, req);
> + submit_local_request(req);
>
> I have to register the event before sumit_local_request().
>
> If I don't and put registeration in a delegated thread, suppose that is called
> after request is already handled. So I'll miss the notification that the request
> is done and local_req_async_handler will never be called.
>
> How do we handle above problem if we use your approach?
>
> If we take performance into account, we can't do it in your approch either.
> Suppose we will issue 1000 requests in a async mode, we can't affort to be trapped
> to main thread to register event for every request.
I have an internal under construction change for parameterizing event
loop. Current event loop mechanism has a limitation that we can have only one
event loop per process. The change is for removing this limitation.
Making dedicated event loop which can be managed by worker threads would be
helpful for your problem.
The change is originally intended for solving the problem that dog can use too
many memory area in some case (e.g. checking large VDIs)
Thanks,
Hitoshi
More information about the sheepdog
mailing list