Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1347484rwa; Sun, 21 Aug 2022 06:37:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR7gi1ehrwCzyae5/0lo55hFUtBu1U1qtENDdJo6NoQKFIEDaWqwQ9cfhZIUPQ32Pbrt9luQ X-Received: by 2002:a65:6d98:0:b0:41d:d9:a338 with SMTP id bc24-20020a656d98000000b0041d00d9a338mr13127055pgb.421.1661089052042; Sun, 21 Aug 2022 06:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661089052; cv=none; d=google.com; s=arc-20160816; b=RnoIX6dQDPMwHS8DRAhskZZlxnXXxrZpHcYI0FLLdAhB+tBiLa76ER2ESXtP2hzhWH HyDt7oggLDeKxCS/SZ5XbgK3gO2D7ogv4MbzTBEBcpzeboiRAbq9S+FPJy73ZJp4lvHs 69rzHv8CVCgOWj1wHvCVUENv6f7IFzzaEkISXGstXhT8J9oS3o705JExV6wxStLpRVT7 BfvtnPmc7gFxdyFlqvbo1Vpeqpl9pJWRypu1hiYVkEr06eV7N2vJaNtcYs/pPC2HQfMk k18BiZzKqypVhKP4Zry+ZUufadRbvHC9CDD54xiFnB+eeJvP5sK1Ubffgy62dLkAY4oP H9RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=Vvsu5VPNuHA39zj3/LpeneZN62u/9ZSx0U+NwaMKuhs=; b=F2FA6nlhKIaQyvNWv5CCPB2FGoXpIVvS1RBI8ftfVelq+q8ctMvEium1lASsCv7Bdk vt4sx/nCxOYv2R/SzR3a0qed6lw+xpfzj4mxeOygSrfIAAjLXvJxNMhehOKb053+ELNz QvJm8eeP1UFDbk+9kAaHOpQSMrYxcZPMp1zJinAzO8ykWQYZ/tsUDT/JN/UIxLHci5JL VtIkC7aKkJoHVxnFnQd9fW5Er2x3xjzEXkJgOmTnaci0l6L2a1JlorLAfxyKlAHAXqa2 s5bR9r5/qyCc+UWL0n09Y9JYPUAcndAhs79d6Wg7fNl+pgFc/SCXIfAciV8PHW4EiJ4s lkcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b="jQhs/igJ"; 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 f10-20020a170902ce8a00b001725e847c6asi11444526plg.302.2022.08.21.06.37.21; Sun, 21 Aug 2022 06:37:32 -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="jQhs/igJ"; 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 S229787AbiHUN2D (ORCPT + 99 others); Sun, 21 Aug 2022 09:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbiHUN17 (ORCPT ); Sun, 21 Aug 2022 09:27:59 -0400 Received: from polaris.svanheule.net (polaris.svanheule.net [IPv6:2a00:c98:2060:a004:1::200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E87AA1EC6C for ; Sun, 21 Aug 2022 06:27:58 -0700 (PDT) Received: from [IPv6:2a02:a03f:eaf9:8401:aa9f:5d01:1b2a:e3cd] (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)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 2143530F327; Sun, 21 Aug 2022 15:27:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1661088477; 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=Vvsu5VPNuHA39zj3/LpeneZN62u/9ZSx0U+NwaMKuhs=; b=jQhs/igJ9gB/XJnu8JrKd49u/9IiXhQegyGvjj/zMkqyMBEIEb0eqHglov/+9J/rVQuV9W pZ3kKkjP4sNHT+mfE4dsDQKd98o8ebcNrqBp7QiOaekWy51cnDzc6gvUkIK7svY8/Ch0sZ 1NE0LUrdu6qxlja1MvTSsMs+U66rwXHxX0mfn8mVz+1TyBDvZJhgmfQ6lyeixGk1bXxD6n Lzd0v2YCY3IGiczeP6aLAt1c9hDv4fVW49VPNOk2O6q/BcO+ZJJGWRtVfZjfxo1FhiOlMV OcPuW+6wRCt5KljOmgAUkbr9t1xDYb7yzOUqPs4wwmHu3wo9Ur0rvnN+WAtn5Q== Message-ID: <84564f0f7db4a58ab7cd5314685ca2413c1d7081.camel@svanheule.net> Subject: Re: [PATCH v2 1/5] lib/test_cpumask: drop cpu_possible_mask full test From: Sander Vanheule To: Yury Norov Cc: Andy Shevchenko , Rasmus Villemoes , Brendan Higgins , David Gow , "open list:KERNEL SELFTEST FRAMEWORK" , kunit-dev@googlegroups.com, =?ISO-8859-1?Q?Ma=EDra?= Canal , Linux Kernel Mailing List Date: Sun, 21 Aug 2022 15:27:56 +0200 In-Reply-To: References: <6dfd4d3a4d77f97f13ab3f22bc53c96c38ba908e.1661007339.git.sander@svanheule.net> <9f28529005867512105182f8fa2b0f7b0d14b30d.camel@svanheule.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 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=unavailable 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 Hi Yury, Replying back in plaintext, as you sent an HTML message. On Sun, 2022-08-21 at 09:18 -0400, Yury Norov wrote: >=20 >=20 > On Sun, Aug 21, 2022, 09:08 Sander Vanheule wrote: > > Hi Yury, > >=20 > > On Sat, 2022-08-20 at 14:35 -0700, Yury Norov wrote: > > > On Sat, Aug 20, 2022 at 05:03:09PM +0200, Sander Vanheule wrote: > > > > When the number of CPUs that can possibly be brought online is know= n 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 fi= lled, > > > > and cpumask_full(cpu_possible_mask) can return false for valid syst= em > > > > configurations. > > >=20 > > > It doesn't mean we can just give up. You can check validity of possib= le > > > cpumask like this:=20 > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 KUNIT_EXPECT_EQ(test, nr_c= pu_ids, cpumask_first_zero(&mask_all)) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 KUNIT_EXPECT_EQ(test, NR_C= PUS, cpumask_first(&mask_all)) > >=20 > > Did you mean cpu_possible_mask, or mask_all? >=20 > cpu_possble_as of curse. >=20 > > For cpu_possible_mask, these tests are in test_cpumask_first(), albeit = under > > a > > slightly different form. Together with the tests in test_cpumask_weight= () > > and > > test_cpumask_last(), cpu_possible_mask is already one of the more > > constrained > > masks. > >=20 > >=20 > > For mask_all, the mask is filled up with nr_cpumask_bits <=3D NR_CPUS. = I could > > add > > cpumask_first(), cpumask_first_zero(), and cpumask_last() tests though. > >=20 > > More tests could be also added for cpu_all_mask, since this does have a= ll > > NR_CPUS bits set, but I think that belongs in a separate patch. > >=20 > > I think the extra mask_all and cpu_all_mask test are out of scope for t= his > > patch, but they could be added in another patch (for 6.1). >=20 > If you think that possible mask is tested by other parts, then can you no= tice > that in comments? Sure, I'll update the commit message to note the other constraints on cpu_possible_mask. Best, Sander