From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753337AbeAZN5A (ORCPT ); Fri, 26 Jan 2018 08:57:00 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37984 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752545AbeAZN45 (ORCPT ); Fri, 26 Jan 2018 08:56:57 -0500 X-Google-Smtp-Source: AH8x226GrNeskl5dOEJCh2F4GzH4QSC6jvfDnfUtmX8Ll1/Imk9X9y71Ly56Wnhzog6Lxnx//lh5Ig== Subject: Re: [PATCH] atm: firestream: Replace GFP_ATOMIC with GFP_KERNEL in fs_send To: Al Viro Cc: 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1516953627-30983-1-git-send-email-baijiaju1990@gmail.com> <20180126120522.GX13338@ZenIV.linux.org.uk> From: Jia-Ju Bai Message-ID: Date: Fri, 26 Jan 2018 21:56:32 +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: <20180126120522.GX13338@ZenIV.linux.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/1/26 20:05, Al Viro wrote: > 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... Thanks for reply :) I am sorry for this false positive. I think other ATM related patches that I submitted are also false positives, sorry. My tool did not handle this situation of passing function pointer, and I will improve the tool... Thanks, Jia-Ju Bai