mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>, <x86@kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: James Morse <james.morse@arm.com>,
	Yury Norov <yury.norov@gmail.com>,
	"Dave Martin" <dave.martin@arm.com>, <fenghuay@nvidia.com>,
	<peternewman@google.com>, Babu Moger <Babu.Moger@amd.com>,
	Borislav Petkov <bp@alien8.de>,
	<shameerali.kolothum.thodi@huawei.com>,
	<bobo.shaobowang@huawei.com>,
	D Scott Phillips OS <scott@os.amperecomputing.com>,
	<carl@os.amperecomputing.com>, Koba Ko <kobak@nvidia.com>,
	Shanker Donthineni <sdonthineni@nvidia.com>,
	Xin Hao <xhao@linux.alibaba.com>, <baolin.wang@linux.alibaba.com>,
	<lcherian@marvell.com>, <amitsinght@marvell.com>,
	Ingo Molnar <mingo@redhat.com>,
	David Hildenbrand <david@redhat.com>,
	H Peter Anvin <hpa@zytor.com>, Rex Nie <rex.nie@jaguarmicro.com>,
	Jamie Iles <quic_jiles@quicinc.com>, <dfustini@baylibre.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/2] x86/resctrl: Remove unnecessary cpumask_nth_andnot()
Date: Thu, 12 Jun 2025 11:23:00 -0700	[thread overview]
Message-ID: <ad43aaae-7a76-4dd3-98f2-167962eba7e1@intel.com> (raw)
In-Reply-To: <20250611021547.2766889-2-tan.shaopeng@jp.fujitsu.com>

Hi Shaopeng,

The subject contains "x86/resctrl" but the change is actually to
the kernel's bitmap API. Please split this patch from this series and
submit it by itself so that it can be routed correctly (separate from the
resctrl change).
You can use "git log include/linux/cpumask.h" to see how other
patches to the area are formatted. To start it looks like
the subject should have "cpumask:" prefix.

When submitting it upstream it should be routed to:
$ ./scripts/get_maintainer.pl include/linux/cpumask.h 
Yury Norov <yury.norov@gmail.com> (maintainer:BITMAP API)
Rasmus Villemoes <linux@rasmusvillemoes.dk> (reviewer:BITMAP API)
linux-kernel@vger.kernel.org (open list)

On 6/10/25 7:15 PM, Shaopeng Tan wrote:
> In commit 94f753143028("x86/resctrl: Optimize cpumask_any_housekeeping()"),
> cpumask_any_andnot_but() replaced cpumask_nth_andnot(),

nit: saying "cpumask_any_andnot_but() replaced cpumask_nth_andnot()" sounds
as though cpumask_any_andnot_but() is a different implementation to accomplish
what cpumask_nth_andnot() does.  I do not believe this is the case, for example,
cpumask_any_andnot_but() receives as parameter a CPU to ignore that is not
supported by cpumask_nth_andnot().

I think the main point is that the identified commit switched the only
user of cpumask_nth_andnot() to other cpumask functions, leaving
cpumask_nth_andnot() unused.

> but left the function cpumask_nth_andnot() unused, delete it.
> 
> Signed-off-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> ---
>  include/linux/cpumask.h | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> index 7ae80a7ca81e..498790f74fa8 100644
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -546,22 +546,6 @@ unsigned int cpumask_nth_and(unsigned int cpu, const struct cpumask *srcp1,
>  				small_cpumask_bits, cpumask_check(cpu));
>  }
>  
> -/**
> - * cpumask_nth_andnot - get the Nth cpu set in 1st cpumask, and clear in 2nd.
> - * @srcp1: the cpumask pointer
> - * @srcp2: the cpumask pointer
> - * @cpu: the Nth cpu to find, starting from 0
> - *
> - * Return: >= nr_cpu_ids if such cpu doesn't exist.
> - */
> -static __always_inline
> -unsigned int cpumask_nth_andnot(unsigned int cpu, const struct cpumask *srcp1,
> -							const struct cpumask *srcp2)
> -{
> -	return find_nth_andnot_bit(cpumask_bits(srcp1), cpumask_bits(srcp2),
> -				small_cpumask_bits, cpumask_check(cpu));
> -}
> -
>  /**
>   * cpumask_nth_and_andnot - get the Nth cpu set in 1st and 2nd cpumask, and clear in 3rd.
>   * @srcp1: the cpumask pointer

Patch looks good to me. Thank you.

Reinette


  reply	other threads:[~2025-06-12 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11  2:15 [PATCH 0/2] x86/resctrl: Optimize some resctrl code Shaopeng Tan
2025-06-11  2:15 ` [PATCH 1/2] x86/resctrl: Remove unnecessary cpumask_nth_andnot() Shaopeng Tan
2025-06-12 18:23   ` Reinette Chatre [this message]
2025-06-11  2:15 ` [PATCH 2/2] x86/resctrl: Optimize code in rdt_get_tree() Shaopeng Tan
2025-06-11 20:36   ` kernel test robot
2025-06-12 18:23   ` Reinette Chatre
2025-06-12 18:26     ` Reinette Chatre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad43aaae-7a76-4dd3-98f2-167962eba7e1@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=Babu.Moger@amd.com \
    --cc=amitsinght@marvell.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bobo.shaobowang@huawei.com \
    --cc=bp@alien8.de \
    --cc=carl@os.amperecomputing.com \
    --cc=dave.martin@arm.com \
    --cc=david@redhat.com \
    --cc=dfustini@baylibre.com \
    --cc=fenghuay@nvidia.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=kobak@nvidia.com \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peternewman@google.com \
    --cc=quic_jiles@quicinc.com \
    --cc=rex.nie@jaguarmicro.com \
    --cc=scott@os.amperecomputing.com \
    --cc=sdonthineni@nvidia.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=tan.shaopeng@jp.fujitsu.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xhao@linux.alibaba.com \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®