From patchwork Mon Jan 29 06:21:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souradeep Chakrabarti X-Patchwork-Id: 193268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp389530dyb; Sun, 28 Jan 2024 22:23:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUpQWjx9EKeVrNyx4Y2XGeCnDFegGo0UZ1GJhkpG0lrAteHJlJrzgDFOEzvIN4/FLHnsqh X-Received: by 2002:a17:906:b35a:b0:a31:d17c:f4ef with SMTP id cd26-20020a170906b35a00b00a31d17cf4efmr5350222ejb.20.1706509418937; Sun, 28 Jan 2024 22:23:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706509418; cv=pass; d=google.com; s=arc-20160816; b=IwdVqyZRrmUhHxFeV2AkcCfFHRYJPnb3UMwgLarbp77INwNLfos/gZGYDDIHlKIeQI uvahT762rJU1T1xali5lEEACLWRE4nYHVGLwhLyLY3EjkjSMr7+1+IDAY4S5odQD6q09 YmcCI617siOas/IqB5A4QlYBqWK4JJwGnnSTRk9wvYZFYt8Pf9P80oWtvp/iOll9rA0A ev//+3npYj4qv4dcL1aSAkPnjaVvV87AIV1w23nmEpllQQi9mN5eZfafDeqsphzSmBAD bHpK71GGPGs5uIOZbsd4lnHbnq6ixVziRXW1y/ksv20rZ6LqG7Zmm2eA3twaHewCXoJr QOiw== 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=V94S5IHv8RP+W4w/zbqt/IxTuQ5P7aFfcHZUQWYco2GgvA6kzZcJULGu9pAMAL05an 8Xs64KMysI6cM/R+MZpGJUYGzk11l5bslfOvuEhoUnqGI4Bk5Ivx0SO8najOm9NrG1ah UN0AsG16EP0hUQgb3eUT9oK91jn6k1jybexdY33PgfdFWpukspBhctQcl2dtS7ebaFX8 hX8wQBc3ySrUQLhU8xxCe/AOQNd10/lKwApXeMEYjlS66xQJxVO7XfHLhkJMet37Jjyn LtF2eS7EE8LbzuGk28RQpKyn5N/T0vyT+dIo6C3XpgikPcXAIunGoVnK3ezV2bg+25Po Pp4g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=L+BQGoB0; 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-42228-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42228-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. [147.75.80.249]) by mx.google.com with ESMTPS id y8-20020a170906558800b00a35a0186ac0si984843ejp.132.2024.01.28.22.23.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 22:23:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42228-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=L+BQGoB0; 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-42228-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42228-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 5B9FD1F2151F for ; Mon, 29 Jan 2024 06:23:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B852537F1; Mon, 29 Jan 2024 06:21:38 +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="L+BQGoB0" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E2764D5AC; Mon, 29 Jan 2024 06:21:34 +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=1706509295; cv=none; b=A+zjDz3OteoA+f/fRXoR97NjXwJEEyoHZANL3wMH24RnwXsnsFWsUikMdtCKPg5KNA5GJ5FsobzcWE8MVKVcFkGrQ+zF/zhYrDCLC9g+TYCcg5eiRFXFwyTB/QGsVpOvPJJhzcXBmKpvIp7Aw89QJZ2I3qdB7qVkpfDwzKW2Xbw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706509295; c=relaxed/simple; bh=2TbGyVSXByR1bZJMjbZ9qzvNekm4PoMQJkQoldzGsDY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=UEYFrlbzfmgxCOJvW21doYaTY5etEl44/ske7Hl+TX0jGtw9HNIj0NrApoA5TgD/QYvtcneT7hG/JFO2v9w6PaEopwQ+im5EFDq/kJ96MqjFIqrRhmepyOfhXzKOvZcxqvRGVe5Fgo/IqdXoOgGTXaVZuB1leCSPE2XAlb23Y48= 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=L+BQGoB0; 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 CEEE520E67D7; Sun, 28 Jan 2024 22:21:28 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CEEE520E67D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1706509288; bh=ZPRu3SXlIUr+8W26d0LPvybxMOuIzrvNRUu535P0XZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L+BQGoB0GLE+KyyR0PnFVug/r66VXfnIBCw46epW85csspHZObEUXpA36eCL+5aXG FkaJ3jqMQoLOZsqelD/vHDM6Ja6B9RlA4q5ScoO7MIn7t/vAJgyYtq1RbDYMeYC+59 dUE+JuQXkzd2DGn8h3CGkjEUpMh1Cxd/15HY7InE= 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 V3 net-next] cpumask: define cleanup function for cpumasks Date: Sun, 28 Jan 2024 22:21:05 -0800 Message-Id: <1706509267-17754-3-git-send-email-schakrabarti@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1706509267-17754-1-git-send-email-schakrabarti@linux.microsoft.com> References: <1706509267-17754-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: 1789404820095097846 X-GMAIL-MSGID: 1789404820095097846 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);