All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Reinette Chatre <reinette.chatre@intel.com>
Cc: fenghua.yu@intel.com, bp@alien8.de, james.morse@arm.com,
	tony.luck@intel.com, peternewman@google.com, babu.moger@amd.com,
	tglx@linutronix.de, mingo@redhat.com,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	james.greenhalgh@arm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/resctrl: Fix uninitialized memory read when last CPU of domain goes offline
Date: Sat, 30 Mar 2024 12:12:06 +0100	[thread overview]
Message-ID: <ZgfzhjPP+kAQX7em@gmail.com> (raw)
In-Reply-To: <cc629f91-b4b5-4c9d-b47c-c40eddb03a07@intel.com>


* Reinette Chatre <reinette.chatre@intel.com> wrote:

> Hi Ingo,
> 
> On 3/29/2024 12:01 AM, Ingo Molnar wrote:
> > 
> > * Reinette Chatre <reinette.chatre@intel.com> wrote:
> > 
> >> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
> >> index c99f26ebe7a6..4f9ef35626a7 100644
> >> --- a/arch/x86/kernel/cpu/resctrl/internal.h
> >> +++ b/arch/x86/kernel/cpu/resctrl/internal.h
> >> @@ -85,6 +85,10 @@ cpumask_any_housekeeping(const struct cpumask *mask, int exclude_cpu)
> >>  	if (cpu < nr_cpu_ids && !tick_nohz_full_cpu(cpu))
> >>  		return cpu;
> >>  
> >> +	/* Only continue if tick_nohz_full_mask has been initialized. */
> >> +	if (!tick_nohz_full_enabled())
> >> +		return cpu;
> >> +
> > 
> > So we already have this a few lines up:
> > 
> >         if (!IS_ENABLED(CONFIG_NO_HZ_FULL))
> >                 return cpu;
> > 
> > And we can combine the two checks into a single one, with the patch 
> > below, right?
> 
> Right. Indeed. Doing so is most appropriate. Thank you very much.
> 
> > 
> > Untested.
> 
> Tested-by: Reinette Chatre <reinette.chatre@intel.com>
> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>

Please just pick up my optimization to your fix and submit a v2 - you 
did all the hard work.

Thanks,

	Ingo

  reply	other threads:[~2024-03-30 11:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 21:12 [PATCH] x86/resctrl: Fix uninitialized memory read when last CPU of domain goes offline Reinette Chatre
2024-03-28 22:51 ` Luck, Tony
2024-03-29  7:01 ` Ingo Molnar
2024-03-29 15:25   ` Reinette Chatre
2024-03-30 11:12     ` Ingo Molnar [this message]
2024-04-01 17:57 ` Moger, Babu
2024-04-01 18:12   ` Reinette Chatre
2024-04-01 19:17     ` Moger, Babu

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=ZgfzhjPP+kAQX7em@gmail.com \
    --to=mingo@kernel.org \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=james.greenhalgh@arm.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peternewman@google.com \
    --cc=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.