Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp255343imn; Wed, 3 Aug 2022 02:29:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR6dpYbs+HX+U90UrzfVk94GK+YMXHl7w0Amj1cYVOzvbZi0iRBq3rI2Xvb6Iqy58yCSE4kQ X-Received: by 2002:a17:902:e5c8:b0:16f:1511:7575 with SMTP id u8-20020a170902e5c800b0016f15117575mr2339339plf.83.1659518951341; Wed, 03 Aug 2022 02:29:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659518951; cv=pass; d=google.com; s=arc-20160816; b=Bj0vlUI6OCHP1jLLVC/Rj4Gps+tOkD/U3HkcT9LfdWaCpifXuXmfVrPTpGPA05/sCd Zjz/T2Cjk8yKUqELP3NmvgY0Lwn0vFbg9GyoAqaUAJmCL3igvDyzJWjaI5i5pvWBFanK KdpqvPdqEiioDy854nY9GwVzZv5GOf1Tr+meoTRqt5gnMf9PtraYYsuhO6pRDaOKEz0G QaLMvaZ8HMxWjmKnlxgm1GA3S/VK7z3YGpdDHAQo6/UU/YhCTSDuSoE5YyJaj6RYPi9y 5nEco1olscBoN1Rd6b2b9sbGlOitFoec42OeMeFXMX4nRVTHsyTrKpS2UtQrZFuiLdMO hVOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature; bh=q93C79sxRnF4sFFm2T+KqOAm96p2y3qDReUpm9q0LJ0=; b=Pd+Fa/nWY0qmTzQcuDEpjEZHX1vz3ZrptzE7AFtlyIrBm74Jcv5UJuPJTR3ZHj7O4b w9R8uuouy7po9UQt/3ZY/L0GEALfi9qBrLoPOKwFH7phI8rN9prspYflHMmYcVd2Y5Yz b6eI+9J3kouoBQNreiIXuX3ccg+qMq4KUS9Z4dGBCOFTG+NL30tqNVoHV2zi5kdO32Bh 2vntSsQ9QEle5CHbkAZUetIoRhdMQPisrNMmNsZ9wpF9hvc4m5M2HcxySfCvNpkN2/pi r2RcsltSVmTA/B52CrwHsCXlDqQTJGGsmFUJ/V1rO1S20ruEqJMz39cDXQgkho0yc3bn cPtg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b="c2CT/HK4"; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=REJECT sp=REJECT dis=NONE) header.from=siddh.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me8-20020a17090b17c800b001f25fb2a0b6si1595884pjb.120.2022.08.03.02.28.54; Wed, 03 Aug 2022 02:29:11 -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=@siddh.me header.s=zmail header.b="c2CT/HK4"; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234883AbiHCJXV (ORCPT + 99 others); Wed, 3 Aug 2022 05:23:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiHCJXU (ORCPT ); Wed, 3 Aug 2022 05:23:20 -0400 Received: from sender-of-o53.zoho.in (sender-of-o53.zoho.in [103.117.158.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9664719C09 for ; Wed, 3 Aug 2022 02:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659518528; cv=none; d=zohomail.in; s=zohoarc; b=SzxExxF41r8xJbjYBAxHqwNZWS/Ssh/9WBvq+2Gtd00hAo198E4JT31rAYkmDw86v78xUmcR0tU5SeGrAQ4sAiKk8xE46IM52zwuM16uwooNb6YSAHZ2gUph69jtFU9afOlIVgG9pwsM9msi9tcowhygGUUS1zQCtsF42RiVa6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1659518528; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=q93C79sxRnF4sFFm2T+KqOAm96p2y3qDReUpm9q0LJ0=; b=cNC7Z7LQKOI1+CahMUn2YzdJnnyEz8ElHhuk9YAcIV32Lh1WENQINuuBp1Z55+zFrOeg1qZwP9wzsiVzzT+rIuPAE7sovxnRaqXoLcVivx5ZcCqymk11neHxfda/2t4qAFoIuUQAb9rrKSWit9PNTU6eYkTAk4b28KwsjE0LRts= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1659518528; s=zmail; d=siddh.me; i=code@siddh.me; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=q93C79sxRnF4sFFm2T+KqOAm96p2y3qDReUpm9q0LJ0=; b=c2CT/HK4lMxHAskVAhHR2ECPKlso2vtKy8o2kk0F81AFTb/TqGY9jEvdTcNW5KUv kOhFXFNGY/6Moo7L5NTdPvmj6b9oZEtCTKKI1D1uU9KaTodb7Nm40sa/izK2uBBdje9 duUjDI8a2HmIwOiVPljDKYx0095Uwoyb7nyYVNnE= Received: from mail.zoho.in by mx.zoho.in with SMTP id 1659518517817516.3995624024521; Wed, 3 Aug 2022 14:51:57 +0530 (IST) Date: Wed, 03 Aug 2022 14:51:57 +0530 From: Siddh Raman Pant To: "Ingo Molnar" Cc: "x86" , "Dave Hansen" , "Andy Lutomirski" , "Peter Zijlstra" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "H. Peter Anvin" , "linux-kernel" , "linux-kernel-mentees" Message-ID: <18263030220.8a990e82436929.3216192040531777412@siddh.me> In-Reply-To: References: <20220731160913.632092-1-code@siddh.me> <1825f63b142.8968bde3116633.1242410031840350968@siddh.me> <18262ed2459.44b0d74d434377.3690496800292832933@siddh.me> Subject: Re: [PATCH] x86/numa: Use cpumask_available instead of hardcoded NULL check MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_RED 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 On Wed, 03 Aug 2022 14:38:19 +0530 Ingo Molnar wrote: > > * Siddh Raman Pant wrote: > > There is no reason why allmodconfig would trigger the warning, [...] > > Well, unless I'm misreading your changelog, all the warning needs to > trigger is CONFIG_CPUMASK_OFFSTACK=y. > > > as it has CONFIG_CPUMASK_OFFSTACK=y, but the warning is because of the > > other case. > > What 'other case'? I've re-read the discussion and don't see it, but maybe > I'm a bit daft this morning ... No, the warning is happening because CONFIG_CPUMASK_OFFSTACK is not set. This is because in that case cpumask_var_t type is not a pointer, and thus the var can never be NULL, which leads gcc to warn us when comparing with NULL. The chain of events are like: #ifdef CONFIG_CPUMASK_OFFSTACK typedef struct cpumask *cpumask_var_t; #else typedef struct cpumask cpumask_var_t[1]; endif cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]; ... if (node_to_cpumask_map[node] == NULL) { The fix works because: #ifdef CONFIG_CPUMASK_OFFSTACK static inline bool cpumask_available(cpumask_var_t mask) { return mask != NULL; } #else static inline bool cpumask_available(cpumask_var_t mask) { return true; } endif The conditional definitions, as pointed out earlier, can be seen from line 700 of include/linux/cpumask.h file. > > Did you try the config file I had linked to earlier? > > Yes, and it didn't trigger the warning. > > Thanks, > > Ingo > Thanks, Siddh