Received: by 10.223.176.46 with SMTP id f43csp719725wra; Fri, 26 Jan 2018 05:57:38 -0800 (PST) X-Google-Smtp-Source: AH8x224Xx/IDDCix1J/wFC0M0a/k2O3eehrzaW5ZHxb113OrPHOsq36Pee9Fl2tjdpbqfIQBo6zg X-Received: by 10.98.47.193 with SMTP id v184mr18927257pfv.90.1516975058255; Fri, 26 Jan 2018 05:57:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516975058; cv=none; d=google.com; s=arc-20160816; b=iOWD5qFbF8AiLCxuk6fnTzpPI97/AWVKCMUbsxXELE/Gi3lfQjVEzL29HREY8Q7oBM QywOoLs+4Lhwm+uuMBokIpHj0+qAHrqyIo1CDR/HFikCyq7gZTqP/mEHZfvvdjVEnrvW 2O/W3+nuMxfV4g5cOg9gC96G4QzexV+Mov+mbiCP8wlQwB9EKJ12LnOWTUwJgtjBAGdU bfQOMs4vdbs0HA4mDS4t9HS/Noc6B4c9wKZQpRIKY5F4INo1fzOgGX3QoHigOdYYxJlO n5Nlz54c958X8tr3W4OWNBC/ui6wSaO20U5jSHmuhZXk+eJgfBB+sTmSglfqS2eXdjmi OzVg== 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=sT/2Tz2eip6lG/Zm5Ecf1y3hMAHCcUhs2GrBgSjW3E0=; b=sdUBZWuCeWsUX16RWSPHiIvsn1wi9lAAMhNV679WNmjzd7L+oy5lrGLSQxPqK9dmDd cUq3K2FLCZJqSbVuTsoqrUeC64vdzCRQbL/llhi8xsmmdLUKgRnN3tG7A//9eX+60E6H vfCt7bIjReDqEVJDHylLb4zyD40EjAWzoDWe4Zt2FB0MvkV9xoXqHg36qwwxQDxzvUSB hryKEcBn1EY0aqA9NAd9bpR2kJrQFMdRi3ufzJyc5yhUU154bDbcEFlK/z9W4UY668J7 eB5smVc/vYYvKzgbUCJKUSMab+IZjMIGVvXtOCmbxwtsbY34tg/qiZBjhGHTYDo/sJcW xW4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DNzi6YvF; 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 i1si3000125pgq.829.2018.01.26.05.57.23; Fri, 26 Jan 2018 05:57:38 -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=DNzi6YvF; 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 S1753332AbeAZN5A (ORCPT + 99 others); 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 Received: by mail-pf0-f194.google.com with SMTP id k19so302176pfj.5; Fri, 26 Jan 2018 05:56:57 -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=sT/2Tz2eip6lG/Zm5Ecf1y3hMAHCcUhs2GrBgSjW3E0=; b=DNzi6YvFEfW5ShgClFGfYCt3yX5Jp5L4p1i683YuKn+1Ib7R4Anlfi574wMcTiZekm ZVgNG+TupDu/4iu3a5SUTW4lBQM6clvJ0ESBHjvrPJhQjnjosixxYuNyP4ql4kHXirYp FmmO00AWF7RKfw2DfarMrKvm1jnhi8zUIwjXa4fBpCLYPZsFSRKPBpOUR+zJ/kLZPV02 Hn30QeXRoQKEOp/Xf/xvUcUXHDRysreVUkdrDDxEx1/8uNlxu9k/GB3N4JZ2X8zC5DYa l90dUncLzSHLKzFvBJO2/7uP2b4jh5/+lC5Eg3vCp66w9qqZnp+Em+oZNxMZMTJHBwcg 4m7A== 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=sT/2Tz2eip6lG/Zm5Ecf1y3hMAHCcUhs2GrBgSjW3E0=; b=g2XpS0mEuw7qO9k4iZ9mni0tC4WEAwgz9hC2pB0HHLs9jFrXJjbCGnFYH09eTckBWd 9x/vY1tTkvlD7XMQN0UIDcUIFyyq06a7sFT0j+qCKggUB1at8Mkde2TSbCvGrtKT94c9 d8g26L7GIYarlVqfiOw/KfVKEC8G+X7zFQ6vcpRImLWTgGBpCKb1JrXbHjpm5DzvUre1 oz5hPSK/IUABMY4HAGoCIj8YNXVH1AiKB5iwSi7DKZVYfRolSMQo3gweUPrNFopgJ4m7 hYNCdqkgNDreCSoNoTbsqW62/jCgkRP9DOALc04fz1ddeEUDjhPKTbPNSLJQkp4QhEqM 559w== X-Gm-Message-State: AKwxytdTSVxovD/I8KSjP+w0NZxY/v1TmAp2KVAUUCfVOhLbrWt/LwgU 9EcRqxVRjI9ou8U3kHI0Df/wzuti X-Received: by 10.99.126.24 with SMTP id z24mr15536782pgc.143.1516975016856; Fri, 26 Jan 2018 05:56:56 -0800 (PST) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.14? ([2402:f000:1:1501:200:5efe:a66f:460e]) by smtp.gmail.com with ESMTPSA id v20sm18987251pfe.176.2018.01.26.05.56.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 05:56:56 -0800 (PST) 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 Precedence: bulk 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