From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752126Ab0EZIyL (ORCPT ); Wed, 26 May 2010 04:54:11 -0400 Received: from casper.infradead.org ([85.118.1.10]:39708 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095Ab0EZIyJ convert rfc822-to-8bit (ORCPT ); Wed, 26 May 2010 04:54:09 -0400 Subject: Re: [PATCH 1/8] PM: Opportunistic suspend support. From: Peter Zijlstra To: Arve =?ISO-8859-1?Q?Hj=F8nnev=E5g?= Cc: "Rafael J. Wysocki" , Alan Stern , Dmitry Torokhov , 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, Matthew Garrett , Greg KH , tytso@mit.edu, James Bottomley In-Reply-To: <1274863342.5882.4850.camel@twins> References: <201005252344.37639.rjw@sisk.pl> <1274863342.5882.4850.camel@twins> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Wed, 26 May 2010 10:53:07 +0200 Message-ID: <1274863987.5882.4892.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2010-05-26 at 10:42 +0200, Peter Zijlstra wrote: > What Dmitry proposes is that, the app _before_ it consumes the event, > pokes at this suspend manager, it increases a blocker count, then > consumes the event (the kernel will _not_ auto-suspend), handles it and > then again pokes the suspend manager, this time decreasing the blocker > count. > > The suspend manager will, upon reaching a 0 block count, suspend the > machine. If that fails, it means there's something to do, an app will > inc, work, dec its count, and it will try again once it reaches 0 again. Alternatively the suspend manager could simply cancel the opportunistic suspend mode on !0, and re-instate it on 0.