From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762513AbYEHKRI (ORCPT ); Thu, 8 May 2008 06:17:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757342AbYEHKQz (ORCPT ); Thu, 8 May 2008 06:16:55 -0400 Received: from gw.goop.org ([64.81.55.164]:41151 "EHLO mail.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757020AbYEHKQy (ORCPT ); Thu, 8 May 2008 06:16:54 -0400 Message-ID: <4822D30E.5010506@goop.org> Date: Thu, 08 May 2008 11:16:46 +0100 From: Jeremy Fitzhardinge User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Andrew Morton CC: KOSAKI Motohiro , Li Zefan , Paul Menage , Jeremy Fitzhardinge , Andi Kleen , LKML , Rusty Russell Subject: Re: [PATCH] call_usermodehelper_setup() should use GFP_KERNEL References: <20080508153337.0EEE.KOSAKI.MOTOHIRO@jp.fujitsu.com> <4822AA6F.5040703@cn.fujitsu.com> <20080508163039.0EF4.KOSAKI.MOTOHIRO@jp.fujitsu.com> <20080508012957.c778c8e7.akpm@linux-foundation.org> In-Reply-To: <20080508012957.c778c8e7.akpm@linux-foundation.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrew Morton wrote: > On Thu, 08 May 2008 16:31:29 +0900 KOSAKI Motohiro wrote: > > >>> KOSAKI Motohiro wrote: >>> >>>> Now, call_usermodehelper_setup() use GFP_ATOMIC. >>>> but it is slighly odd. >>>> because call_usermodehelper() is always called process context. >>>> >>>> >>> Are you sure? I found the following call chain: >>> >>> static irqreturn_t power_handler(int irq, void *dev_id) >>> ->orderly_poweroff(true); >>> ->call_usermodehelper_setup() >>> >> sorry, you are right. >> I'll make patch again. >> > > How many times do we have to make this mistake :( > > Only the caller knows what allocation mode the callee can use. > call_usermodehelper_setup() should be extended to take a gfp_t argument. > Yeah, but making the caller need to know about the internal implementation details of the callee (ie, whether it needs to allocate memory or not) leads to pretty warty interfaces. In this case, you could push the gfp_t up to the call_usermodehelper_setup() level, but pushing it any higher wouldn't make much sense. Not that I have a better answer. J