Received: by 10.223.176.5 with SMTP id f5csp1700678wra; Thu, 8 Feb 2018 01:55:50 -0800 (PST) X-Google-Smtp-Source: AH8x226ifse7JnyCZlMpjtS4l6g43lZtJObQcgLuOF7ED76tzBbljzjNdO3Q6SW80pgoNlzeQsqI X-Received: by 2002:a17:902:a03:: with SMTP id 3-v6mr122757plo.282.1518083750403; Thu, 08 Feb 2018 01:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518083750; cv=none; d=google.com; s=arc-20160816; b=UcFMXcI+jEPdtu8Fq+6sGNRF0g2KsYi5fFh62a29B6Fwd52To2KjKBVRn5f/uro+ai deK66DNK8cSQvVD1tplewMBqcDwPQwQYNRr9Zn2iwcA+6CFrwy782qPc7Lbh+zwKicIe v63v5W1c4MMD/NGcqfqro3XEYOCUdSLSOAj+KaLZ2s7YRdW5U7LCQE/lgBjB1oGPd+5P LR1cDcf26UAH6VE0qdYFK6OgSaNPT8SIru/v/ckyFe1+12NgmxnmrTIKsMiEAANuf13i BgfKVglKH/P+A8ZugNLyN0mbS0VzpCQPOb6YhcCcJot+CyfZ/qvlHvZBFAojZ2Sy5DNB HPVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=A8JFfFGd6Bw1Qk56H3eB6RbKg78dNA9SH847xjJq6tQ=; b=lCYyD1o5OARGpIYdqDSv7Iz2ampf73NapQvEYil5xX34Vczn2cNhtBezTE2fCXSLuG 7lY3kEr4NTeA1LuR2vLiGEiCXEGpuLmJxyqBXBzsyQ98o+5v5yecSeMSGfM+k+WvL1xh jk5USmZC77Tg7tkA9di62MsO60pEYFmDxvzZ2Yn6eeevYHwEUfi0oKYvQUBTDek9WNtm QBbOnmjTCfS4nXbiHInAkLEMzmWSEODEz6ipVO4RTph9MbNwNCIBdjAAODzhz7lCDdos 2Pul4Dy4k6xblnZMECHb2Q3ahLbEwp6cWc5yRZLO8kLBaYzMekibFHjU8npAlLMePXTq Lz9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si2535070plt.418.2018.02.08.01.55.37; Thu, 08 Feb 2018 01:55:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752037AbeBHJx3 (ORCPT + 99 others); Thu, 8 Feb 2018 04:53:29 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:50736 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbeBHJxZ (ORCPT ); Thu, 8 Feb 2018 04:53:25 -0500 Received: from 79.184.255.223.ipv4.supernova.orange.pl (79.184.255.223) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id edabefe2357c3898; Thu, 8 Feb 2018 10:53:23 +0100 From: "Rafael J. Wysocki" To: Jia-Ju Bai Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] acpi: osl: Replace GFP_ATOMIC with GFP_KERNEL in acpi_os_execute Date: Thu, 08 Feb 2018 10:51:41 +0100 Message-ID: <1808276.ZJn2ZeULZY@aspire.rjw.lan> In-Reply-To: <1516875222-12293-1-git-send-email-baijiaju1990@gmail.com> References: <1516875222-12293-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, January 25, 2018 11:13:41 AM CET Jia-Ju Bai wrote: > After checking all possible call chains to acpi_os_execute here, > my tool finds that acpi_os_execute is never called in atomic context. > And acpi_os_execute calls acpi_debugger_create_thread > which calls mutex_lock, > thus it proves again that acpi_os_execute can > call functions which may sleep. > Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. > > This is found by a static analysis tool named DCNS written by myself. > > Signed-off-by: Jia-Ju Bai > --- > drivers/acpi/osl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c > index 3bb46cb..8ee605e 100644 > --- a/drivers/acpi/osl.c > +++ b/drivers/acpi/osl.c > @@ -1066,7 +1066,7 @@ acpi_status acpi_os_execute(acpi_execute_type type, > * having a static work_struct. > */ > > - dpc = kzalloc(sizeof(struct acpi_os_dpc), GFP_ATOMIC); > + dpc = kzalloc(sizeof(struct acpi_os_dpc), GFP_KERNEL); > if (!dpc) > return AE_NO_MEMORY; > > Applied, thanks!