Received: by 10.192.165.156 with SMTP id m28csp134741imm; Tue, 10 Apr 2018 18:11:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx48E+QVlLACkPLRygwxk0f/DE29zJdp49zou5XsdlPRF7C1+rfmfAwhSyzhGnwgnp9MH9wLb X-Received: by 2002:a17:902:9a03:: with SMTP id v3-v6mr2782763plp.162.1523409111667; Tue, 10 Apr 2018 18:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523409111; cv=none; d=google.com; s=arc-20160816; b=iU+CCi32KcfbYaGzWfeTjg/dCAFYouscRl3XkqL4Ye4fBTU7m3I0divBd5fwhR1vjA wUL6zJnPEafG4M4jLcVyEHdc/UufJLHSy8MFX/JkcKjlz2SCHJhKZug8uaR4KXH41h9B jdeGE4MWjPj4KT6vuFydpJM3neueNLIBjSHXL381HpI+F9FZ33JBLOEqabCFEGTkfT9x WDOVSHpLMjRLnZzf83w4n20El+xFKcz0KKjL6qr3lzoOrBZCpzEwU77BQOYZdZ58BNeo lVY68tgwAQtTplliIDUyqC1VUGsjNVgdVIY7NhFrEQxuDQQ6Ft95ybdknuuznOYQQi3I JnqA== 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=wgo6oROl6R5+k6yVmQTX0kXOCldSEzv+lbBgARzDRFo=; b=LSG2rRrGenn1ZJNFm7tN/fQ+VfNZ3DrITNg6fHX7eEkJMozltX/rtP5HNgvKQ6R1Rf POIuphWbJ25ebDeIvF/ZIRnwpf9wha8Lul8VeizkuPLq86SyDs7NpW/u6X6+vwPpsWJp +NbexyELNPs59fUd84L1cIWHq6P7BIbcEIdiRZe/L+rtgumo2VDQHEGNiGJv94L5g38l dxgtWd6QDbYRm9oGjODQGCqr88OeF2TLv5P7BwFV0z75szm9rqOyVYd7DpnsOO/Z6E63 E+fywu0iu/u972TkRc8Q0On8iUVDEVeyKmESCfr+OY+tkfrAtg8nUgo5dOKU3lYrJ8Bv QMoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VxQGUjGa; 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=QUARANTINE 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 o17si2572454pge.765.2018.04.10.18.11.15; Tue, 10 Apr 2018 18:11:51 -0700 (PDT) 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=VxQGUjGa; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752859AbeDKBBA (ORCPT + 99 others); Tue, 10 Apr 2018 21:01:00 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:36252 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752653AbeDKBA7 (ORCPT ); Tue, 10 Apr 2018 21:00:59 -0400 Received: by mail-pl0-f65.google.com with SMTP id 91-v6so123095pld.3 for ; Tue, 10 Apr 2018 18:00:59 -0700 (PDT) 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=wgo6oROl6R5+k6yVmQTX0kXOCldSEzv+lbBgARzDRFo=; b=VxQGUjGaGuy7R8peIBeOz28W8utfRoxPx3MNBoXvpCiS5n6fXzk6KLEsJdaPDDj011 5b9+XJDZIEGyIDLcnZzwkgKAJlVW2FEsmTC9M1psljmuGO1NolW1SO4lnjcCR9lLe2yA QEf4U5iF8P6N699TpqHPNqzN1aVYD1LBHRKtWlECCkk1J90xHD8i6X8CZChTnrVv84cT 5CO+MEu0nKg8erMJm9ZYOCB5nH6YfQhPOJAiZkZ1sHofzCL1SlSxeBCPNTj0Z74BHjog 6rEEvB3oFxyaVu/Fq3kvZTQMgAMGMQNFzeLo13k+xQsFHxiLR7DcaOr7okMadZoAss5v BCmw== 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=wgo6oROl6R5+k6yVmQTX0kXOCldSEzv+lbBgARzDRFo=; b=OidPLagfgnQLC4a85ZZtbdb9RjmqlwkVpvRaWhyck1MxYNkCWNVNOcclbKITUn93bp PkVaJ9c051EvSP13MCUjDwlM8OqWnmtllwtDDLD93UkuMyGMlZXivClyU30eGs0lRHk6 zs1HVe2WOEt6o/v3WVqcAwYp2mNk39SHad0Z+OVsWtAwqGiTKphOyJo1sw6k5sXr+B6p 5yTfHJt5I7AkzsgmtcE1WyijFNG6v/3e7LWY1DJO4ta6PPeC16q7C5NVWqNB7uXbc8AQ YysBULja7xPkb5q/k/oZp4Qa/QnJFDgnWjPBKtLf6FddfAHL/QXTCh35yS6gs1Am6X1I olKg== X-Gm-Message-State: ALQs6tA6DVM2cBCzfawckSrGl+gM6UBrxKtqePeb4iH9hZqfaHm/WUe0 6qXP6kRbkPnvBHNXmGk2Cja2+vsWWXg= X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr2753144plb.338.1523408458612; Tue, 10 Apr 2018 18:00:58 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.53? ([2402:f000:1:1501:200:5efe:a66f:4635]) by smtp.gmail.com with ESMTPSA id h2sm8639696pfd.119.2018.04.10.18.00.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 18:00:58 -0700 (PDT) Subject: Re: [PATCH 1/4] xen: xen-pciback: Replace GFP_ATOMIC with GFP_KERNEL in pcistub_probe To: Boris Ostrovsky , jgross@suse.com, gregkh@linuxfoundation.org Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org References: <1523286216-26345-1-git-send-email-baijiaju1990@gmail.com> <74fe5dd3-fb85-bed8-82b6-a9fb7a3a376d@gmail.com> <9703e77f-35e8-aa11-9ddb-fdc322efd6d2@oracle.com> From: Jia-Ju Bai Message-ID: <311acb17-1cab-bb1a-b612-23e7523f6709@gmail.com> Date: Wed, 11 Apr 2018 09:00:40 +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: <9703e77f-35e8-aa11-9ddb-fdc322efd6d2@oracle.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/4/10 23:01, Boris Ostrovsky wrote: > On 04/10/2018 10:31 AM, Jia-Ju Bai wrote: >> >> >> On 2018/4/10 22:27, Boris Ostrovsky wrote: >>> On 04/09/2018 11:03 AM, Jia-Ju Bai wrote: >>>> pcistub_probe() is never called in atomic context. >>>> This function is only set as ".probe" in struct pci_driver. >>>> >>>> Despite never getting called from atomic context, >>>> pcistub_probe() calls kmalloc() with GFP_ATOMIC, >>>> which does not sleep for allocation. >>>> GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, >>>> which can sleep and improve the possibility of sucessful allocation. >>>> >>>> This is found by a static analysis tool named DCNS written by myself. >>>> And I also manually check it. >>>> >>>> Signed-off-by: Jia-Ju Bai >>> What about use of GFP_ATOMIC in pcistub_reg_add()? >> Thanks for your reply :) >> I find pcistub_reg_add() is called by pcistub_quirk_add(). >> And pcistub_quirk_add() is called in the macro DRIVER_ATTR(). >> I am not sure whether DRIVER_ATTR() can make the function called in >> atomic context, >> so I do not analyze it in my tool. > I don't see why it needs to be ATOMIC, it's sysfs access. Can you send a > patch to fix it as well? Okay, I will send a patch for it soon. You can have a look :) Best wishes, Jia-Ju Bai