Received: by 10.223.176.5 with SMTP id f5csp1180520wra; Sat, 27 Jan 2018 18:14:59 -0800 (PST) X-Google-Smtp-Source: AH8x227/C+eBY6ARIGh9R8qUaO8mLMHJHdvtuiQqj5Eq4vsAvLXEn2YfEWWe7I9YETHuZ1XgOWI0 X-Received: by 10.98.67.82 with SMTP id q79mr22768998pfa.144.1517105699546; Sat, 27 Jan 2018 18:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517105699; cv=none; d=google.com; s=arc-20160816; b=nyn3HuOBDxGZKKEluWVNOmcHgGWcUzRFuUerG1r/zwt5vxAUc5BM5F/jC6kxYKZfrd +FxC84LfWDU1zQ2cUC7GGEi3GlS7ntOoz30uLmjtzfkyK9vnw06KU6KcIRs90BExDfo+ c+kyHwtZqfrq12JV9vwUIf6Xu30qqstnnD9CQVCStsPO2Abj26uxKxSw5q5Bm7BbswW2 oBCQIvBEL6cqyfbw5FH7fIJzmNYfvfuIWdfndxf+Ud+W766I4YQXEoD7wVEkDWBzDAfq 6sTNF0A4tKEdGt8RgOv+k1ITzf4amgzQnqQCn9VzSt5KgBlom2bRL0aDqXvsRi/4FE96 ACfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=49uy3rHnXIeQuRin24tWCtBmhzyVaXDS2odMeEJGzCU=; b=QGSddRyrPL401tpyblJNqmCVcqcxrwuAZn5n5pPJhYbEew+AXhzAja9dDTJ+0p7+Sm 02a89FHMTFl3pDh73zbIgef7Gtg2JeZZ26s6Aya8GlAS5QT7SoUcwW+RKTUmb/VaPYv/ Z5jP3J0gNd149dbrmZqnwJRPIgji5UIxF2vXy3Fq5N4q/EFEi7pqmEfwoIMDaChgDoCJ OR7ulxYnLdM1TB91Zx1v/K/TGJx3JrZZ1r9Eu9VIYou8sBfw9f/bkchKbILkKaIFeIB2 DkPiCLLLXY6nY8Ip3XD/s5RGZLfyfj2UjFvTpP5Z3N/EgWsEbMyQNV4iWN4/qc2YVmLp lMfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L5CW3I91; 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 q81si8950292pfd.99.2018.01.27.18.14.12; Sat, 27 Jan 2018 18:14:59 -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=L5CW3I91; 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 S1752864AbeA1CNW (ORCPT + 99 others); Sat, 27 Jan 2018 21:13:22 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36935 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751251AbeA1CNV (ORCPT ); Sat, 27 Jan 2018 21:13:21 -0500 Received: by mail-pf0-f195.google.com with SMTP id p1so2222288pfh.4 for ; Sat, 27 Jan 2018 18:13:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=49uy3rHnXIeQuRin24tWCtBmhzyVaXDS2odMeEJGzCU=; b=L5CW3I91egdn8v51ocNRYxNmYlKlRLomHJnXBzk4mdNq8XUrBx/HGv97s5McIUX7oO OquaX11xv4G4iTtwuSN5Zz6AcXr/4YL7KBcLOXkm6Kq8aE/q1LRtNUfKSgcyRDBp0uHt XsG5VMCcogZsvsEoz0F4Da7ZBREyxFAse7kD/b5ZmwS+N9rlsoGNzJZ39J9GHj97h54B 611TvmUWPgcvFOt3/P7phU8EnQIJ+hr7tTIvuptvHEGJJBWqTPC9dMPDa+mqocPWldX6 TIF5Fan8Mytw051NOh60FYjUXjhMqmbG9zPIf10HN4jTZko+6m0U/EjqIbZprt/NlTQD PxeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=49uy3rHnXIeQuRin24tWCtBmhzyVaXDS2odMeEJGzCU=; b=out2O3tR9QqwSqbtyL7Zf1mBAoAZswUkH8/I0e0IKFLltQUMyegg4zxxuNUqGk9aSs GYCGB0wnH1K90Yhcp3+Dy0jJcrCXlPBDr31yjRZBrOyui27iz1SDwegOaVMvU+Z3mevZ BfzdJ6Kuq1srjGk11JuXgMDlIGvA5ORtBCFsYfofAdgUKiuBo91rshFzPpSIgDrXn69k x+O/tGUYq8taSArBMXFls23Ok4r2cxy2WslY1cs7NIh+c51Det9QybP6GcylmC/FUOTx o1LjnlDZJuaF4cwzN+noc0a+slFhlpWltVK7Aw2J8zPiQ/jy7WLcqmc6mdbH8rbqZRY+ 8frQ== X-Gm-Message-State: AKwxytepNQeYotFMNF50kVN++rxHq4NxSNY9MaaNqhKUbx1DyxWdDhDg l9cf9F/x0hsLEmGLdlUlbQ4zjHlk X-Received: by 10.101.68.82 with SMTP id e18mr17700355pgq.413.1517105600376; Sat, 27 Jan 2018 18:13:20 -0800 (PST) Received: from ?IPv6:2402:f000:1:1501:200:5efe:183.172.144.181? ([2402:f000:1:1501:200:5efe:b7ac:90b5]) by smtp.gmail.com with ESMTPSA id m10sm11775624pgu.51.2018.01.27.18.13.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Jan 2018 18:13:20 -0800 (PST) Subject: Re: [PATCH] block: aoenet: Replace GFP_ATOMIC with GFP_KERNEL in aoenet_rcv To: Ed Cashin Cc: ed.cashin@acm.org, linux-kernel@vger.kernel.org References: <1516959434-829-1-git-send-email-baijiaju1990@gmail.com> <219E4594-88B1-4501-A897-9A4B3296163B@cashinworks.com> From: Jia-Ju Bai Message-ID: Date: Sun, 28 Jan 2018 10:12:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <219E4594-88B1-4501-A897-9A4B3296163B@cashinworks.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/1/28 1:48, Ed Cashin wrote: > If the tool cannot tell whether the protected state is manipulated by *another* piece of code called in atomic context, then it's insufficient. > >> On Jan 26, 2018, at 4:37 AM, Jia-Ju Bai wrote: >> >> After checking all possible call chains to aoenet_rcv(), >> my tool finds that aoenet_rcv() is never called in atomic context, >> namely never in an interrupt handler or holding a spinlock. >> 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/block/aoe/aoenet.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c >> index 63773a9..d5fff7a 100644 >> --- a/drivers/block/aoe/aoenet.c >> +++ b/drivers/block/aoe/aoenet.c >> @@ -138,7 +138,7 @@ static int __init aoe_iflist_setup(char *str) >> if (dev_net(ifp) != &init_net) >> goto exit; >> >> - skb = skb_share_check(skb, GFP_ATOMIC); >> + skb = skb_share_check(skb, GFP_KERNEL); >> if (skb == NULL) >> return 0; >> if (!is_aoe_netif(ifp)) >> -- >> 1.7.9.5 >> >> Sorry, I find my report is false positive after I manually check the code. aoenet_rcv() is used as function pointer via "->func", and it is called in dev_queue_xmit_nit() in net/core/dev.c. dev_queue_xmit_nit() calls a rcu_read_lock() before it calls pt_prev->func(). Thus it is right to use GFP_ATOMIC in aoenet_rcv(). Sorry again for my incorrect report... Thanks, Jia-Ju Bai