From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAFCBC63777 for ; Mon, 30 Nov 2020 20:27:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 539FE2073C for ; Mon, 30 Nov 2020 20:27:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y08zZ0o5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729061AbgK3U1K (ORCPT ); Mon, 30 Nov 2020 15:27:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728678AbgK3U1K (ORCPT ); Mon, 30 Nov 2020 15:27:10 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36EC8C0613D2 for ; Mon, 30 Nov 2020 12:26:29 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id b2so5915676edy.13 for ; Mon, 30 Nov 2020 12:26:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=VZ91AD9a8KB2t44DjmgIujBvV7lH7SAq0CPsyQ5BDYE=; b=Y08zZ0o58RFPH/ushSxdUAwglT5skL7ETEJ1fzUauELeVPVsFQDBmY/bHmaM8tyjd5 e3GPKM4dOKeGTe/camRwLDzsffnXHxtzcvjaKQKmR6mxQMJnJ1A3nbk6gKtowjKOaJZQ LsxPZ/gcZc69qHPaDG7RQB3fk2JfSgvNYE87DvVgpa//wHu6kSsqQfvE+JUT8X7cZWfG Sr95s3ZYwnTEugTLJx9Db3BqwOQcG5tbhBK1Uesp+zhv+w5CnfsX3t5qgxuS1+1mol03 ly9lSQgEFhCarw4hZfCeHk3jajKjg1LmhGLDZGMcN9/xoLL2C9vJNgK02+Jl2kMdlYEz Imbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VZ91AD9a8KB2t44DjmgIujBvV7lH7SAq0CPsyQ5BDYE=; b=O03ONWfVyy97uE06RAR5YQdjzMZ54SL0gRwXRrxTQ4RrBHltKLoOU/nibpoiAXjJd8 58vIYlkNAAnVfyVTiFuJ/ovwBv+FmZTBHlJhlyGKw4Pd+EJys6BWhRrFKSz0REykcYaQ insOGGmN2/xtByGXloPTKwCT+2iNff9febiNVl0OWc4i9eqTYvsggAfcp+S16tyj7wND b5Ge2ZGvEwgMh2exFeScm1zyLYDgIYZn6BZI5VnpQL07eDmX8TFKfqTpJXmuAx44+7Aj zEJeNwKZX/vQs5aAnFXRAzPASz0Zq72MD9HYWEwOgLJdXRyHm5/vUkJMHZF7X1XqK6rV 9XNg== X-Gm-Message-State: AOAM530dcdmzjBlcycrBF9Cyr3YvR4iP06AFE0cNfiIKtbeukqacG7ZI z4WaMg7vmQxDbRm46kpN0G4MgvBeOzg= X-Google-Smtp-Source: ABdhPJxPH2kwfST5LxZ30DMK7tSXn1fs5pi5BbUS1944CllDWAy6BdiAy/HEc5/Zqb8EMV2pfrc13w== X-Received: by 2002:aa7:ca41:: with SMTP id j1mr24631600edt.295.1606767987935; Mon, 30 Nov 2020 12:26:27 -0800 (PST) Received: from skbuf ([188.25.2.120]) by smtp.gmail.com with ESMTPSA id n22sm9437016edo.43.2020.11.30.12.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 12:26:27 -0800 (PST) Date: Mon, 30 Nov 2020 22:26:26 +0200 From: Vladimir Oltean To: Stephen Hemminger Cc: Eric Dumazet , Eric Dumazet , Jakub Kicinski , netdev , Paul Gortmaker , Jiri Benc , Or Gerlitz , Cong Wang , Jamal Hadi Salim , Andrew Lunn , Florian Fainelli Subject: Re: Correct usage of dev_base_lock in 2020 Message-ID: <20201130202626.cnwzvzc6yhd745si@skbuf> References: <20201129205817.hti2l4hm2fbp2iwy@skbuf> <20201129211230.4d704931@hermes.local> <20201130101405.73901b17@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com> <20201130184828.x56bwxxiwydsxt3k@skbuf> <20201130190348.ayg7yn5fieyr4ksy@skbuf> <20201130194617.kzfltaqccbbfq6jr@skbuf> <20201130122129.21f9a910@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201130122129.21f9a910@hermes.local> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Nov 30, 2020 at 12:21:29PM -0800, Stephen Hemminger wrote: > if device is in a private list (in bond device), the way to handle > this is to use dev_hold() to keep a ref count. Correct, dev_hold is a tool that can also be used. But it is a tool that does not solve the general problem - only particular ones. See the other interesting callers of dev_get_stats in parisc, appldata, net_failover. We can't ignore that RTNL is used for write-side locking forever.