From patchwork Sun May 3 05:22:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cong Wang X-Patchwork-Id: 220037 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 C73F9C28CBC for ; Sun, 3 May 2020 05:22:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2BCB2073E for ; Sun, 3 May 2020 05:22:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CLDPsok+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726931AbgECFWd (ORCPT ); Sun, 3 May 2020 01:22:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbgECFWc (ORCPT ); Sun, 3 May 2020 01:22:32 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 605DEC061A0E for ; Sat, 2 May 2020 22:22:32 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id s20so5450754plp.6 for ; Sat, 02 May 2020 22:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OFyrx6PpnSEM4JIQUWvZhg8s9oAf8apq2thy03m41rg=; b=CLDPsok+Qby6cSiU1gLlV6Sp7813rC+peIfkIG/npQMIbQYR+kNI4MGNHdx8b2qMPu z1T0u7ETVw/8eZGBYtVJ648zIjIYBZm6GdT96lcCWqkSEUzQqdt1namD9sABj/fLBcGi SolCgUWMYMENYcTEP44nhKnAmTt8q1HbRBW5pIVAmYl7eeOpW+DaEZoFTDqQJpP8JGnX u2V+kDkFDIh3xDP1zCaIJqv1zL5iKtZD0R9nSfMjLT2FaKeLSsPshvvhQEUq/SiR3ZEJ c5/L1W5hPy+poaO56c8puh7g1I6SeeHMMaL2XJeymbZx436P9gXscPNVWXRrfZabqd0d JIEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OFyrx6PpnSEM4JIQUWvZhg8s9oAf8apq2thy03m41rg=; b=RzQUa65yWOaHg5y/evY/nGOewtsd+nEQEWcUW9EDbgAvEpGt8VRgxZNMyQChJ+1iNl b2mF/ivOVVYwlULYgWZoTNTA+oT1CnQ+EAg/6miBVdh2LAPMacYdQWTKKS8N4g1gtFZH X/55UUQGFPCctL7fpZo6ZpHNu7n5vcTI0/0TC1RJcxagir5g1Y4Cn5JPwaLG2tDTf9fL f/a4SfAkf92ZLQF0eh1kRmcvgCM409ypl3l31QvbddQOh/fAB3lNdGAbqO96rTxTZahI hU5XPjnTZqPttt54db8MsXRN0yppYP2eUevYeE9pZJyUl2bK2ryOCO2zXO/psz0RgMDf 3/mA== X-Gm-Message-State: AGi0PuajaPKee+o/o1clhaoY54yrJ23H9Ko6zGNqLLjM7Cbcj1O+t/k1 bPMVk6kWjJ3a3IGw6ukovGd+wnZtI14= X-Google-Smtp-Source: APiQypIX216u5FCOc6vEBHx3ic7az8vX/H5iRK4i06eBu1fukURwIs6adAnaoMSCh1bRhqtztcaM+A== X-Received: by 2002:a17:90b:34c:: with SMTP id fh12mr9600529pjb.134.1588483351660; Sat, 02 May 2020 22:22:31 -0700 (PDT) Received: from MacBookAir.linux-6brj.site (99-174-169-255.lightspeed.sntcca.sbcglobal.net. [99.174.169.255]) by smtp.gmail.com with ESMTPSA id y3sm3499597pjb.41.2020.05.02.22.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 May 2020 22:22:31 -0700 (PDT) From: Cong Wang To: netdev@vger.kernel.org Cc: Cong Wang , syzbot+aaa6fa4949cc5d9b7b25@syzkaller.appspotmail.com, Dmitry Vyukov , Taehee Yoo Subject: [Patch net-next v2 2/2] bonding: remove useless stats_lock_key Date: Sat, 2 May 2020 22:22:20 -0700 Message-Id: <20200503052220.4536-3-xiyou.wangcong@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200503052220.4536-1-xiyou.wangcong@gmail.com> References: <20200503052220.4536-1-xiyou.wangcong@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org After commit b3e80d44f5b1 ("bonding: fix lockdep warning in bond_get_stats()") the dynamic key is no longer necessary, as we compute nest level at run-time. So, we can just remove it to save some lockdep key entries. Test commands: ip link add bond0 type bond ip link add bond1 type bond ip link set bond0 master bond1 ip link set bond0 nomaster ip link set bond1 master bond0 Reported-and-tested-by: syzbot+aaa6fa4949cc5d9b7b25@syzkaller.appspotmail.com Cc: Dmitry Vyukov Acked-by: Taehee Yoo Signed-off-by: Cong Wang --- drivers/net/bonding/bond_main.c | 3 --- include/net/bonding.h | 1 - 2 files changed, 4 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index d01871321d22..baa93191dfdd 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -4491,7 +4491,6 @@ static void bond_uninit(struct net_device *bond_dev) list_del(&bond->bond_list); - lockdep_unregister_key(&bond->stats_lock_key); bond_debug_unregister(bond); } @@ -4896,8 +4895,6 @@ static int bond_init(struct net_device *bond_dev) return -ENOMEM; spin_lock_init(&bond->stats_lock); - lockdep_register_key(&bond->stats_lock_key); - lockdep_set_class(&bond->stats_lock, &bond->stats_lock_key); netdev_lockdep_set_classes(bond_dev); list_add_tail(&bond->bond_list, &bn->dev_list); diff --git a/include/net/bonding.h b/include/net/bonding.h index dc2ce31a1f52..0b696da5c115 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h @@ -237,7 +237,6 @@ struct bonding { struct dentry *debug_dir; #endif /* CONFIG_DEBUG_FS */ struct rtnl_link_stats64 bond_stats; - struct lock_class_key stats_lock_key; }; #define bond_slave_get_rcu(dev) \