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 21AC3ECAA25 for ; Thu, 25 Aug 2022 18:13:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243327AbiHYSNE (ORCPT ); Thu, 25 Aug 2022 14:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243230AbiHYSMv (ORCPT ); Thu, 25 Aug 2022 14:12:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A625BD17D for ; Thu, 25 Aug 2022 11:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661451164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aa7TgxIpu/jW/iqd5xTwDqe/1bK1e/1x+Xly3SMXIUI=; b=et1HTKQhDLL+2LCJmI26o4krfTPy3HDhyDjk5q3CUzKF7Y0y24u46ZgqqHVhAZ5or3y9SU 9iIUl/oUhHzmM5KzMkG1xK90XYdUY7W7sefQfqeTmK0zluhFmb8fu1ERjXIpns+SZQkhKu RBKJ9J7DjpsDq0W79Kt+ZgrF+5ErbSg= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-609-gwGSmdxiOfyN4euFoDrqeQ-1; Thu, 25 Aug 2022 14:12:43 -0400 X-MC-Unique: gwGSmdxiOfyN4euFoDrqeQ-1 Received: by mail-wr1-f70.google.com with SMTP id k20-20020adfb354000000b0022556a0b8cbso2407773wrd.5 for ; Thu, 25 Aug 2022 11:12:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=aa7TgxIpu/jW/iqd5xTwDqe/1bK1e/1x+Xly3SMXIUI=; b=NM9GEO8SmXbBNz++O0uCOChBaFRpSyE3PA9okGTmebcjm3EbhSzOQsy/7RhEvTuFSe b9io3q4Sm7+SwgYeq42nnHDJdMIy02cHojG1pUwYcRyuf+VMMBQ7Rh5L+t4RPSGS2Pqd LbljYs603hD88IdKy/Zei9Xi/nqw8THtZGqxnwEnJWaw9Gmo3hiG/oG5Xqq4a1hVO9UW DrkP83sDXtvoIymTGtNdV6/0rvQeFRAB9by9/NS3DjOgAVAdlnF0RgWUQ+CommFOs3sB eGa9ggjwVbrfKfnlhSAsB2ytgcgMUWVO/bfpRI4JGTmjIhdKdTJ/ZyYPpuqzKx77UNwi QpSw== X-Gm-Message-State: ACgBeo1U8lWxOx+0TLGTrnr4iBLIheV52T98zTIFFXFDrA/hv2NwIZnR sc+xXGi5YEzrUHZn5U6i0heor6bbFjBucjPPCiAzO6iFTPsrwY58QiPKvM7sPLrcmJxMlzRJ5J5 VESBRuy+//6cXQN7T+ghiDBBO X-Received: by 2002:a05:6000:1f9b:b0:225:7694:3b36 with SMTP id bw27-20020a0560001f9b00b0022576943b36mr3024119wrb.310.1661451161924; Thu, 25 Aug 2022 11:12:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR48+XemZLeoI5/0hKjHm0hpojsmml99HpqQqzINgCYNPX/9v3T9th/wzQI0CY0AzciHT6w5pQ== X-Received: by 2002:a05:6000:1f9b:b0:225:7694:3b36 with SMTP id bw27-20020a0560001f9b00b0022576943b36mr3024110wrb.310.1661451161782; Thu, 25 Aug 2022 11:12:41 -0700 (PDT) Received: from vschneid.remote.csb ([185.11.37.247]) by smtp.gmail.com with ESMTPSA id w1-20020a05600018c100b00225250f2d1bsm20371622wrq.94.2022.08.25.11.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 11:12:41 -0700 (PDT) From: Valentin Schneider To: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Mel Gorman , Greg Kroah-Hartman , Heiko Carstens , Tony Luck , Jonathan Cameron , Gal Pressman , Tariq Toukan , Jesse Brandeburg Subject: [PATCH v3 2/9] lib/test_cpumask: Make test_cpumask_last check for nr_cpu_ids bits Date: Thu, 25 Aug 2022 19:12:03 +0100 Message-Id: <20220825181210.284283-3-vschneid@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220825181210.284283-1-vschneid@redhat.com> References: <20220825181210.284283-1-vschneid@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org test_cpumask_last() currently fails on a system with CONFIG_NR_CPUS=64 CONFIG_CPUMASK_OFFSTACK=n nr_cpu_ids < NR_CPUS [ 14.088853] # test_cpumask_last: EXPECTATION FAILED at lib/test_cpumask.c:77 [ 14.088853] Expected ((unsigned int)64) - 1 == cpumask_last(((const struct cpumask *)&__cpu_possible_mask)), but [ 14.088853] ((unsigned int)64) - 1 == 63 [ 14.088853] cpumask_last(((const struct cpumask *)&__cpu_possible_mask)) == 3 [ 14.090435] not ok 3 - test_cpumask_last Per smp.c::setup_nr_cpu_ids(), nr_cpu_ids <= NR_CPUS, so we want the test to use nr_cpu_ids rather than nr_cpumask_bits. Signed-off-by: Valentin Schneider --- lib/test_cpumask.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/test_cpumask.c b/lib/test_cpumask.c index a31a1622f1f6..81b17563fcb3 100644 --- a/lib/test_cpumask.c +++ b/lib/test_cpumask.c @@ -73,8 +73,8 @@ static void test_cpumask_first(struct kunit *test) static void test_cpumask_last(struct kunit *test) { - KUNIT_EXPECT_LE(test, nr_cpumask_bits, cpumask_last(&mask_empty)); - KUNIT_EXPECT_EQ(test, nr_cpumask_bits - 1, cpumask_last(cpu_possible_mask)); + KUNIT_EXPECT_LE(test, nr_cpu_ids, cpumask_last(&mask_empty)); + KUNIT_EXPECT_EQ(test, nr_cpu_ids - 1, cpumask_last(cpu_possible_mask)); } static void test_cpumask_next(struct kunit *test) -- 2.31.1