Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932317Ab0FDOu2 (ORCPT ); Fri, 4 Jun 2010 10:50:28 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:57013 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756153Ab0FDOu1 (ORCPT ); Fri, 4 Jun 2010 10:50:27 -0400 Date: Fri, 4 Jun 2010 10:50:26 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Ingo Molnar cc: tytso@mit.edu, Brian Swetland , Neil Brown , Arve Hj?nnev?g , Thomas Gleixner , "Rafael J. Wysocki" , Felipe Balbi , Peter Zijlstra , LKML , Florian Mickler , Linux OMAP Mailing List , Linux PM , Alan Cox , James Bottomley , Linus Torvalds , Kevin Hilman , "H. Peter Anvin" , Arjan van de Ven Subject: Re: suspend blockers & Android integration In-Reply-To: <20100604003934.GA5221@elte.hu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1331 Lines: 27 On Fri, 4 Jun 2010, Ingo Molnar wrote: > Note that this does not necessarily have to be implemented as 'execute suspend > from the idle task' code: scheduling from the idle task, while can certainly > be made to work, is a somewhat recursive concept that we might want to avoid > for robustness reasons. > > Instead, the 'deepest idle' (suspend) method could consist of a wakeup of a > kernel thread (or of any of the existing kernel threads such as the migration > thread) - which kernel thread then does a race-free suspend: it offlines all > but one CPU [on platforms that need that] and then initiates the suspend - but > aborts the attempt if there's any sign of wakeup activity. Out of morbid curiosity... A typical sign of wakeup activity is a thread becoming runnable because of expiration of a kernel timer or an I/O completion interrupt. How would the "race-free suspend" thread detect this sort of thing? Indeed, isn't the inability to detect these part of what makes the existing suspend implementation (the freezer in particular) not race-free? Alan Stern -- 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/