public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix•de>
To: "Costa Shulyupin" <costa.shul@redhat•com>,
	longman@redhat•com, ming.lei@redhat•com, pauld@redhat•com,
	juri.lelli@redhat•com, vschneid@redhat•com,
	"Michael Ellerman" <mpe@ellerman•id.au>,
	"Nicholas Piggin" <npiggin@gmail•com>,
	"Christophe Leroy" <christophe.leroy@csgroup•eu>,
	"Naveen N Rao" <naveen@kernel•org>,
	"Zefan Li" <lizefan.x@bytedance•com>, "Tejun Heo" <tj@kernel•org>,
	"Johannes Weiner" <hannes@cmpxchg•org>,
	"Michal Koutný" <mkoutny@suse•com>,
	"Ingo Molnar" <mingo@redhat•com>,
	"Peter Zijlstra" <peterz@infradead•org>,
	"Vincent Guittot" <vincent.guittot@linaro•org>,
	"Dietmar Eggemann" <dietmar.eggemann@arm•com>,
	"Steven Rostedt" <rostedt@goodmis•org>,
	"Ben Segall" <bsegall@google•com>, "Mel Gorman" <mgorman@suse•de>,
	"Costa Shulyupin" <costa.shul@redhat•com>,
	"Bjorn Helgaas" <bhelgaas@google•com>,
	linuxppc-dev@lists•ozlabs.org, linux-kernel@vger•kernel.org,
	cgroups@vger•kernel.org
Subject: Re: [RFC PATCH v3 1/3] sched/isolation: Add infrastructure for dynamic CPU isolation
Date: Wed, 02 Oct 2024 11:44:22 +0200	[thread overview]
Message-ID: <87jzeqyh3d.ffs@tglx> (raw)
In-Reply-To: <20240916122044.3056787-2-costa.shul@redhat.com>

On Mon, Sep 16 2024 at 15:20, Costa Shulyupin wrote:
> +/*
> + * housekeeping_update - change housekeeping.cpumasks[type] and propagate the
> + * change.
> + */
> +static int housekeeping_update(enum hk_type type, const struct cpumask *update)
> +{
> +	struct {
> +		struct cpumask changed;
> +		struct cpumask enable;
> +		struct cpumask disable;
> +	} *masks;
> +
> +	masks = kmalloc(sizeof(*masks), GFP_KERNEL);
> +	if (!masks)
> +		return -ENOMEM;
> +
> +	lockdep_assert_cpus_held();
> +	cpumask_xor(&masks->changed, housekeeping_cpumask(type), update);
> +	cpumask_and(&masks->enable, &masks->changed, update);
> +	cpumask_andnot(&masks->disable, &masks->changed, update);
> +	cpumask_copy(housekeeping.cpumasks[type], update);
> +	WRITE_ONCE(housekeeping.flags, housekeeping.flags | BIT(type));

So this sets the bit for the type

> +	if (!static_branch_unlikely(&housekeeping_overridden))
> +		static_key_enable_cpuslocked(&housekeeping_overridden.key);

What's the point of doing this on every iteration?

> +	kfree(masks);
> +
> +	return 0;
> +}
> +
>  static int __init housekeeping_setup(char *str, unsigned long flags)
>  {
>  	cpumask_var_t non_housekeeping_mask, housekeeping_staging;
> @@ -327,8 +357,11 @@ int housekeeping_exlude_isolcpus(const struct cpumask *isolcpus, unsigned long f
>  		/*
>  		 * Reset housekeeping to bootup default
>  		 */
> +
> +		for_each_clear_bit(type, &boot_hk_flags, HK_TYPE_MAX)
> +			housekeeping_update(type, cpu_possible_mask);

Even for those which are clear

>  		for_each_set_bit(type, &boot_hk_flags, HK_TYPE_MAX)
> -			cpumask_copy(housekeeping.cpumasks[type], boot_hk_cpumask);
> +			housekeeping_update(type, boot_hk_cpumask);
>  
>  		WRITE_ONCE(housekeeping.flags, boot_hk_flags);

Just to overwrite them with boot_hk_flags afterwards. That does not make
any sense at all.

Thanks,

        tglx


  reply	other threads:[~2024-10-02  9:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16 12:20 [RFC PATCH v3 0/3] genirq/cpuhotplug: Adjust managed interrupts according to change of housekeeping cpumask Costa Shulyupin
2024-09-16 12:20 ` [RFC PATCH v3 1/3] sched/isolation: Add infrastructure for dynamic CPU isolation Costa Shulyupin
2024-10-02  9:44   ` Thomas Gleixner [this message]
2024-09-16 12:20 ` [RFC PATCH v3 2/3] genirq/cpuhotplug: Adjust managed irqs according to change of housekeeping CPU Costa Shulyupin
2024-10-02 10:09   ` Thomas Gleixner
2024-09-16 12:20 ` [RFC PATCH v3 3/3] DO NOT MERGE: test for managed irqs adjustment Costa Shulyupin

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=87jzeqyh3d.ffs@tglx \
    --to=tglx@linutronix$(echo .)de \
    --cc=bhelgaas@google$(echo .)com \
    --cc=bsegall@google$(echo .)com \
    --cc=cgroups@vger$(echo .)kernel.org \
    --cc=christophe.leroy@csgroup$(echo .)eu \
    --cc=costa.shul@redhat$(echo .)com \
    --cc=dietmar.eggemann@arm$(echo .)com \
    --cc=hannes@cmpxchg$(echo .)org \
    --cc=juri.lelli@redhat$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=lizefan.x@bytedance$(echo .)com \
    --cc=longman@redhat$(echo .)com \
    --cc=mgorman@suse$(echo .)de \
    --cc=ming.lei@redhat$(echo .)com \
    --cc=mingo@redhat$(echo .)com \
    --cc=mkoutny@suse$(echo .)com \
    --cc=mpe@ellerman$(echo .)id.au \
    --cc=naveen@kernel$(echo .)org \
    --cc=npiggin@gmail$(echo .)com \
    --cc=pauld@redhat$(echo .)com \
    --cc=peterz@infradead$(echo .)org \
    --cc=rostedt@goodmis$(echo .)org \
    --cc=tj@kernel$(echo .)org \
    --cc=vincent.guittot@linaro$(echo .)org \
    --cc=vschneid@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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