Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754530AbYH1M1m (ORCPT ); Thu, 28 Aug 2008 08:27:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752272AbYH1M1e (ORCPT ); Thu, 28 Aug 2008 08:27:34 -0400 Received: from mtagate3.de.ibm.com ([195.212.29.152]:50829 "EHLO mtagate3.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751523AbYH1M1e (ORCPT ); Thu, 28 Aug 2008 08:27:34 -0400 From: Christian Borntraeger To: Jeremy Fitzhardinge Subject: Re: [PATCH RFC 1/3] Add a trigger API for efficient non-blocking waiting Date: Thu, 28 Aug 2008 14:27:24 +0200 User-Agent: KMail/1.9.9 Cc: Ingo Molnar , Jens Axboe , Peter Zijlstra , Rusty Russell , Linux Kernel Mailing List , Arjan van de Ven References: <48A70185.2020600@goop.org> In-Reply-To: <48A70185.2020600@goop.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200808281427.24566.borntraeger@de.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1481 Lines: 48 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/