Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758390AbYCVXpY (ORCPT ); Sat, 22 Mar 2008 19:45:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754705AbYCVXpL (ORCPT ); Sat, 22 Mar 2008 19:45:11 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:48464 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753497AbYCVXpK (ORCPT ); Sat, 22 Mar 2008 19:45:10 -0400 From: "Rafael J. Wysocki" To: Alan Stern Subject: Re: [RFC][PATCH] PM: Introduce new top level suspend and hibernation callbacks (rev. 2) Date: Sun, 23 Mar 2008 00:44:27 +0100 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) Cc: pm list , ACPI Devel Maling List , Greg KH , Len Brown , LKML , Alexey Starikovskiy , David Brownell , Pavel Machek , Benjamin Herrenschmidt References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803230044.29132.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1175 Lines: 27 On Sunday, 23 of March 2008, Alan Stern wrote: > On Sat, 22 Mar 2008, Rafael J. Wysocki wrote: > [--snip--] > > No, you have missed the entire point. The problem doesn't exist in the > current code; it exists only if we switch over to using a single list. > Routines like dpm_suspend() won't be able to use list_for_each_entry() > to traverse the list because entries may be removed by other threads > during the traversal. Even list_for_each_entry_safe() won't work > correctly without careful attention to details. Ah, ok. Thanks for the clarification. Doesn't it help that we traverse the list under dpm_list_mtx? Anyone who removes an entry is required to take dpm_list_mtx that we're holding while the list is traversed except when the callbacks are invoked. The only problem I see is when the device currently being handled is removed from the list by a concurrent thread. Is that you were referring to? Rafael -- 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/