From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755381Ab0E0Xsu (ORCPT ); Thu, 27 May 2010 19:48:50 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:54902 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751644Ab0E0Xss (ORCPT ); Thu, 27 May 2010 19:48:48 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=iwBdvDJkQ/37XmMUmYUOjC61li+7mBuPmhj8hW0DeMLfPqW3nuVGxWWPMCsi2I4XTr iaIQ9mVcWRpQ442hbiih5R95doJm8mhq7M1vmMIE4V63URlb9WWy6NtoY/S6DdPFU+bV V6IwTCGvruzrVpoW2tYLZeKs/HKRFTozx9e8M= Date: Thu, 27 May 2010 16:48:42 -0700 From: Dmitry Torokhov To: Arve =?iso-8859-1?B?SGr4bm5lduVn?= Cc: Alan Stern , "Rafael J. Wysocki" , Linux-pm mailing list , Kernel development list , Len Brown , Pavel Machek , Randy Dunlap , Andrew Morton , Andi Kleen , Cornelia Huck , Tejun Heo , Jesse Barnes , Nigel Cunningham , Ming Lei , Wu Fengguang , Maxim Levitsky , linux-doc@vger.kernel.org Subject: Re: [PATCH 1/8] PM: Opportunistic suspend support. Message-ID: <20100527234841.GA8645@core.coreip.homeip.net> References: <20100527181333.GA8297@core.coreip.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 27, 2010 at 04:36:28PM -0700, Arve Hjønnevåg wrote: > 2010/5/27 Dmitry Torokhov : > > On Wed, May 26, 2010 at 05:52:40PM -0700, Arve Hjønnevåg wrote: > >> 2010/5/26 Alan Stern : > >> > On Wed, 26 May 2010, Arve Hjønnevåg wrote: > >> > > >> >> > I must be missing something.  In Arve's patch 1/8, if the system is in > >> >> > opportunistic suspend, and a wakeup event occurs but no suspend > >> >> > blockers get enabled by the handler, what causes the system to go back > >> >> > into suspend after the event is handled?  Isn't that a loop of some > >> >> > sort? > >> >> > > >> >> > >> >> Yes it is a loop. I think what you are missing is that it only loops > >> >> repeatedly if the driver that aborts suspend does not use a suspend > >> >> blocker. > >> > > >> > You mean "the driver that handles the wakeup event".  I was asking what > >> > happened if suspend succeeded and then a wakeup occurred.  But yes, if > >> > a suspend blocker is used then its release causes another suspend > >> > attempt, with no looping. > >> > > >> >> > And even if it isn't, so what?  What's wrong with looping behavior? > >> >> > >> >> It is a significant power drain. > >> > > >> > Not in the situation I was discussing. > >> > > >> > >> If you meant it spend most of the time suspended, then I agree. It > >> only wastes power when a driver blocks suspend by returning an error > >> from its suspend hook and we are forced to loop doing no useful work. > >> > > > > If driver refuses to suspend that means there are events that need > > processing. I fail to see why it would be called "looping doing no > > useful work". > > Because the useful work is done in another thread. All the loop does > is check if the useful work has completed which most likely will slow > down the useful work. Or useful work could signal when it is done processing critical section. > Blocking suspend with a suspend blocker until > the useful work is done is more efficient. > -- Dmitry