Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751598AbdHPDjh (ORCPT ); Tue, 15 Aug 2017 23:39:37 -0400 Received: from mail-hk2apc01on0116.outbound.protection.outlook.com ([104.47.124.116]:28736 "EHLO APC01-HK2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751482AbdHPDjf (ORCPT ); Tue, 15 Aug 2017 23:39:35 -0400 From: Dexuan Cui To: "gregkh@linuxfoundation.org" , "devel@linuxdriverproject.org" CC: KY Srinivasan , Stephen Hemminger , Haiyang Zhang , "linux-kernel@vger.kernel.org" , "olaf@aepfle.de" , Vitaly Kuznetsov , "jasowang@redhat.com" , "apw@canonical.com" , Andy Lutomirski , "marcelo.cerri@canonical.com" , "leann.ogasawara@canonical.com" , "Rolf Neugebauer" , "'Marcelo Cerri'" Subject: [PATCH] vmbus: suppress uevents for hv_sock devices Thread-Topic: [PATCH] vmbus: suppress uevents for hv_sock devices Thread-Index: AdMWQTtcRpN+WiJfTHaU8bHwvhPqiw== Date: Wed, 16 Aug 2017 03:39:17 +0000 Message-ID: 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_Ref=https://api.informationprotection.azure.com/api/72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=decui@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-08-15T20:39:15.0558832-07:00; 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: [167.220.1.80] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;KL1P15301MB0040;6:E0FXBRkw11VnFUNGY+bKY1bzMPZmGSJlIEyLHJYaO0R3acUOZFP7BVTinH/IFpIxuHJJDXA/NgWhPhZoMV17GNWItNJJq5OghYSn4yI9fDY/SZ2OJjRy0+Tkn4M3GghyOLxyGiYOT0uqbpirVzpGOlsB1KxDNa4loD6av1qYZvGbY8tyIordV91bt0LJQLs7RW1l+6jS0R6T/2rLTfB1r5W7W+zUPlM6VjeoXasx2n5UHSUokmfMphnyMmsiEZpNJIiKHPJ8+sA1tGXm8PXIfGKk4UdozvhyWUkfi5hv5nPnetDhSrEv/gCv32jYTY/W7fkESkr1CLkWZX1U5sn1Yw==;5:WsnpTbF2gtxfb7IYv1JJ7PWoRrkwqXVRvoRAZ7vPmbSWqJRAwDIRQKf60mNB20dq5K46sSkazcLMd3QNCYsxU+TYq5G1rjveJQ/QcV32z6aJQknHB5czQco+NqBBz7d10s132mZo+ABOmRmYEf49mA==;24:g202y+gBEf8SXs2PL9KjhAxCQ67oTk80c3wzgLK0LTv2XC+e1GY5qEqRkZ+Ut5SOhReBKx02yB/l8dIB44P72iSUDPHXt/X+9+1YF2yvRtg=;7:lAVyRj4+u56KbGPUs+JISMNiaXkw1Bhn5eATUv1cEKDrgJdr+Xjx6NiY6R323cF4IPxf3J0BwNYLnwe2TPWNGMcGhx+sw9vghPJddowkIzb64iF1SpLAhBpN3EGibK4uPKZzYoHybEorE83CEjrqDwmwF/oNm649j3r3HXUJRQl+zjTyiKmUOEy79cZVATicq7e2bRxhDVkXQHIdsYqmdnSI3GMBSHEUMDYFUhJFQrs= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(189002)(199003)(305945005)(7736002)(74316002)(189998001)(86362001)(575784001)(101416001)(86612001)(68736007)(8990500004)(5005710100001)(66066001)(54356999)(3280700002)(5660300001)(3660700001)(3846002)(4326008)(50986999)(25786009)(7416002)(6116002)(102836003)(6436002)(97736004)(10090500001)(106356001)(2501003)(53936002)(8936002)(2906002)(54906002)(10290500003)(2900100001)(55016002)(9686003)(8676002)(81156014)(81166006)(14454004)(105586002)(33656002)(478600001)(77096006)(6506006)(7696004);DIR:OUT;SFP:1102;SCL:1;SRVR:KL1P15301MB0040;H:KL1P15301MB0008.APCP153.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: 9d6a2016-e2d5-460c-a683-08d4e4585fe4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:KL1P15301MB0040; x-ms-traffictypediagnostic: KL1P15301MB0040: x-exchange-antispam-report-test: UriScan:(89211679590171); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:KL1P15301MB0040;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:KL1P15301MB0040; x-forefront-prvs: 0401647B7F spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2017 03:39:17.9095 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0040 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v7G3dhB5009407 Content-Length: 1249 Lines: 34 hv_sock driver is automatically loaded when an application creates an AF_VSOCK socket, so we don't really need to trigger uevents to the user space udevd. And hv_sock devices can appear and disappear frequency, e.g. 100 per second, so triggering the udevents can cause a high cpu utilization of udevd, e.g. 30% on a 2-cpu virtual machine. So let's suppress the uevents to avoid this. Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger --- drivers/hv/vmbus_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index ed84e96..a0cf592 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1171,6 +1171,8 @@ int vmbus_device_register(struct hv_device *child_device_obj) child_device_obj->device.parent = &hv_acpi_dev->dev; child_device_obj->device.release = vmbus_device_release; + if (is_hvsock_channel(child_device_obj->channel)) + dev_set_uevent_suppress(&child_device_obj->device, 1); /* * Register with the LDM. This will kick off the driver/device * binding...which will eventually call vmbus_match() and vmbus_probe() -- 2.7.4