Received: by 10.223.176.5 with SMTP id f5csp1724346wra; Thu, 8 Feb 2018 02:23:16 -0800 (PST) X-Google-Smtp-Source: AH8x227x4TrDqEycoOi+zypFEfbQmoMH8suaaIwGir8mVggx1ExvqNWj0D469CfNtZsmaI5qnjjY X-Received: by 10.98.103.83 with SMTP id b80mr235962pfc.12.1518085396463; Thu, 08 Feb 2018 02:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518085396; cv=none; d=google.com; s=arc-20160816; b=U5bpWKwX0q7n3GKn5j+vy5dQkNxtEpscS1ZZmYL5HcevxN3oig7mmeiL5D2TOhbVP4 srVSfW78L3h6pDVY8zCUqLMaOrWr5o5pmjkr9hni0eWBKbn1BtGkMzBt5GeLXtLGeVT5 wRjYJ3H75PZv5DOC8O63AVHR31XUB64yGtwtjnIlxWLzqVIMnCl1q51mbnCWUT/zEVvE TCtzrlxrcFJjHj2LVevss7DOr1QkHXbbLF1p080XE56C7HgQiXWzb6p6xAqMbuReBO2x 1JJPARCgYi/llrGq0rb5nnOJP65MHPetIP3h8FF56+yWCwS6O+1DYMOJhW8qBoVZca1U aiKA== 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=FNQD7Ne2rCnGW7I7fvgZBNPpSg3e7ny0P9n9monhYv0=; b=vqUkVOJ9+1WgwLANmK6hVejN9nP7Bp3p1eoFY7CFY17/ZnhXKYBxGVOexeNSj5p26W A/mGE5JhWYpPuJ6VTCC4TlgdHSpngA7jE20nYWv5jQq0vZtgDBHciCFC4IJZr6afML/f m9qeV/+8M2magcw6lC+REHz2dVeqyPCNxkRFwZ44hxUe0LS5gr0gBCN7m+0BEklQY5fU ooIRyMUddBAjPiJ6uNC6tbw7J0k4XhuiUdUTRXg4rjSM9XdGBzax0kEZSGFa/+XMnWkz R2vDVD4nPOX021xfzkxjqPtYFJgQZWtVaKJZUWIQ8Hdvnb2IJTAwPfU2crfsdgxNZ/1Y F56Q== 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 z31-v6si933784plb.217.2018.02.08.02.23.02; Thu, 08 Feb 2018 02:23:16 -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 S1751153AbeBHKWY (ORCPT + 99 others); Thu, 8 Feb 2018 05:22:24 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:61191 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbeBHKWX (ORCPT ); Thu, 8 Feb 2018 05:22:23 -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 c65bedb8d106b2d4; Thu, 8 Feb 2018 11:22:21 +0100 From: "Rafael J. Wysocki" To: Chris Wilson Cc: Jia-Ju Bai , 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 11:20:39 +0100 Message-ID: <1914141.qoxtLSqbUU@aspire.rjw.lan> In-Reply-To: <151808479008.28809.166946118004484639@mail.alporthouse.com> References: <1516875222-12293-1-git-send-email-baijiaju1990@gmail.com> <1808276.ZJn2ZeULZY@aspire.rjw.lan> <151808479008.28809.166946118004484639@mail.alporthouse.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, February 8, 2018 11:13:10 AM CET Chris Wilson wrote: > Quoting Rafael J. Wysocki (2018-02-08 09:51:41) > > 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! > > Hmm, not this patch per se, but > > https://intel-gfx-ci.01.org/tree/next/next-20180207/fi-bxt-dsi/dmesg0.log > [ 111.378236] BUG: sleeping function called from invalid context at mm/slab.h:420 > [ 111.378259] in_atomic(): 1, irqs_disabled(): 1, pid: 1701, name: gem_exec_flush > [ 111.378275] INFO: lockdep is turned off. > [ 111.378277] irq event stamp: 0 > [ 111.378280] hardirqs last enabled at (0): [< (null)>] (null) > [ 111.378286] hardirqs last disabled at (0): [<00000000a01fa473>] copy_process.part.7+0x2f1/0x1db0 > [ 111.378290] softirqs last enabled at (0): [<00000000a01fa473>] copy_process.part.7+0x2f1/0x1db0 > [ 111.378292] softirqs last disabled at (0): [< (null)>] (null) > [ 111.378293] Preemption disabled at: > [ 111.378298] [] __mutex_lock+0x56/0x9b0 > [ 111.378311] CPU: 1 PID: 1701 Comm: gem_exec_flush Tainted: G U W 4.15.0-next-20180207-g5d1c98967100-next-20180207 #1 > [ 111.378313] Hardware name: Intel Corp. Broxton P/Apollolake RVP1A, BIOS APLKRVPA.X64.0150.B11.1608081044 08/08/2016 > [ 111.378314] Call Trace: > [ 111.378318] > [ 111.378323] dump_stack+0x5f/0x86 > [ 111.378328] ___might_sleep+0x1d9/0x240 > [ 111.378334] ? acpi_os_execute+0x2d/0x130 > [ 111.378338] kmem_cache_alloc_trace+0x1ae/0x2b0 > [ 111.378344] ? acpi_ev_asynch_enable_gpe+0x2d/0x2d > [ 111.378347] acpi_os_execute+0x2d/0x130 > [ 111.378351] acpi_ev_gpe_dispatch+0xd7/0x120 > [ 111.378355] acpi_ev_gpe_detect+0x156/0x195 > [ 111.378362] acpi_ev_sci_xrupt_handler+0x16/0x28 > [ 111.378365] acpi_irq+0xd/0x30 > [ 111.378369] __handle_irq_event_percpu+0x3c/0x340 > [ 111.378374] handle_irq_event_percpu+0x1b/0x50 > [ 111.378378] handle_irq_event+0x2f/0x50 > [ 111.378381] handle_fasteoi_irq+0x93/0x150 > [ 111.378386] handle_irq+0x11/0x20 > [ 111.378390] do_IRQ+0x5e/0x120 > [ 111.378395] common_interrupt+0xbb/0xbb > [ 111.378397] > > does tell us that acpi_os_execute() is called in irq context. Well, right, thanks! I overlooked this instance, so dropping the patch. Thanks, Rafael