From patchwork Mon Jan 22 16:00:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souradeep Chakrabarti X-Patchwork-Id: 190230 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2712921dyb; Mon, 22 Jan 2024 09:12:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8qM4eqeR0ox3tBwhNQtIazEuSBA8APWvELsEiiE3+4w97C/Q2gvpxo+NuOySTIC1psnkI X-Received: by 2002:ac2:5589:0:b0:50e:7ab4:2ac with SMTP id v9-20020ac25589000000b0050e7ab402acmr1847927lfg.130.1705943576564; Mon, 22 Jan 2024 09:12:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705943576; cv=pass; d=google.com; s=arc-20160816; b=ZPxxea0c9xIgLEt7/l75bRZA47vIGZKrYbUhTY5sRf8Pdkc9oT14/dcsUA33K1N+ek J7V4ez90pYswJUXzQH+b2oQA6puvdU89gpe98zF1i+DKoGmCkBdZwcMRBPrU4mKM+fDS mYjqJ8Zml/chDHzV2QQaxqAfffnF5fk9LsTSQCrtAKdlQARP4pie12A3Arf96TO1N3XI 8zZkzL44a9T+Hy2ab+2cCVUgpTjouqOCqtrX9I1Nldp7M+yMWojrbgzETeKeSIWKF89I HDdZ4TuXbEnXHG7QFEZuTmPJY6uxb9rQlbyR6SSah/RhTk28ElTWv5i38A+9VBTWdqSx xO9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=ZPRu3SXlIUr+8W26d0LPvybxMOuIzrvNRUu535P0XZM=; fh=tZ+d+kaZjTJMarg6XpXtL9/z8hMSaArJbuj7ZVP9x6U=; b=EiNEF+F5Gd9Q0hcJqoL6yisUWwkC2iNzHLkpq1nJDDUeEiS7yZ4mSxQQgbkznB4otz yKArROoCN6dFMMZc5PUNQDcgOVDT5WZD3Q567Iyh0JObpUoa4bFhy6/m/3OGOUrmkBkf Gc7mBBkgSO9Z+Lkt1MymgxZ4BBpMW/MsTQOFUDYToUC7dpW4/MyHFZSwkazgdul2Yod8 U8ZS51Y7WsqAXMXlfhWHtx9KgLGqytHecELWV23M34JcA6pdhTBk2xTAm/5A7OEcXQBS QArUWU8AV45UMTo8sQpa9dfcPbyHK8glYgK2WaLC87igFzzhoH1tOqls+C5OmoLeTT8Z T1cA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=AKDgAkWL; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-33643-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33643-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n7-20020a170906378700b00a2ac142722fsi10901100ejc.167.2024.01.22.09.12.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 09:12:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33643-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=AKDgAkWL; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-33643-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33643-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2D7961F268C3 for ; Mon, 22 Jan 2024 17:12:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF80762807; Mon, 22 Jan 2024 16:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="AKDgAkWL" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFA5C4CDE6; Mon, 22 Jan 2024 16:01:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705939267; cv=none; b=Bof/Fqf+LpVYyUVzZMf97H4TINowQb937cM845vpybQfe1NkqJa3I1M/P52Y5NBkeoNfrTFKkzFwvI/td2g/w1wecUr8o1NyhH4t/4Rv/oB2nCuKfPkvsIse6i2Os5YHbxrPgUbkvfVhGDiv4O6iMFZP8v7KtDy++l6vPrnGZbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705939267; c=relaxed/simple; bh=2TbGyVSXByR1bZJMjbZ9qzvNekm4PoMQJkQoldzGsDY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=pSbwWUXbegyHh+hQK8hd4a0vbH8d/aGDOIPNCVMCJst6m39eixqMq1ieUaceiRWhsQ2LgzEmld/nlcQhhdRrPcqPhJGxDXEqRuPa9gFl6j/irw/VGh+v70SKOiQtu8HYoj1jV+NoU+QVW6FqQ3oNmNwFMp+R8lHlnXZuBNhRoSM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=AKDgAkWL; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: by linux.microsoft.com (Postfix, from userid 1099) id 9530920E2C0A; Mon, 22 Jan 2024 08:01:05 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9530920E2C0A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1705939265; bh=ZPRu3SXlIUr+8W26d0LPvybxMOuIzrvNRUu535P0XZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AKDgAkWLzV0U2zIt5nj8Hi0D4OHGYOOGV3Jne5X/sd99ywR4usOMFH6coqLERn/l3 ndFr+yoL29aSILQLoy0OU/u+dBKEUp8egDYY0jczB8HT/jXsuEDIF1sZ69eQQ6RYMN u4zD16Bf97ZboTWtoF3yKmvNaqYe321T80IICyjA= From: Souradeep Chakrabarti To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, longli@microsoft.com, yury.norov@gmail.com, leon@kernel.org, cai.huoqing@linux.dev, ssengar@linux.microsoft.com, vkuznets@redhat.com, tglx@linutronix.de, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Cc: schakrabarti@microsoft.com, paulros@microsoft.com Subject: [PATCH 2/4 V2 net-next] cpumask: define cleanup function for cpumasks Date: Mon, 22 Jan 2024 08:00:57 -0800 Message-Id: <1705939259-2859-3-git-send-email-schakrabarti@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1705939259-2859-1-git-send-email-schakrabarti@linux.microsoft.com> References: <1705939259-2859-1-git-send-email-schakrabarti@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788811491277710420 X-GMAIL-MSGID: 1788811491277710420 From: Yury Norov Now we can simplify code that allocates cpumasks for local needs. Signed-off-by: Yury Norov --- include/linux/cpumask.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 228c23eb36d2..1c29947db848 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -7,6 +7,7 @@ * set of CPUs in a system, one bit position per CPU number. In general, * only nr_cpu_ids (<= NR_CPUS) bits are valid. */ +#include #include #include #include @@ -990,6 +991,8 @@ static inline bool cpumask_available(cpumask_var_t mask) } #endif /* CONFIG_CPUMASK_OFFSTACK */ +DEFINE_FREE(free_cpumask_var, struct cpumask *, if (_T) free_cpumask_var(_T)); + /* It's common to want to use cpu_all_mask in struct member initializers, * so it has to refer to an address rather than a pointer. */ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS);