Messages in this thread | | | From | Christian Borntraeger <> | Subject | Re: [PATCH RFC 1/3] Add a trigger API for efficient non-blocking waiting | Date | Thu, 28 Aug 2008 14:27:24 +0200 |
| |
Sorry for answering late, but here are some comments.
Am Samstag, 16. August 2008 schrieb Jeremy Fitzhardinge: [...] > > - In a virtual environment, spinning virtual CPUs just waste CPU > resources, and may steal CPU time from vCPUs which need it to make > progress. The trigger API allows the vCPUs to give up their CPU > entirely. The s390 people observed a problem with stop_machine > taking a very long time (seconds) when there are more vcpus than > available cpus.
Yes, we have seen some real contention if the number of vcpus is much higher than the number of real cpus.
> > The trigger API is simple: > > To initialize a trigger, you can either do it statically with: > > DEFINE_TRIGGER(trigger); > > or dynamically with > > trigger_init(&trigger); > > Then to use it, the wait side does: > > trigger_reset(&trigger); > > while(!condition) > trigger_wait(&trigger); > > trigger_finish(&trigger); > > and when the condition is set true: > > condition = true; > trigger_kick(&trigger);
Hmm, I currently try to build something with sigp_stop and sigp_start on s390, not sure yet if this interface allows me to do that. At the moment something is wrong in my prototype.
| |