Received: by 10.223.176.46 with SMTP id f43csp868166wra; Fri, 26 Jan 2018 08:08:36 -0800 (PST) X-Google-Smtp-Source: AH8x226HLdeKeD5ZzAsOWUTczZtbdDS3SN6h97OOZAJCgYkh4VZK57PYW+CVOAKp5dEvBSYEgww5 X-Received: by 2002:a17:902:7795:: with SMTP id o21-v6mr4786540pll.314.1516982915971; Fri, 26 Jan 2018 08:08:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516982915; cv=none; d=google.com; s=arc-20160816; b=vpIH/A9gxxYQrGKYzq72EjY3Nnrg+fAUnjatjlON+sW61FPKUvHgaair4Oo/seQTtz 7jEk3hxWvgWvE/FKeu59yiO6eyaIlVc3XkENYn6yx5hlI7I55uXe9YetUivTjlRnl7Ug qQ8MD+YSTB4BX2degRhaI8v4ezb5AcfsLPhF/8PgZPzJ48sK4xYFbXFcSo8Bw8REk1JZ g8GairKQ321YITXhg2d4rhuKJ8e41eKzO4QE/xhSASV7lqYJnW8RS4kzFu9QtaTkWhAL fcVClIFDVgj6SHIzLrmbVzrYfBG3dB9JYA9RSowbGrLbvmk33BAq3EFlfToCIM71Ckgj qdbg== 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:from:subject:cc:to:message-id:date :arc-authentication-results; bh=yslmGHY6kf9FA9jhHc5xXV59ALnTTe87bCQrBHXp/Mw=; b=bnmyrTPvPK3phEfXZH8c51rPJNELuFKsYE+jWEeCEQYn/Ounrnj4gKcz9jlorZhKl7 2mhKE0Z+lm8mZWYuK66MskfRvRRvtgcPKuN8CVTNVC+VxfcMc217I9B3p2d8xLr9lgDk pcV9adtf2ao1WZHglFMUxOG1BYJUbItECcjbm0kOWSW/5xYhCBqMEFdH0m5DDmOiwzHN yiIt0T3vQu3ppfJEcFBSWWD6vO8lS2/KZ3Por+3LPsDpNv2JTEue4w+W4DTE/lDj0rMm Vugjv7wM06EtwNdKEgkun7ro2gsW33KS2vM//7E1/lMxwBC+cuuak54wdSLEj4XUM4aI 4MGw== 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 43-v6si3846185plb.498.2018.01.26.08.08.22; Fri, 26 Jan 2018 08:08:35 -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 S1753822AbeAZQHo (ORCPT + 99 others); Fri, 26 Jan 2018 11:07:44 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:47428 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776AbeAZQHn (ORCPT ); Fri, 26 Jan 2018 11:07:43 -0500 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 95ED8109164E1; Fri, 26 Jan 2018 08:07:40 -0800 (PST) Date: Fri, 26 Jan 2018 11:07:39 -0500 (EST) Message-Id: <20180126.110739.419621238821097728.davem@davemloft.net> To: viro@ZenIV.linux.org.uk Cc: baijiaju1990@gmail.com, 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] atm: firestream: Replace GFP_ATOMIC with GFP_KERNEL in fs_send From: David Miller In-Reply-To: <20180126120522.GX13338@ZenIV.linux.org.uk> References: <1516953627-30983-1-git-send-email-baijiaju1990@gmail.com> <20180126120522.GX13338@ZenIV.linux.org.uk> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 26 Jan 2018 08:07:41 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro Date: Fri, 26 Jan 2018 12:05:22 +0000 > On Fri, Jan 26, 2018 at 04:00:27PM +0800, Jia-Ju Bai wrote: >> After checking all possible call chains to fs_send() here, >> my tool finds that fs_send() is never called in atomic context. >> And this function is assigned to a function pointer "dev->ops->send", >> which is only called by vcc_sendmsg() (net/atm/common.c) >> through vcc->dev->ops->send(), and vcc_sendmsg() calls schedule(), >> it indicates that fs_send() 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. > > The trouble is, places like > net/atm/raw.c:65: vcc->send = atm_send_aal0; > net/atm/raw.c:74: vcc->send = vcc->dev->ops->send; > net/atm/raw.c:83: vcc->send = vcc->dev->ops->send; > mean extra call chains. It's *not* just vcc_sendmsg(), and e.g. > ret = ATM_SKB(skb)->vcc->send(ATM_SKB(skb)->vcc, skb) > ? DROP_PACKET : 1; > bh_unlock_sock(sk_atm(vcc)); > in pppoatm_send() definitely is called under a spinlock. > > Looking through the driver (in advanced bitrot, as usual for drivers/atm), > I'd say that submit_queue() is fucked in head in the "queue full" case. > And judging by the history, had been thus since the original merge... Jia-Ju, I'm probably not going to apply any of your GFP_KERNEL conversions. Al's analysis above is similar to how things looked for other patches you submited of this nature. So because of the lack of care and serious auditing you put into these conversions, I really have no choice but to drop them from my queue because on the whole they are adding bugs rather than improving the code. Thank you.