From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755447AbXFXUVt (ORCPT ); Sun, 24 Jun 2007 16:21:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752025AbXFXUVl (ORCPT ); Sun, 24 Jun 2007 16:21:41 -0400 Received: from gprs189-60.eurotel.cz ([160.218.189.60]:60034 "EHLO amd.ucw.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751942AbXFXUVl (ORCPT ); Sun, 24 Jun 2007 16:21:41 -0400 Date: Sun, 24 Jun 2007 22:21:32 +0200 From: Pavel Machek To: "Rafael J. Wysocki" Cc: LKML , Nigel Cunningham , Uli Luckas , pm list Subject: Re: [RC][PATCH -mm] PM: Prevent frozen user mode helpers from failing the freezing of tasks Message-ID: <20070624202132.GC21757@elf.ucw.cz> References: <200706221647.50509.rjw@sisk.pl> <200706222347.55717.rjw@sisk.pl> <20070624170514.GA21757@elf.ucw.cz> <200706242226.39665.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200706242226.39665.rjw@sisk.pl> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.11+cvs20060126 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > > > > Special thanks to Uli Luckas for reviewing the previous > > > > > versions of this patch and for very useful comments. > > > > ... > > > > > Reviewed-by: Pavel Machek > > > > > > > > Eh, not sure this header is worth anything. Sometimes I'm lazy and > > > > stop when I see first problem. > > > > > > > > > switch (action) { > > > > > case PM_HIBERNATION_PREPARE: > > > > > case PM_SUSPEND_PREPARE: > > > > > usermodehelper_disabled = 1; > > > > > - return NOTIFY_OK; > > > > > + retval = wait_event_timeout(running_helpers_waitq, > > > > > + atomic_read(&running_helpers) == 0, > > > > > > > > Are you sure here? What happens when atomic variable changes between > > > > the atomic_read and the function call? > > > > > > Er, this is a macro. :-) > > > > > > In fact we rely only on atomic_read(&running_helpers) being still zero after > > > helper_finished() has woken us up, but I think that's acceptable. > > > > > > IOW, if the wait_event_timeout() returns with retval different from zero, this > > > means that atomic_read(&running_helpers) returned zero at one point after > > > we'd set usermodehelper_disabled, which is enough. OTOH, if it doesn't > > > > Ok, can you write short comment explaining that? /* We have set > > usermodehelper_disabled, so any new usermode helpers are not a problem > > */. > > OK, please have a look at the updated patch below. ACK, and thanks for your patience. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html