Received: by 10.213.65.68 with SMTP id h4csp1122702imn; Sun, 18 Mar 2018 15:43:51 -0700 (PDT) X-Google-Smtp-Source: AG47ELtReL8ODj7G7Y0TgiBd+tksCWXLvdd5LR4aVijEdBj4gtu/b1O0nM3tLWuzxKnTdV/tSb1h X-Received: by 10.99.158.9 with SMTP id s9mr7517973pgd.64.1521413031223; Sun, 18 Mar 2018 15:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521413031; cv=none; d=google.com; s=arc-20160816; b=RvYGfWnzLoOcjmDJavIQATPTYOMDP0yEhmyGAfvCtwrQMg0gzDrKFMQr9oxlPIMb6G 28uTlXX0qBEr+bzgpa7oaeV0lpZ9BQcOcqBQOhbpxdpnf8Apjd1PnjM+xjuMVKmyuCRy ACM0ZL6lG5W9YY0sJxgvoGjB0lGnZvim0fyqG0K/zV3ud13EY2mp5e4nCaoNlvTd3Vol f4BSVP6Xfz0ATIoakDgYfR9Jzi/YHWDUoZpQNYDtOipG8C7U7esFAXcw2832iRUXWdLu RcSxia/bcNZAGyTXfzWCaykzmzuTGeK9HBp400AVNx13fNbvRtZgqigfsgTda334DFTN V/Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:msip_labels :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=UtJVG7hgSbwsXhR0LA9uw3OGKg6jyoTetDNYhhgBSUE=; b=0oxhEY360LBJcPuXZPqlxYLki9vvfMULdz3UTaeD2eIYpovtvdb1JrMW/rlp8aq2+M OS5eUXcR/JjHIjuVFsnYPmIWNAOD281GOjCxows2Y0AlwyqW4U/5XSg0qIL+UeAbeBv4 3TnQEziRwSYZgiaK+qHZHc49hzvU3dxaJ0iag4t/FhiuRHgRwHuKIc0Jtz04z9eOCh0n B51oYc36AXmB0Q0uP0bHxW5TF/HABjcvz8J174Z490sHXCS+oGfNI45pQSKax26MibzT 3LIBv+M7ysdAeMZy2nHpJPMtbqYLeXF3SmqG0mj5kU6CToR/0gZ51ZzEOqXiMgaXXSY5 3YuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Sn+M7/7Z; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si237330pfh.50.2018.03.18.15.43.36; Sun, 18 Mar 2018 15:43: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=@microsoft.com header.s=selector1 header.b=Sn+M7/7Z; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754823AbeCRWmI (ORCPT + 99 others); Sun, 18 Mar 2018 18:42:08 -0400 Received: from mail-co1nam03on0104.outbound.protection.outlook.com ([104.47.40.104]:7296 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754301AbeCRWmD (ORCPT ); Sun, 18 Mar 2018 18:42:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UtJVG7hgSbwsXhR0LA9uw3OGKg6jyoTetDNYhhgBSUE=; b=Sn+M7/7ZaNWT+A/CeomKz5ChvhaEkkzOLzD2z1Z/YMa7zSlujrDWxH5PfmuWaRdVnPC60znNP2shCZIzblt/xrQM33TxKqo/ztiWRZYTnKQQq4rkUCqo2whikDphDTm2FGuzSL52aXaAlAgiQ7JKe8BD6yP/wjv7Loi6dXZW9Do= Received: from DM5PR2101MB1030.namprd21.prod.outlook.com (52.132.128.11) by DM5PR2101MB1080.namprd21.prod.outlook.com (52.132.130.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Sun, 18 Mar 2018 22:42:01 +0000 Received: from DM5PR2101MB1030.namprd21.prod.outlook.com ([fe80::14f:785d:71f2:d396]) by DM5PR2101MB1030.namprd21.prod.outlook.com ([fe80::14f:785d:71f2:d396%4]) with mapi id 15.20.0631.002; Sun, 18 Mar 2018 22:42:00 +0000 From: "Michael Kelley (EOSG)" To: Jia-Ju Bai , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "bhelgaas@google.com" CC: "devel@linuxdriverproject.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 2/2] pci: host: pci-hyperv: Replace GFP_ATOMIC with GFP_KERNEL in new_pcichild_device Thread-Topic: [PATCH 2/2] pci: host: pci-hyperv: Replace GFP_ATOMIC with GFP_KERNEL in new_pcichild_device Thread-Index: AQHTvsjq1bq08Tgi00ewLH9desMDpaPWlsvw Date: Sun, 18 Mar 2018 22:42:00 +0000 Message-ID: References: <1521384808-23627-1-git-send-email-baijiaju1990@gmail.com> In-Reply-To: <1521384808-23627-1-git-send-email-baijiaju1990@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=mikelley@ntdev.microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-03-18T22:41:59.3937081Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [24.22.167.197] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1080;7:P/eIK42TKW7OCgvPKnVCbXTCp5Ty6dYitOZn1DIro+OMRBMUlNs7qicIjexlb+pJt/XBmc5zYmZu+6UcNoxhi3904pCci3Mthh0eIjyh1Hle6VlzUacUFpJ3RSGHVV4WLADTXWrYfBzujtBUYSNc0073qJ/o135u5KZybo1scMx8kVVpmhgPxaQOadJKMlVDiHt4ZdJzNzr//oyPrbmOcPgkL3RRNf41SnYrqfBERpGdEgvkLf1VSo8n0L9OiZyN;20:ByD+d1Cq+RGFwThdJ9SQ6/uHbWuW7qONsgvYfbBMeNdWjFzwWHLU3bUWtstLahcQk5nYZwP6mEYAb/cAhdddlXgox93aLCtG7KF0fFDETBNe4t+KCZqg9PniLq6Pbjm6ekAtL5sXuGniA3t9QH3CvOwMblAvlhYpm/+1yoaUdng= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4a11e65f-9afe-48f2-6286-08d58d2176d2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1080; x-ms-traffictypediagnostic: DM5PR2101MB1080: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Michael.H.Kelley@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(9452136761055)(85827821059158)(788757137089)(211936372134217); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231221)(944501300)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB1080;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1080; x-forefront-prvs: 06157D541C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(376002)(396003)(346002)(366004)(199004)(189003)(13464003)(74316002)(5660300001)(3660700001)(2906002)(76176011)(54906003)(110136005)(53936002)(186003)(39060400002)(4326008)(6116002)(3846002)(3280700002)(99286004)(97736004)(2950100002)(316002)(106356001)(6436002)(26005)(7696005)(9686003)(6246003)(55016002)(81156014)(81166006)(8676002)(305945005)(10090500001)(10290500003)(478600001)(33656002)(1511001)(8990500004)(72206003)(22452003)(105586002)(86362001)(8936002)(86612001)(25786009)(102836004)(2501003)(5250100002)(14454004)(53546011)(6506007)(59450400001)(68736007)(229853002)(2900100001)(66066001)(7736002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1080;H:DM5PR2101MB1030.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ik7wh/wSsqI/ULhIcaIYlsXl5PKbfO+lkGVFJL+Z6Yt3I72H/6KDKhM8XIcb6QxfVF97fyUJigcc3QK+aKzWeP78Ejg/3rQIUfX/PB1PhEFDTEqdX33xBxerhxbCXa/ykUDZq0W81tap+/7BqeTSVr1/3wfpAV8kVKIYtDwA7lMNhg6Tuo+ZXwP2w79iO5hQddKG0Uulg7HM65CG6vlf++We7Enqvu7q+XTpHj2EVNc8Sd2nIyiK7vZeRK8q29NMliQ5C9tGGgIqFfh6pMCCmAe49pQr3lifs6RUYuKZ+qSs3oLKR4l4zF77SBQUDRghv/IxReX3KKrFxQ/7HL2pgQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a11e65f-9afe-48f2-6286-08d58d2176d2 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2018 22:42:00.7778 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1080 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: linux-kernel-owner@vger.kernel.org On Behalf > Of Jia-Ju Bai > Sent: Sunday, March 18, 2018 7:53 AM > To: KY Srinivasan ; Haiyang Zhang ; Stephen > Hemminger ; bhelgaas@google.com > Cc: devel@linuxdriverproject.org; linux-pci@vger.kernel.org; linux-kernel= @vger.kernel.org; > Jia-Ju Bai > Subject: [PATCH 2/2] pci: host: pci-hyperv: Replace GFP_ATOMIC with GFP_K= ERNEL in > new_pcichild_device >=20 > new_pcichild_device() is not called in atomic context. >=20 > The call chain ending up at new_pcichild_device() is: > [1] new_pcichild_device() <- pci_devices_present_work() > pci_devices_present_work() is only set in INIT_WORK(). >=20 > Despite never getting called from atomic context, > new_pcichild_device() calls kzalloc with GFP_ATOMIC, > which waits busily for allocation. > GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL > to avoid busy waiting. >=20 > This is found by a static analysis tool named DCNS written by myself. >=20 > Signed-off-by: Jia-Ju Bai Reviewed-by: Michael Kelley > --- > drivers/pci/host/pci-hyperv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.= c > index 0fe3ea1..289e31d 100644 > --- a/drivers/pci/host/pci-hyperv.c > +++ b/drivers/pci/host/pci-hyperv.c > @@ -1500,7 +1500,7 @@ static struct hv_pci_dev *new_pcichild_device(struc= t > hv_pcibus_device *hbus, > unsigned long flags; > int ret; >=20 > - hpdev =3D kzalloc(sizeof(*hpdev), GFP_ATOMIC); > + hpdev =3D kzalloc(sizeof(*hpdev), GFP_KERNEL); > if (!hpdev) > return NULL; >=20 > -- > 1.9.1