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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0623BC28D13 for ; Sun, 21 Aug 2022 13:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbiHUN2E (ORCPT ); Sun, 21 Aug 2022 09:28:04 -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 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