[lkml]   [2008]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH RFC 1/3] Add a trigger API for efficient non-blocking waiting
On Sat, 16 Aug 2008 09:34:13 -0700 Jeremy Fitzhardinge <> wrote:

> There are various places in the kernel which wish to wait for a
> condition to come true while in a non-blocking context. Existing
> examples of this are stop_machine() and smp_call_function_mask().
> (No doubt there are other instances of this pattern in the tree.)
> Thus far, the only way to achieve this is by spinning with a
> cpu_relax() loop. This is fine if the condition becomes true very
> quickly, but it is not ideal:
> - There's little opportunity to put the CPUs into a low-power state.
> cpu_relax() may do this to some extent, but if the wait is
> relatively long, then we can probably do better.

If this change saves a significant amount of power then we should fix
the offending callsites.

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

If this change saves a significant amount of virtual-cpu-time then we
should fix the offending callsites.

Tell me I'm wrong...

 \ /
  Last update: 2008-08-20 08:25    [W:0.166 / U:0.584 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site