[PATCH] x86/MCE-telem: drop unnecessary per-CPU field

Jan Beulich posted 1 patch 8 months, 2 weeks ago
Failed in applying to current master (apply log)
[PATCH] x86/MCE-telem: drop unnecessary per-CPU field
Posted by Jan Beulich 8 months, 2 weeks ago
struct mc_telem_cpu_ctl's processing field is used solely in
mctelem_process_deferred(), where the local variable can as well be used
directly when retrieving the head of the list to process. This then also
eliminates the field holding a dangling pointer once the processing of
the list finished, in particular when the entry is handed to
mctelem_dismiss().

No functional change intended.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/mcheck/mctelem.c
+++ b/xen/arch/x86/cpu/mcheck/mctelem.c
@@ -122,7 +122,6 @@ struct mc_telem_cpu_ctl {
 	 * to guarantee the above mutual exclusivity.
 	 */
 	struct mctelem_ent *pending, *lmce_pending;
-	struct mctelem_ent *processing;
 };
 static DEFINE_PER_CPU(struct mc_telem_cpu_ctl, mctctl);
 
@@ -233,9 +232,7 @@ void mctelem_process_deferred(unsigned i
 	 * handled by another round of MCE softirq.
 	 */
 	mctelem_xchg_head(lmce ? &ctl->lmce_pending : &ctl->pending,
-			  &this_cpu(mctctl.processing), NULL);
-
-	head = this_cpu(mctctl.processing);
+			  &head, NULL);
 
 	/*
 	 * Then, fix up the list to include prev pointers, to make
Re: [PATCH] x86/MCE-telem: drop unnecessary per-CPU field
Posted by Andrew Cooper 8 months, 2 weeks ago
On 19/02/2025 10:01 am, Jan Beulich wrote:
> struct mc_telem_cpu_ctl's processing field is used solely in
> mctelem_process_deferred(), where the local variable can as well be used
> directly when retrieving the head of the list to process. This then also
> eliminates the field holding a dangling pointer once the processing of
> the list finished, in particular when the entry is handed to
> mctelem_dismiss().
>
> No functional change intended.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>