Received: by 10.192.165.148 with SMTP id m20csp1873416imm; Thu, 3 May 2018 06:50:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpA0doKyyYf7RH28KSKCpzIWoU+I9Opvf4FQOQzTqBXLIAZrF1WitTfkm6oBfQZ5h7zCrI1 X-Received: by 2002:a63:7a07:: with SMTP id v7-v6mr19297709pgc.343.1525355442403; Thu, 03 May 2018 06:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525355442; cv=none; d=google.com; s=arc-20160816; b=mIGI6kU0MvQyjC5QlVFGhKRcRhnaBLKRejUDtu5Crd7EwnMOkFx4AIVYQzxOm60oH/ oT8W2eCT8eKJJJsrmuQrmFYqQUY09q3CdRWfgVbVMIxiAJ3LSyRr31AxejDKneJMWaaR mJ9vmQ/yOPPXUzIFLI3qBbl0+DSf9GKa3EkV2oTFrUiiZRpxR2Wbqw+8JR5JvtHvwEmn QIyrQDveemxTj1/K/78Y8f+Bnz89ddPO5N78n3z0qKby+QEmm6grpANDSBTRelSIgPyY 8m0a6nSpNNDQnOpLrOJy5WpJNmYnvL+tHkYLHtLnwNxJozX1GHfQdUtCBg5VfQa9Ed5I 6gnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=9ECBiFHJ8d5e+C50YsEcb6XgHwzcDaje4JoU0TpPNOw=; b=FOFMTcevFGxMVaSj++j2XgVboHcLZgF1GnDKxvLcJBoHmD8umdOMmc5hTTPvJnD+9a 7EJmLbFf/XqWezQxgbUAROrZ3ZyQ7xk/U7flw6Bn/BBt06PJzvM+JU1vEJtY0MBkNRbJ U942ZUsVxokP/g7n98StzUihj5atV5iOt1/mv1Mds7cEVBpfaRDkCSD5JBLlTdCdfzoY RA3CAxlxGGn+0d/25Rn1dCEJ6jpUoXhJLeBV8ZX8eB/Xkjv/GTv7yLriQRdvkXmIpSxq 4dM5YJHP+n9isyzrIeoPXsJG4fAiJ9LxZqIaPKhQXBhffVJWmbrzBx7jE+a+sy3qfayB Gvew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SwED7mwE; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si13914656pfh.358.2018.05.03.06.49.58; Thu, 03 May 2018 06:50:42 -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=@gmail.com header.s=20161025 header.b=SwED7mwE; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751277AbeECNqM (ORCPT + 99 others); Thu, 3 May 2018 09:46:12 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:41166 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007AbeECNqH (ORCPT ); Thu, 3 May 2018 09:46:07 -0400 Received: by mail-oi0-f49.google.com with SMTP id 11-v6so16083999ois.8; Thu, 03 May 2018 06:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9ECBiFHJ8d5e+C50YsEcb6XgHwzcDaje4JoU0TpPNOw=; b=SwED7mwEjLXq0AUADwc3yYKZ7sh9i6Rgqp4UiFTPGV7lrDvFLy7fd4nV00mraRY1w3 sDShKa3kOIH9Wdz0sg+q0yNPYbv6NLnyRSZz9wToLk6C/wtKAGp2Gtam7LVI0eO/kWGB rgKYez9zxwvrYdc36UqSg7+M3rx8Hy0yWNbykbtp/oeSt6AKywzTbsQvxECCjjfBn/3k vwfSn2MbIGvxTY7eb961cJpK9uDhJ6vDkzviYpw2+WRuWCm5YU6Mhh07B1t7U4iAuwKr S76O+qfCgG+U0AQlljsdPhP6ofsu45KhWOVAtZZscM1sPe3bgsXZWAh7DrLeDx8bmbcz 4aXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9ECBiFHJ8d5e+C50YsEcb6XgHwzcDaje4JoU0TpPNOw=; b=s7JF/CMmTlC1741usKzuX75p+Cnf/+P6ZdP5wRvhzQM6Iksx+a1kftVE2ze+zeBSPm AQRkyp3yN0yvRDApwkJBvXJXssfeN9xlQ1kaB3YKQZNGIJmihSIb7cn5/lHeH8HoJzcx ujVv9Ls2KNwKBSpssH1dfBtCNYvVjzwbS0Tzme4tvuBrw/5H9rwOGDjSfRdtLmQeAAx7 MPEQ9wFESXiBCPF+k6tAzvn1V4R5y0znQ4VMpn6mgcXb6tpnmLbhpEBOXanhPksCFxQ7 WBuGt2j1mSQQbd9HLfwL2jjyIu45JQrH+PU58gnsQPDksL/Yvi8lVifpIuV7+Swxf+Wf COJA== X-Gm-Message-State: ALQs6tAWBeJupej6Yg0gMWlGEuThExGDYl14BratZITSRYiNjButDXjs n1++A8JhNHELxvLvAdspcaY8Bn5rt7MpG/Uva9w= X-Received: by 2002:aca:5603:: with SMTP id k3-v6mr13482574oib.77.1525355166281; Thu, 03 May 2018 06:46:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.201.10.209 with HTTP; Thu, 3 May 2018 06:46:05 -0700 (PDT) In-Reply-To: References: <20180503035931.22439-1-pasha.tatashin@oracle.com> <20180503035931.22439-2-pasha.tatashin@oracle.com> From: Alexander Duyck Date: Thu, 3 May 2018 06:46:05 -0700 Message-ID: Subject: Re: [PATCH 1/2] ixgbe: release lock for the duration of ixgbe_suspend_close() To: Pavel Tatashin Cc: Steven Sistare , Daniel Jordan , LKML , Jeff Kirsher , intel-wired-lan , Netdev , Greg KH Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. - Alex