Received: by 10.223.176.46 with SMTP id f43csp1925832wra; Thu, 25 Jan 2018 02:09:54 -0800 (PST) X-Google-Smtp-Source: AH8x226b0GgCpozR6al1+lwIgsvZqp3GvQy6yPg82uJ5MasBsR8vL6/7YZEQrVnWHe/CyvBMAGDr X-Received: by 10.101.96.207 with SMTP id r15mr12782366pgv.139.1516874994124; Thu, 25 Jan 2018 02:09:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516874994; cv=none; d=google.com; s=arc-20160816; b=GbVgjxwhbRnw+2YT4JPdTz6k8+hCbZcYeikF7Vuc4bodudFMB0IxzlTyx7KzOgrQM2 lkAEvlLOkmbiKI55+zMFQbSX8Tj0tFmX/wFef5Sgel/ku8gVLRznG2wY6Vz0tE1iXWVE 6UwfaVFZmlB+HP6+KiQCnXOwAtETpn4m5UpbJ/wrZWv0oUtKC4EaQZH0VIdW/+KB0S7P i+PNsjVv62RXYc+GOj0e0QYJQQDsARWrvlNhEtbXoEOPp/rApxzT8j1XAwCvB18svYjc ian97ysLHTxYpSRpXNiWrdcgTPN3TRnUc2aZvFt1Vl5qgNMmAdJIM7+fJysZh6HySRO0 /i1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ia+nHAzZFRATf6EnfqSb22SBU6QkXED9egyhdkySWOo=; b=v0AaUv6360DNSKGBB8Ewr1oe6cLEq6Eb86UxSPNxUwGjDpusuTOMATI8yIvO6zm4bC PcXm/GGfBourWdt8vkCiifMS5bCs3x5nTg77BQf+tlTsM1cKe8bYbGWR5F9Vj9ysBLEX 1DBQJ7oEr7t3/0rTqDsoNqXO+GdouAsEXVHrsswBEU6TPfEFGgW6j6cpzg/PWGCh+ETo O2tBskhGFvrmLv6gb8lI1WI3MMHSOWIMuqGXN4r8f5RJ1QNllKRCJU3N4TClSxLOdoXi 00CWE/fdTMQlW0GmSMVI3ro/h8bSfc+A48sQLJX6q6U+zkiovMv4aqa/ne2MvTxJqmx8 Ecvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hn/tZLsi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19-v6si1703113plq.735.2018.01.25.02.09.39; Thu, 25 Jan 2018 02:09:54 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hn/tZLsi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbeAYKJP (ORCPT + 99 others); Thu, 25 Jan 2018 05:09:15 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:38026 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751287AbeAYKJM (ORCPT ); Thu, 25 Jan 2018 05:09:12 -0500 Received: by mail-io0-f195.google.com with SMTP id d13so8072270iog.5; Thu, 25 Jan 2018 02:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ia+nHAzZFRATf6EnfqSb22SBU6QkXED9egyhdkySWOo=; b=Hn/tZLsie+IP26H5kTk4Mi3fZtj6Zd5aJcE4M//v27CDte9/lEFT/DhFcg93VHs0vw kvVZmnP93gTghxrD4SiLOlmwE6884e5d1R+wbmiOYv+EybiQ5jAW1l8gB8yqt26DRQKT bEsbQuMyk4TLDWNlz+HqrzbvF8M3msa2qp9fnXVOjBtIW4b2JOPhQ4dCqk6sOpSvkTMa eNC25TiWluVgTcez5y5JRMmThlgqyTziuuTllq53Z3cDsjxr9sdHcPG2XsycH70Plx1d ikD7+FLugd4l1JSWK+ts0q6FuTKArxUNAvj4rOJUkHJfYlklrwmAHW4J8ExEGIaY3GeX 6G1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ia+nHAzZFRATf6EnfqSb22SBU6QkXED9egyhdkySWOo=; b=evO5OnxQWMCxwR3oPKcPF55eb98xW+qPI8n1gRNj95YIDzA6B/ypd9uZIcp3mC1133 7mtJmkzldc/JWv7axd45mad+l19dZqwWHuXtIjyeDX2NCq7qIjx9juBxQjtaIzGYMkO+ UarnkN51oHJJhCV3reQVKNZPYHDUqg4P3uyjbq4X1o44tMeEkXwkWoPeIBkXyk1Ww5Ng 0xA/n1+m8Vp8zOOzualh6kg4u07btQmlO+7CQqQFOUa+v2oxBqm9jUoOqBpxOOPWmkhG O2IoRx6akHCPS3FWHfYkGf3M8Vd4MbLhZhCcE058KkiXGve/d+Ty5PogBFy3wQ2qfWfm iW+A== X-Gm-Message-State: AKwxytdWpfdD+BS2b8hC8AEYaLVWTf3p7l/Vmhij1n8MlEM7W+jVohxd 7upsUDz1I3yuKjW2r0yJj0M= X-Received: by 10.107.19.140 with SMTP id 12mr12553507iot.31.1516874952312; Thu, 25 Jan 2018 02:09:12 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:9980:256a:8e6d:5903]) by smtp.gmail.com with ESMTPSA id o123sm1620374ioo.66.2018.01.25.02.09.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 02:09:11 -0800 (PST) From: Jia-Ju Bai To: rjw@rjwysocki.net, lenb@kernel.org Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] acpi: osl: Replace GFP_ATOMIC with GFP_KERNEL in acpi_os_execute Date: Thu, 25 Jan 2018 18:13:41 +0800 Message-Id: <1516875222-12293-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 1.7.9.5