Received: by 10.192.165.148 with SMTP id m20csp1886936imm; Thu, 3 May 2018 07:02:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrFx+Yl0ow2BdTcdZeS+dG4/OfVdDODxYFQ6dfFqOZrYl3l0y6XMWEdqid5uskXkBT3qbwa X-Received: by 2002:a17:902:290a:: with SMTP id g10-v6mr24086935plb.155.1525356152928; Thu, 03 May 2018 07:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525356152; cv=none; d=google.com; s=arc-20160816; b=1DwtiNN0RveDPCq91+31E/VQ6S4dEWDg72/975G3wqYjmQRizg+wrmEKH7q9Si2TaX Yn5Vkck8l8vPp0NY+B5LIEbl+AJjz7p9cQ0dBjrrD3DTIhVRIIPm883T+xoxBe1s59V0 VdzM+/73Oe3qfUSIC1xNxebErSwdkqdN4IGgOxbW7+IKhC8ESX8hzbpw5bUfEhxnQM/E VuNlYK3KtMjdIapSnjNWFP53e08XFIz2MokG1rg0aknt1hPGYGO+38Kqu/B+KAGfwkbA rypFG8A/+S4jYgbZG2Tg/gXTz7XKpP9gH3mByttr4e1iMl057x8TjeZG02NzsWELFXOX 6JVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=PohBH8dYcnEmHNk0ec8UQQsaVnPdrEVBdn3RQHZPXyk=; b=YgfCKc69iheENZlIf+24iSxYAKtRZA7N5qfy+t1q+o8SqoZw4mms+1blCeLDL0fdiw xZWYZ7gaH1iP/mRgt31mYObXeTBM+Swdf/1J3aDyNlQRflCtBjjjIMqDSPZxE1KlWBJJ lF1J31sEmZNW4aSq4yDbhTZaMYJif4fiFUE0jj1N+NvcJJY3yaBmHSlZo1NElIKdHvty /Usywd1F2r7Dj24HyShyw0AlbomjWqjvCTCWLDde+5S20b5u9estF/PBa4by94UMjpan RwjXWE/skBR7P+u1QjrnGZVymAHU7Yb/jFsKodNZgbrzaQlieADkoudBakwzXg8Zz1no q7JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=AUOx9Fk2; 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 u89si14243043pfa.234.2018.05.03.07.02.17; Thu, 03 May 2018 07:02:32 -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=AUOx9Fk2; 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 S1751276AbeECOCB (ORCPT + 99 others); Thu, 3 May 2018 10:02:01 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:53262 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbeECOB6 (ORCPT ); Thu, 3 May 2018 10:01:58 -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 w43E1Mcr171511; Thu, 3 May 2018 14:01:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=PohBH8dYcnEmHNk0ec8UQQsaVnPdrEVBdn3RQHZPXyk=; b=AUOx9Fk2cpgpaWyEEYSAsqW/qqmLw6Fx4ny8xvVpKczb2gx44YlagLWKuhA0XZHL/Dm/ zjUq9ONGWYkmqXuzSJQj13hf0BhF+9plqkBrSgyMdczc5aFYZQGAFrE02jkZ0v9llu6T c+cr+leCLI5qP21rCQ+QShR3yJG3JR24X7zW7elW/SJe1fr71Rp/4y3u9VkMxoLLuI2U /snV9ib206mYvbbdwibzZBx8dsKSRx3VKb5i/4ZFHoGynmsEYebLjV7xUuPbwKzoiAXd IiP38nJL+kGvPrtqrCfxGelM8wywfUnEZs1HPmtslFP2JeP8L4JZCgE7oBJuzq8Ze6yF ug== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2hmeg621kf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 03 May 2018 14:01:51 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w43E1pm6023013 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 May 2018 14:01:51 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w43E1opS001105; Thu, 3 May 2018 14:01:50 GMT Received: from [10.39.220.240] (/10.39.220.240) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 03 May 2018 07:01:50 -0700 Subject: Re: [PATCH 1/2] ixgbe: release lock for the duration of ixgbe_suspend_close() To: Pavel Tatashin Cc: Alexander Duyck , Daniel Jordan , LKML , Jeff Kirsher , intel-wired-lan , Netdev , Greg KH References: <20180503035931.22439-1-pasha.tatashin@oracle.com> <20180503035931.22439-2-pasha.tatashin@oracle.com> From: Steven Sistare Organization: Oracle Corporation Message-ID: <50c9ac34-3971-ac1b-0b5e-1bfa004fd4cf@oracle.com> Date: Thu, 3 May 2018 10:01:40 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8881 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805030123 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/3/2018 9:46 AM, Alexander Duyck wrote: > On Thu, May 3, 2018 at 6:30 AM, Pavel Tatashin > wrote: >> Hi Alex, > > Hi Pavel, > >>> I'm not a fan of dropping the mutex while we go through >>> ixgbe_close_suspend. I'm concerned it will result in us having a >>> number of races on shutdown. >> >> I would agree, but ixgbe_close_suspend() is already called without this >> mutex from ixgbe_close(). This path is executed also during machine >> shutdown but when kexec'ed. So, it is either an existing bug or there are >> no races. But, because ixgbe_close() is called from the userland, and a >> little earlier than ixgbe_shutdown() I think this means there are no races. > > All callers of ixgbe_close are supposed to already be holding the RTNL > mutex. That is the whole reason why we need to hold it here as the > shutdown path doesn't have the mutex held otherwise. The mutex was > added here because shutdown was racing with the open/close calls. > >> >>> If anything, I think we would need to find a replacement for the mutex >>> that can operate at the per-netdev level if you are wanting to >>> parallelize this. >> >> Yes, if lock is necessary, it can be replaced in this place (and added to >> ixgbe_close()) with something scalable. > > I wouldn't suggest adding yet another lock for all this. Instead it > might make more sense for us to start looking at breaking up the > locking since most of the networking subsystem uses the rtnl_lock call > it might be time to start looking at doing something like cutting back > on the use of this in cases where all the resources needed are > specific to one device and instead have a per device lock that could > address those kind of cases. Hi Pavel, you might want to pull lock optimization out of this patch series. The parallelization by itself is valuable, and optimizations for individual devices including locks can come later. - Steve