Received: by 10.192.165.148 with SMTP id m20csp1290994imm; Sat, 5 May 2018 08:43:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrHx4/WGF7Odq47J/lK+LUCpBlATMgqeUA0p33j5rXG/2HVNX6zBJTho9nvn2LwYbZr/nBY X-Received: by 10.98.24.214 with SMTP id 205mr30962759pfy.242.1525535003755; Sat, 05 May 2018 08:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525535003; cv=none; d=google.com; s=arc-20160816; b=nonTANtO0t1tAowRgd1nR2Mh6n3xOm6I3i652zBnXFbgvPSQ3Uof+uOLYKrG/sTzcu WPOzKnYbsml7UHi0wKL/POLOl9zX2VZw900gQXhgA4pUifqfxWcIhhlwywwFttzmOan4 PdYjHYkeetbdfbHOS2m5mV+RUf/YXWL+16Ss+o1FktXv0ubKA2FKuxrCfq6Fha4H1FzG rQCtOMhl/+Hyxr4u+gH04jZlQ2n30DY9mfZTXS2Ay/A9APzWb3NPlh2KZl33PUvSCZnn vVjCtF0X0TngbB088tSCpjRWhkqEPx92HvRvePiZvAXLpqpOFronM8YfaCR1qSB1XWsc kp5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :dkim-signature:arc-authentication-results; bh=tUNkougXXVEpV9NokOp656mu1i3zN2B/BaDZFgQHAk8=; b=Gqxui+qm2qTyKHpwE+wQrsgYXVc6IDDCCLk4rw3krcAVrOrqYbNRrCIkOT0jmc61F9 1isn1Et9L2gzYBaoG1OZDhLaEimfDIZTu0oGfBo+u6esGU6Fau447oFpKBEMuEMhC2+G Wnl2CE2pGaePZIfUZrqa+53REby77qw8fBUMsXZDA+7XeQx7JlV6Zley1opzioTeW6OP dR9Q9lEQ0ES1Q5wo87BaPnItkbwkcNNoVlazpAX29w/460Z0cWldqzb598r/C8A2SVVe rVKTtzIq2N+xbcsRFEB7S67/fWzRKnQwIg3FivjPZJoCBvUeHnBwlsaPlVpovpL4YPFx S8zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=uqV8oKZ3; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b190-v6si6763646pgc.18.2018.05.05.08.43.09; Sat, 05 May 2018 08:43:23 -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=@oracle.com header.s=corp-2017-10-26 header.b=uqV8oKZ3; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751193AbeEEPk4 (ORCPT + 99 others); Sat, 5 May 2018 11:40:56 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:59402 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751218AbeEEPkx (ORCPT ); Sat, 5 May 2018 11:40:53 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w45FdFTI070123; Sat, 5 May 2018 15:40:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id; s=corp-2017-10-26; bh=tUNkougXXVEpV9NokOp656mu1i3zN2B/BaDZFgQHAk8=; b=uqV8oKZ3D1Ny2N5z5r40dvV0nwAIgrHDnAMctqiz+9H2RRdJbzO8xU3/dfb0TXGXEbzK ZgzNHtP8lL/RGrAyO9OHzUr/ZLiUEYVbW75i2H3cCG5dnlZ/IYFRgLmVsVjtwUQPKEwU 69CaiNFUzhYvLgMGYpMAzCt2wR/cGjQU/0EGC/fglpnMrZdLoxPXI/C7jokykw8OqLk6 ZKmrD7vfCD/FrhqEZZZgL+5pq88vJVrv6wrILLSG1rMaY2z481xVlg+dCPAXiKeS4ahX nI/1SK7reaMI1RfGn+3QLMW9fo0OUh1Y2sDcx3S4xwu4Fy4agNWPKfq2q0HvwNi3x5/E mQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2hs24s8rhq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 05 May 2018 15:40:46 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w45Fejlx000671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 5 May 2018 15:40:45 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w45FejZF024908; Sat, 5 May 2018 15:40:45 GMT Received: from localhost.localdomain (/73.69.118.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 05 May 2018 08:40:44 -0700 From: Pavel Tatashin To: pasha.tatashin@oracle.com, steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, jeffrey.t.kirsher@intel.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, gregkh@linuxfoundation.org, alexander.duyck@gmail.com, tobin@apporbit.com Subject: [PATCH v2 0/1] multi-threading device shutdown Date: Sat, 5 May 2018 11:40:39 -0400 Message-Id: <20180505154040.28614-1-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.17.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8884 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=916 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805050154 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changelog v1 - v2 - It turns out we cannot lock more than MAX_LOCK_DEPTH by a single thread. (By default this value is 48), and is used to detect deadlocks. So, I re-wrote the code to only lock one devices per thread instead of pre-locking all devices by the main thread. - Addressed comments from Tobin C. Harding. - As suggested by Alexander Duyck removed ixgbe changes. It can be done as a separate work scaling RTNL mutex. Do a faster shutdown by calling dev->*->shutdown(dev) in parallel. device_shutdown() calls these functions for every single device but only using one thread. Since, nothing else is running on the machine by the device_shutdown() s called, there is no reason not to utilize all the available CPU resources. Pavel Tatashin (1): drivers core: multi-threading device shutdown drivers/base/core.c | 275 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 225 insertions(+), 50 deletions(-) -- 2.17.0