Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1226486imm; Wed, 13 Jun 2018 15:51:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK4+qKd/H3uMVrIYdzsEcL6N1z5EEfNuYYnu8tZ3F7LIUS2H7bpJojJtQzR/1m59GDZj+SS X-Received: by 2002:a65:608c:: with SMTP id t12-v6mr77649pgu.159.1528930261370; Wed, 13 Jun 2018 15:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528930261; cv=none; d=google.com; s=arc-20160816; b=gGGgC4qNJrfEVNxfSC9aUNYoGCeVyXlOhU60PS8AXgbY+Kp3TUBGnRBR91e9H9Ftcs eiKVGnT+wGQuruwL3n8+4nK1tx4nMXQTfB3teZyYHBXMEYt9Nyx/5UlTbHDZ4bpHwCNu N02hOZOV1ZsBDXQKXyGYU1r4lnwZqADTmR1psH/l+D5PSjsnXXliERe3yoCFsS+TjfsH c6Wytaxb8cVaCPO8cXn52NOsiCzm2eKOiYoGCIZvmgkjJQwDXDIL8Yv/SLsgU67HtXin RuvulX4zTtQGIbQvQsnw9hl9IBW5Xf8FD8HGMgh4md61wVy+30ThYtDbdPIhH/RZfxXg Dmsw== 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=/yCxsG+J9gMSPfVWUnDtqHNQzFo+WgtCpYqhUCnhgCg=; b=lF0zoXmwHnhVBmSW7JfYMpkQSsLqUK9JX2kzBhJaKRtuGJFQJbp/i+8t4anbW8LuX1 w4lZkHEwInp3FSSLtCBRxkZdSiVyFCz22jEBoyxOSh5jTltRMOLJe5+jsJEHMvo8azMz xmEYt6dMmO3sJEgZ6CyXv2JJTU9scLs02MtzX0sMKxR9NLnGTXltb0nfIaSSxnk7UCiJ vHCAynrfAe5t0tdQEoCidU7lYED/QsEeB4sYYEI77V8n8pHmuEnTn8yWIBvL1e32/5Ih QX3VJAr1BoMmyyQyhxwkmKvy+ytxv7PgJJO5uWy3B8rXtNKeneoN2poHWzEa7GBP4N18 aO7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=V+7IVayB; 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 x66-v6si3095850pgb.297.2018.06.13.15.50.45; Wed, 13 Jun 2018 15:51:01 -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=V+7IVayB; 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 S1754571AbeFMWuW (ORCPT + 99 others); Wed, 13 Jun 2018 18:50:22 -0400 Received: from mail-pu1apc01on0137.outbound.protection.outlook.com ([104.47.126.137]:31584 "EHLO APC01-PU1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754498AbeFMWuU (ORCPT ); Wed, 13 Jun 2018 18:50:20 -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:X-MS-Exchange-SenderADCheck; bh=/yCxsG+J9gMSPfVWUnDtqHNQzFo+WgtCpYqhUCnhgCg=; b=V+7IVayBiTjvjNdm1GABKMSmus7ZjCwaWm6GTYcUFQ0+96RKouhIx/ntBPnjmeBo0rbJ8JTsUN5XZmkBKSAnMAxMeRDRTtndmF6NeeF7RxdVfCo0/mxSGUN82wYGpFo4yqSWwmiE/qkKo9GZBT0lkCVCZHVFoCY1RrHoD9pS7cM= Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM (10.170.167.17) by KL1P15301MB0037.APCP153.PROD.OUTLOOK.COM (10.170.167.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.9; Wed, 13 Jun 2018 22:50:06 +0000 Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([fe80::91a9:30c3:c99f:a8bc]) by KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([fe80::91a9:30c3:c99f:a8bc%6]) with mapi id 15.20.0884.010; Wed, 13 Jun 2018 22:50:06 +0000 From: Dexuan Cui To: Bjorn Helgaas CC: 'Bjorn Helgaas' , Haiyang Zhang , 'Lorenzo Pieralisi' , "'linux-pci@vger.kernel.org'" , KY Srinivasan , Stephen Hemminger , "'olaf@aepfle.de'" , "'apw@canonical.com'" , "'jasowang@redhat.com'" , "'linux-kernel@vger.kernel.org'" , "'driverdev-devel@linuxdriverproject.org'" , "'vkuznets@redhat.com'" , "'marcelo.cerri@canonical.com'" Subject: RE: [PATCH] PCI: hv: Fix a __local_bh_enable_ip warning in hv_compose_msi_msg() Thread-Topic: [PATCH] PCI: hv: Fix a __local_bh_enable_ip warning in hv_compose_msi_msg() Thread-Index: AdPyKucLHxE0xn3+RTSKXedSJeHHcgCNtVtQAmSYQFABWDo6wAADvceAAAAiUoA= Date: Wed, 13 Jun 2018 22:50:05 +0000 Message-ID: References: <20180613221509.GB12463@bjorn-Precision-5520> In-Reply-To: <20180613221509.GB12463@bjorn-Precision-5520> 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=decui@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-06-13T22:50:03.3464909Z; 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 authentication-results: spf=none (sender IP is ) smtp.mailfrom=decui@microsoft.com; x-originating-ip: [2001:4898:80e8:a:c9b:1056:d0e5:5bb1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;KL1P15301MB0037;7:+6+CNQaKfH8gSwvgctHlHrl03zcRJULQSckuL+nDOfGDIhwhExVhmWW0t2HUo+vqQ3l+gWu6s7TebCV75OGu2H6k39U7IYY316RgjiCL/pOOUia44j9soDUd8w9unlSY0HRkdiCuqsGXYmp901RYRvaWm8Lht1rNtBfVbQdox+k6G/M9JnQrSAKlT9u+j++tHWftbNveGsVjIFwEpBlWrE/kpMlVhBctiEKobrLJ4LglFxP1opNkxnwhaJPriajR x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 6dbe3ba9-bbfa-4f18-280e-08d5d18001eb x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:KL1P15301MB0037; x-ms-traffictypediagnostic: KL1P15301MB0037: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:KL1P15301MB0037;BCL:0;PCL:0;RULEID:;SRVR:KL1P15301MB0037; x-forefront-prvs: 07025866F6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(376002)(346002)(39860400002)(39380400002)(396003)(189003)(199004)(68736007)(4326008)(5250100002)(54906003)(99286004)(6436002)(476003)(74316002)(478600001)(186003)(8990500004)(53936002)(486006)(9686003)(25786009)(446003)(22452003)(8676002)(11346002)(316002)(8936002)(81156014)(81166006)(6246003)(93886005)(7736002)(10290500003)(305945005)(6116002)(14454004)(2900100001)(55016002)(10090500001)(3660700001)(86362001)(76176011)(2906002)(229853002)(97736004)(59450400001)(6506007)(5660300001)(33656002)(3280700002)(7696005)(46003)(6916009)(7416002)(106356001)(102836004)(86612001)(105586002);DIR:OUT;SFP:1102;SCL:1;SRVR:KL1P15301MB0037;H:KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ZUEgvla3YjkuTjdejoFNVi/sPGukdLwqAP1JcJU+3ngV/nuXnj2wpejekP90eotow8g4afz+kYvsCE0YUTUIlEI8235mBVlW+hpqA21zRP2jgEfWHlWOsm1i7enVJmbgmgyf+Y7AZLkvA5B95mS9toJLSaS6IhTqfp08n3RbI/qCLV47ywALmLrzEWSWHZDX 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: 6dbe3ba9-bbfa-4f18-280e-08d5d18001eb X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jun 2018 22:50:05.6617 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0037 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Bjorn Helgaas > Sent: Wednesday, June 13, 2018 15:15 > > ... > > It looks Lorenzo's pci.git tree has not been updated for 3+ weeks. > > I guess Lorenzo may be on vacation. > > > > @Bjorn, can this patch go through your tree? > > Should I resubmit it? >=20 > No need to resubmit it, Lorenzo has been out for a bit, but I'm sure > he'll pick this up as he catches up. OK, I see. Thanks! =20 > You might, however, fix the commit log: >=20 > This is not an issue because hv_pci_onchannelcallback() is not slow, > and it not a hot path. >=20 > This has at least one typo (I think you mean "and *is* not a hot > path"). Sorry -- yes, it's a typo. I hope Lorenzo can help to fix this, or I can resubmit it if Lorenzo or you want me to do it. =20 > I also don't understand the sentence as a whole because the > hv_pci_onchannelcallback() comment says it's called whenever the host > sends a packet to this channel, and that *does* sound like a hot path. Sorry for not making it clear. The host only sends a packet into the channel of the guest when there is a change of device configuration (i.e. hot add or remove a device), or the host is responding to the guest's request. The change of device configuration is only triggered on-demand by the administrator on the host, and the guest's requests are one-off when the device is probed. So IMO the callback is not a hot path. > I also don't understand the "hv_pci_onchannelcallback() is not slow" > part. In other words, you're saying hv_pci_onchannelcallback() is > fast and it's not a hot path. And apparently this has something to do > with the difference between local_bh_disable() and local_irq_save()? >=20 > Bjorn Actually in my original internal version of the patch, I did use=20 local_irq_save/restore(). hv_pci_onchannelcallback() itself runs fast, but here since it's in a loop (i.e. the while (!try_wait_for_completion(&comp.comp_pkt.host_event) loop), IIRC I was asked if I really need local_irq_save/restore(), and I answered "not really", so later I switched to local_bh_disable()/enab= le(). However, recently I found that if we enable CONFIG_PROVE_LOCKING=3Dy, the local_bh_enable() can trigger a warning because the function=20 hv_compose_msi_msg() can be called with local IRQs disabled (BTW, hv_compose_msi_msg() can also be called with local IRQS enabled in another code path): IRQs not enabled as expected WARNING: CPU: 0 PID: 408 at kernel/softirq.c:162 __local_bh_enable_ip Despite the warning, the code itself can still work correctly, but IMO we'd better switch back to local_irq_save/restore(), and hence I made the patch. I hope the explanation sounds reasonable. :-) Thanks, -- Dexuan