Re: [PATCH RFC 1/3] Add a trigger API for efficient non-blocking waiting

From: Christian Borntraeger
Date: Thu Aug 28 2008 - 08:27:44 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/