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

Re: [Xen-devel] Issue policing writes from Xen to PV domain memory


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: "Aravindh Puthiyaparambil (aravindp)" <aravindp@xxxxxxxxx>
  • Date: Mon, 12 May 2014 18:27:54 +0000
  • Accept-language: en-US
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "TimDeegan\(tim@xxxxxxx\)" <tim@xxxxxxx>
  • Delivery-date: Mon, 12 May 2014 18:28:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac9kBh2tUJWI8Pt1R5ScY+6HxANwigAZteGAABVfxTAAUzWYAAAFEsLAAAkZ2jAAgw0LgAAQcqHAACVFp4AAC7jQAAAjpSiAAELjU4AAIizRAAALCnIAAI8vhoAACnPdkA==
  • Thread-topic: Issue policing writes from Xen to PV domain memory

>>>That would effectively be a spin wait then, which is surely not the right
>thing.
>>>But I don't follow your explanation above anyway - when coming back
>>>from wait(), the state is the same as the original one, so the page
>>>fault handling continues, it's not being retried.
>>
>> Let me step through this. The pagefault for runstate occurs and
>> wait_event() gets called and the ring is full.
>>
>> wait_event():
>> do {
>>     if ( mem_event_wait_try_grab(med, &rc) != -EBUSY )       ==> This will
>return EBUSY
>>         break;
>>     for ( ; ; ) {
>>         prepare_to_wait(&med->wq);
>>         if ( mem_event_wait_try_grab(med, &rc) != -EBUSY )   ==> This will
>return EBUSY
>>             break;
>>         wait();                                                              
>>                                      ==> Write to
>runstate area occurs...
>>     }
>>     finish_wait(&med->wq);
>> } while (0)
>>
>> ...now this write to runstate will again cause a pagefault and we will
>> end up in wait_event() again. The previous attempt would have called
>> prepare_to_wait() but finish_wait() was not called.
>> finish_wait()->__finish_wait() is where wqv->esp gets reset to NULL. So
>now:
>>
>> wait_event():
>> do {
>>     if ( mem_event_wait_try_grab(med, &rc) != -EBUSY )       ==> This will
>return EBUSY
>>         break;
>>     for ( ; ; ) {
>>         prepare_to_wait(&med->wq);                                           
>>       ==> Assertion
>'wqv->esp == 0' fails
>>         if ( mem_event_wait_try_grab(med, &rc) != -EBUSY )
>>             break;
>>         wait();
>>     }
>>     finish_wait(&med->wq);
>> } while (0)
>>
>> Does this make sense?
>
>Of course. But it still doesn't mean you can replace the wait() here with
>something else (e.g. the effectively spin wait loop you suggested earlier). As
>said earlier on, you need to find a way to avoid the second invocation of
>wait_event(), rather than a way to make it "work".

OK, I will look in to that. Thanks for your time.

Aravindh


_______________________________________________
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®.