Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1206244lql; Tue, 12 Mar 2024 10:05:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXM8uyjHv09qkXQDQZaRs3rw1mM/MAtdnsNyHc2Fvq/9Axx2KAPZV4eLmuCHoS+ahZEJv6Fzw+yWDsVW0CaGEGhjbzgywM4gW7VfOItGQ== X-Google-Smtp-Source: AGHT+IGn6aUIJ62OynkmBgoRNpmi0+gtEtqG4UjzKbJ4TA9HPRj8b4ofZ2t6L7wHLmHMS/pi3K9w X-Received: by 2002:a05:6a20:3ca6:b0:1a1:821a:aa6d with SMTP id b38-20020a056a203ca600b001a1821aaa6dmr250189pzj.2.1710263121092; Tue, 12 Mar 2024 10:05:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710263121; cv=pass; d=google.com; s=arc-20160816; b=ZS8oBaGfJ40JtTZLez1oAk64D6viSpv+QKAQBkcBi4yvacNVPz+GvNn/QdkOUmbZD8 egjjmhS/rwa4gmGAjRRKNOjOYoyJ35p9DVaV5VLotJsIMM++8UYT0LfapPxR3JplE/U1 op7wAkTZ+nKO/CnWvOJHHIjAbRLVKpOOOLm+A/bABC8+zEfqOhy7N4odudmuQ8H+BWTC qKAl5qjcnqTRC1nN0gbGtR0xHB7k56P9HRLUmT5NZV0sFHmCkxNlUknYIk2tqshItZ9W FBzpgPK1VLxg3WPZRW13f0Mw88A4/7GQr8potQCGUFA7q26WbkU1016vuSgbmiRLhx52 Y5Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:sender:dkim-signature; bh=mFp+F6/qbMDKwppN9CX4ZWrh/15b9XKC6E4V4vAKNpU=; fh=GeX2H73Vsvji8rc9J/9ualQzz3Y6uFtNE8iiriJuwp0=; b=YdCpIgUNMCTp6ZcOkcavNfPqAi7TylZbOc6kC8FZtHqX/A7ChmeQMad/WmpTtjGNb3 roQA3GVz+7Zl1JdFkfAuUqDxf6Y2mhgKVApN9pievqg+Z2+umwgWFmHVEu5V/S7JEOo8 Zgj2PMxhJBOS5VPa9Oex0Zu2Q5TPnbyTLAJrkWez2XF0/bVXgHeCGga/kjTYm4oj6sS2 DOOUoR8WMxPsGgMLib9t8AjCnhyKvJmfKIoI6Fmv6IBKDgRLob/dgzEX+h4dlqRInIUp 7hCYqlf8JG1l6MPE+J8SFdMCupdnJ4PMFiScnlACfLMf6HDxLf+h1IElvbNPilrTCsSE kz3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HvJNnX0A; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-100562-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100562-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bz37-20020a056a02062500b005dc6cbf8440si8074919pgb.99.2024.03.12.10.05.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:05:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100562-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HvJNnX0A; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-100562-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100562-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BA1F82852D7 for ; Tue, 12 Mar 2024 17:05:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 273D813AA3A; Tue, 12 Mar 2024 17:03:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HvJNnX0A" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA16113A877; Tue, 12 Mar 2024 17:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710263009; cv=none; b=ia2ZhYc6zO737w4LHz+oUHfop16SEr39wKyqzeVX7Q03/2daxSxXEiFBKordF8sKeHiFofeqJ+Mf9iqroI6h/dblwbEREOxL8JKuKZ/CQV+54bsZi079QdZ8Qw3H/7vtvzRw4Vfhl3+Om5c2KUUxVDGJDilOip1ypbP9cm0EkHc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710263009; c=relaxed/simple; bh=knS+qppVrCuENhoPuTL59QYimH+PsuApCzIRiQQv0SM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=C0nRMmUntkNqQFBvIu2dmk3PctnHjcYQr7fpcgLFtNZiZCnf7kHO3Y3c3V/feH6C8OhAhDHVfXSajfyGuZeuFYnnLZVNdldFwXhjswUvD/ewJ9mJr/tRy5ELSQMuB1uV4lr/k/171VcWbYex/cojDhwOwfN1U+NpzJC0cmPykDk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HvJNnX0A; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1dd611d5645so285015ad.1; Tue, 12 Mar 2024 10:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710263006; x=1710867806; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=mFp+F6/qbMDKwppN9CX4ZWrh/15b9XKC6E4V4vAKNpU=; b=HvJNnX0An1/a+qhgTMfDvZQxoVK/L/dv4oLBdteu6CYZuaRoowarKOiFKXD7v7zySR BUOjj3dIYmat3PyLZG6lltN/Cw07431yC+1LVP9TxshLsLqInkLPzt0Sxpz9G9MCBOa1 9UuOj5JUi7MnQ5j8qY9uBs2JjpzZPEM61S4dC6UfAWMme9XUOJ/MTYIUjjFXlw8XB0N8 bZA9K+gKDqBcBiwx2UeTeEPctuhuCuKrVViisZORt/9fqqPci7A2kz22KnmKtqX1prx5 +QLUUWfCBhxVeARG61JMeD3OLkomYQQnr5ORO7XhJqMpVYvKXWhNVKOxc7O2q7QC+C3l p4QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710263006; x=1710867806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mFp+F6/qbMDKwppN9CX4ZWrh/15b9XKC6E4V4vAKNpU=; b=X/CsjMAlXoI+yGlx+sLUlGgU+8U6TPWMqanZ2da/jHFWAz+/t7eFfAe9J5L5JfIpsz Jt2YqEq/nUy3A1eLCkEMeUMC5jXTvfmwx2s5BusanMTZd1dyomu71h7IvFKPWO8RrNOg 4ZEk+BvrsBpwZBAt45rTXZJIX6wobFPOUHLMfkLkxBoWhCx3515CFx8GUfwtjFDko95Y bxakCXjgzIKCxxYt7C/OTjKmmZvPyvrUmWvZ319imcgizh0aINcSUhVPr7hj8+eQ2wXh WEIMstssmGdLM5NtatFe7pADyPMwZc4v8bNa/MGmnJDMrer41VoMNFcaHyVOT329eha6 C66A== X-Forwarded-Encrypted: i=1; AJvYcCXW7Xf1IeOZqAuxfvkbk0gGcgFK/dVdHeZW0RoDv9aDPnINtAq4ICuc6X7yoSw4ib6KK/ZScFaY/Z14V/4MjTDHD55IJmS0Kz5MlAxxL9zoWxv7BDI97Q3w3pRNClG4UXdCWsYzvX5fGjThbs7SY7S4m5q0jj1a8JWiHW88CAkOW/HotpNsRM9nmJBgpXBEws+Y/9/mf8adagfN97o8KT+qUeywEDeKi3xjfQOXe9FzoQMyAM84O8AJqzDexv0LveljieUa3GajDLFiOdKiEB7Rn34zK2pYFA== X-Gm-Message-State: AOJu0Yx3zHqOcmsWapTc14rt4uU5hk02DiH96LU9RGdwG74qVH2ptMmI hQJUd79NdC7jDv80iQ42MbL8aQjKDAIJgicpJr2eF8nsW2RswyLFWXwuPDbm X-Received: by 2002:a17:902:db10:b0:1dd:8ed0:59d0 with SMTP id m16-20020a170902db1000b001dd8ed059d0mr179469plx.17.1710263006272; Tue, 12 Mar 2024 10:03:26 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id b21-20020a170902ed1500b001d9a42f6183sm6958740pld.45.2024.03.12.10.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:03:25 -0700 (PDT) Sender: Guenter Roeck From: Guenter Roeck To: linux-kselftest@vger.kernel.org Cc: David Airlie , Arnd Bergmann , =?UTF-8?q?Ma=C3=ADra=20Canal?= , Dan Carpenter , Kees Cook , Daniel Diaz , David Gow , Arthur Grillo , Brendan Higgins , Naresh Kamboju , Maarten Lankhorst , Andrew Morton , Maxime Ripard , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, loongarch@lists.linux.dev, netdev@lists.linux.dev, Guenter Roeck , Jakub Kicinski Subject: [PATCH 06/14] net: kunit: Suppress lock warning noise at end of dev_addr_lists tests Date: Tue, 12 Mar 2024 10:03:01 -0700 Message-Id: <20240312170309.2546362-7-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240312170309.2546362-1-linux@roeck-us.net> References: <20240312170309.2546362-1-linux@roeck-us.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit dev_addr_lists_test generates lock warning noise at the end of tests if lock debugging is enabled. There are two sets of warnings. WARNING: CPU: 0 PID: 689 at kernel/locking/mutex.c:923 __mutex_unlock_slowpath.constprop.0+0x13c/0x368 DEBUG_LOCKS_WARN_ON(__owner_task(owner) != __get_current()) WARNING: kunit_try_catch/1336 still has locks held! KUnit test cleanup is not guaranteed to run in the same thread as the test itself. For this test, this means that rtnl_lock() and rtnl_unlock() may be called from different threads. This triggers the warnings. Suppress the warnings because they are irrelevant for the test and just confusing. The first warning can be suppressed by using START_SUPPRESSED_WARNING() and END_SUPPRESSED_WARNING() around the call to rtnl_unlock(). To suppress the second warning, it is necessary to set debug_locks_silent while the rtnl lock is held. Cc: David Gow Cc: Jakub Kicinski Signed-off-by: Guenter Roeck --- net/core/dev_addr_lists_test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/core/dev_addr_lists_test.c b/net/core/dev_addr_lists_test.c index 4dbd0dc6aea2..b427dd1a3c93 100644 --- a/net/core/dev_addr_lists_test.c +++ b/net/core/dev_addr_lists_test.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include #include #include #include @@ -49,6 +50,7 @@ static int dev_addr_test_init(struct kunit *test) KUNIT_FAIL(test, "Can't register netdev %d", err); } + debug_locks_silent = 1; rtnl_lock(); return 0; } @@ -56,8 +58,12 @@ static int dev_addr_test_init(struct kunit *test) static void dev_addr_test_exit(struct kunit *test) { struct net_device *netdev = test->priv; + DEFINE_SUPPRESSED_WARNING(__mutex_unlock_slowpath); + START_SUPPRESSED_WARNING(__mutex_unlock_slowpath); rtnl_unlock(); + END_SUPPRESSED_WARNING(__mutex_unlock_slowpath); + debug_locks_silent = 0; unregister_netdev(netdev); free_netdev(netdev); } -- 2.39.2