lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c093d8b2-d6c6-237c-ffd4-0cb1565e971c@intel.com>
Date:   Thu, 11 May 2023 14:37:37 -0700
From:   Reinette Chatre <reinette.chatre@...el.com>
To:     Peter Newman <peternewman@...gle.com>,
        Fenghua Yu <fenghua.yu@...el.com>
CC:     Babu Moger <babu.moger@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, <x86@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>,
        Stephane Eranian <eranian@...gle.com>,
        James Morse <james.morse@....com>,
        <linux-kernel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH v1 4/9] x86/resctrl: Flush MBM event counts on soft RMID
 change

Hi Peter,

On 4/21/2023 7:17 AM, Peter Newman wrote:
> To implement soft RMIDs, context switch must detect when the current
> soft RMID is changing and if so, flush the CPU's MBM event counts to the
> outgoing soft RMID.
> 
> To avoid impacting context switch performance in the non-soft RMID case,
> protect the new logic with a static branch.
> 
> Co-developed-by: Stephane Eranian <eranian@...gle.com>
> Signed-off-by: Stephane Eranian <eranian@...gle.com>
> Signed-off-by: Peter Newman <peternewman@...gle.com>
> ---
>  arch/x86/include/asm/resctrl.h         | 27 +++++++++++++++++++++++++-
>  arch/x86/kernel/cpu/resctrl/rdtgroup.c |  1 +
>  2 files changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/resctrl.h b/arch/x86/include/asm/resctrl.h
> index e7acf118d770..50d05e883dbb 100644
> --- a/arch/x86/include/asm/resctrl.h
> +++ b/arch/x86/include/asm/resctrl.h
> @@ -36,6 +36,9 @@ DECLARE_PER_CPU(struct resctrl_pqr_state, pqr_state);
>  DECLARE_STATIC_KEY_FALSE(rdt_enable_key);
>  DECLARE_STATIC_KEY_FALSE(rdt_alloc_enable_key);
>  DECLARE_STATIC_KEY_FALSE(rdt_mon_enable_key);
> +DECLARE_STATIC_KEY_FALSE(rdt_soft_rmid_enable_key);
> +
> +void resctrl_mbm_flush_cpu(void);
>  
>  /*
>   * __resctrl_sched_in() - Writes the task's CLOSid/RMID to IA32_PQR_MSR
> @@ -75,9 +78,31 @@ static inline void __resctrl_sched_in(struct task_struct *tsk)
>  	}
>  
>  	if (closid != state->cur_closid || rmid != state->cur_rmid) {
> +		if (static_branch_likely(&rdt_soft_rmid_enable_key)) {

Could you please elaborate on the choice of static_branch_likely() (as opposed
to static_branch_unlikely())?

Reinette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ