[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH v2 00/29] libxl: Cancelling asynchronous operations



Hi,

On Wed, Feb 18, 2015 at 04:10:35PM +0000, Euan Harris wrote:
> We had a chat about testing these changes, and integrating them into xenopsd.
> We agreed that we each had slightly different expectations of what we were 
> going to do, and when.   I think we came to the following major conclusions:
> 
>   - I will start work on a simple test framework for cancellation,
>     hopefully to have first results in a fortnight or so.
>   - Once the test framework is available you will fix whatever bugs it
>     unearths, then we will rinse and repeat.
>   - You will think some more about the possibility of adding cancellation
>     to the xl command line tool, but since this is tricky there is no 
>     expectation of when it might happen.

I think the most straightforward way to test the cancellation mechanism in
LibXL will be to adapt the way we test similar functionality in xenopsd:

   * define numbered 'cancellation points' at which cancellable operations
     can be cancelled
   * before testing a cancellable operation, pre-set the cancellation point
     at which cancellation should be attempted
   * when execution reaches the pre-set cancellation point, run the cancellation
     procedure

This approach alone will not allow us to test asynchronous cancellation in
the middle of long-running operations, such as writing a suspend image
to disk - that will require a way to synchronize the test program with
the long-running operation.

My first guess about how this might be done was:

   * add current cancellation point and a trigger point variables to the context
     struct
   * increment the counter and fire the cancellation logic in
     libxl__ao_cancellable_register()

In this way we could write a loop which iterated through all possible
cancellation points.   However you pointed out that we cannot call
libxl_ao_cancel() while holding the context lock, so this idea needs
some refinement.   One possibility would be to tell another thread to try
to do the cancellation immediately after we release the lock;  another
option, if we didn't want to write a multi-thread test driver,
would be to do the cancellation at the top of libxl's event loop.

I think this captures roughly what we talked about.   Please let me know
if I misunderstood or missed out any details.

Thanks,
Euan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.