[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |