Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3172899rwa; Mon, 22 Aug 2022 23:23:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR5oo9aTuKuf3tkCO/pbQGVf33MVjiqOrMjbw7hFQSH3c0uGAoPbe2uYz6BT/LX0ZUQYz2hY X-Received: by 2002:a05:6a00:e85:b0:52b:5db8:f3df with SMTP id bo5-20020a056a000e8500b0052b5db8f3dfmr23896070pfb.14.1661235804978; Mon, 22 Aug 2022 23:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661235804; cv=none; d=google.com; s=arc-20160816; b=xYnmhjBjXIkZOPXffnHW/toR7b3vdZdIZcJUNNDKWVaL8NTwMCzfslZVdfQnzzrq4Y Bk+kkEmUoPA6cw6bbV4UWGsXyEYhJvq9bn3SZfNIe8GDpVlMTUAWbCNs1F6joPE94O3l Ppxbi3JO3fLj4AHnGwrgyl7SouccjVWBFXONy2wDi0/nsGGn4B5NXeQp01mpZiGyF9D/ mx74VfBSbVP4WvD7TmrVyHajjNeiVlsUkUhO78S5DLZLhUiQQIJI8uFr33Zdz2tJDdbq 1pC05cqRwhcJXdiD2kMNnDczVUzsu8PlNfuSq85GMXG6S8nixVUl1eXjYIRs8ra5vslW SI0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ubT/JAtaWgq8nqhI71BuKm2VNLBkXvwuIwpSu5501wg=; b=fiyYCrWEFBkdr/sf5Vv8WgpHyCpAxkeyj+EGsPV7aw6HplMMq9W4GyJzsvwrstClzx ycyfY8sBAGl1PpHjJ1uOv+/l7FLrafgXqRcp+Q6Hcq7rYacO7/yKSqi5KFmAWNAGVJsq laAXj7Re/ng2ChXV00E92e42qxb1JV32v4CdWWZytmwhsK+aATtXmg6hoQvqqRBt5uiF 447aeRcIQq3YE/5AZJFKIeRlImS3wd0L4ZOZFVrWctMtHpJL8NlNIzbjktSKwiTT+Q0i 4OkTnyllM+cX/cXDnNq3eY18Bn4lXKOjNFhatOQQpFOg7fbye5k4kcR9Gcn3h23V5cc9 Ot0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b="Ym8u8oB/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a170902c94a00b0016cd74e550fsi17211077pla.351.2022.08.22.23.23.13; Mon, 22 Aug 2022 23:23:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b="Ym8u8oB/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240496AbiHWGM7 (ORCPT + 99 others); Tue, 23 Aug 2022 02:12:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231827AbiHWGM5 (ORCPT ); Tue, 23 Aug 2022 02:12:57 -0400 Received: from polaris.svanheule.net (polaris.svanheule.net [IPv6:2a00:c98:2060:a004:1::200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E01195FF46 for ; Mon, 22 Aug 2022 23:12:56 -0700 (PDT) Received: from terra.. (unknown [IPv6:2a02:a03f:eaf9:8401:aa9f:5d01:1b2a:e3cd]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 9A33431020D; Tue, 23 Aug 2022 08:12:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1661235174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ubT/JAtaWgq8nqhI71BuKm2VNLBkXvwuIwpSu5501wg=; b=Ym8u8oB/epFNEqAq3a/oD9kjx84kZjTkMOPtuOJvKIzBWxhqy2Jl5VpROVXwaeUd8ip4a1 5toq0gewVbmdQHfRLGceMGsAZZI8GOO+vznTvMmaebFGbmAsgVwk7XEWzLlk2Ktyc+yK5n 64JFXZgPwgeDFVojSUB1mmKQPmuobYppxlqPzuddySnyycw0WnaDh3UJTp5ZY4fNTLQN8C e5UdlerBzzBzRGWL9mhvp8e9XknRiy9p2L4Cq8QRNZ3VMuriCQrAGPSByTKOvi6Ag2iQZW N4nsE6iDo8Nf64WY3cnneuhmVW/5o5x/3dfgK+dNQuB5xCQas4hNcR126DWy5Q== From: Sander Vanheule To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Brendan Higgins , David Gow , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Cc: =?UTF-8?q?Ma=C3=ADra=20Canal?= , linux-kernel@vger.kernel.org, Sander Vanheule Subject: [PATCH v3 1/5] lib/test_cpumask: drop cpu_possible_mask full test Date: Tue, 23 Aug 2022 08:12:19 +0200 Message-Id: X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the number of CPUs that can possibly be brought online is known at boot time, e.g. when HOTPLUG is disabled, nr_cpu_ids may be smaller than NR_CPUS. In that case, cpu_possible_mask would not be completely filled, and cpumask_full(cpu_possible_mask) can return false for valid system configurations. Without this test, cpu_possible_mask contents are still constrained by a check on cpumask_weight(), as well as tests in test_cpumask_first(), test_cpumask_last(), test_cpumask_next(), and test_cpumask_iterators(). Fixes: c41e8866c28c ("lib/test: introduce cpumask KUnit test suite") Link: https://lore.kernel.org/lkml/346cb279-8e75-24b0-7d12-9803f2b41c73@riseup.net/ Reported-by: Maíra Canal Signed-off-by: Sander Vanheule Tested-by: Maíra Canal Reviewed-by: David Gow --- Changes in v3: - Update commit message to list remaining tests on cpu_possible_mask lib/test_cpumask.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/test_cpumask.c b/lib/test_cpumask.c index a31a1622f1f6..4ebf9f5805f3 100644 --- a/lib/test_cpumask.c +++ b/lib/test_cpumask.c @@ -54,7 +54,6 @@ static cpumask_t mask_all; static void test_cpumask_weight(struct kunit *test) { KUNIT_EXPECT_TRUE(test, cpumask_empty(&mask_empty)); - KUNIT_EXPECT_TRUE(test, cpumask_full(cpu_possible_mask)); KUNIT_EXPECT_TRUE(test, cpumask_full(&mask_all)); KUNIT_EXPECT_EQ(test, 0, cpumask_weight(&mask_empty)); -- 2.37.2