From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762722AbXGFHNR (ORCPT ); Fri, 6 Jul 2007 03:13:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752059AbXGFHNH (ORCPT ); Fri, 6 Jul 2007 03:13:07 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:56959 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758413AbXGFHNG (ORCPT ); Fri, 6 Jul 2007 03:13:06 -0400 From: "Rafael J. Wysocki" To: Benjamin Herrenschmidt Subject: Re: [linux-pm] Re: [PATCH] Remove process freezer from suspend to RAM pathway Date: Fri, 6 Jul 2007 09:20:42 +0200 User-Agent: KMail/1.9.5 Cc: Alan Stern , Paul Mackerras , Johannes Berg , Linux-pm mailing list , Kernel development list , Pavel Machek , Matthew Garrett References: <1183676393.3388.89.camel@localhost.localdomain> In-Reply-To: <1183676393.3388.89.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707060920.43707.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Friday, 6 July 2007 00:59, Benjamin Herrenschmidt wrote: > On Thu, 2007-07-05 at 10:23 -0400, Alan Stern wrote: > > > > How will that help? Block the kernel thread in the freezer or block it > > in the driver -- either way it is blocked. So how do your deadlocks > > get resolved? > > Because nobody is waiting on that kernel thread anyway without a freezer > so there is no deadlock anymore. I'm not sure what you mean. The freezer doesn't wait for threads that are already frozen ... > > I disagree with your analysis -- not that it's completely wrong, but it > > points out an existing basic problem in the kernel. The kernel should > > never depend on userspace! More correctly, a task executing in the > > kernel should never block with any sort of mutex or other lock held (in > > a way that would preclude it from being frozen, let's say) while > > waiting for a response from userspace. > > > > Then the dependency graph would be easy to construct: User tasks can > > depend on whatever they want, and kernel threads never depend on a user > > task. > > In an idea world, there would be no hunger... > > > If this contradicts the existing implementations and APIs for userspace > > filesystems, then so be it. My conclusion would be that the > > implementations and APIs should be changed. > > Why are you guys working so hard and spending so much energy to try to > avoid doing the right thing is beyond my understanding... > > > It _does_ apply to kernel threads. That's exactly why I wrote above > > that kernel threads which try to do I/O during a suspend will need > > extra attention. > > Ok none at all if you don't have a freezer. Provided that drivers can handle that. Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth