Re: [PATCH v6 13/24] x86/resctrl: Queue mon_event_read() instead of sending an IPI

From: Reinette Chatre
Date: Tue Oct 03 2023 - 17:18:12 EST


Hi James,

On 9/14/2023 10:21 AM, James Morse wrote:

...

> diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> index b44c487727d4..bd263b9a0abd 100644
> --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> @@ -19,6 +19,7 @@
> #include <linux/kernfs.h>
> #include <linux/seq_file.h>
> #include <linux/slab.h>
> +#include <linux/tick.h>
> #include "internal.h"
>

Please keep the empty line between groups of header files.

> /*
> @@ -520,12 +521,24 @@ int rdtgroup_schemata_show(struct kernfs_open_file *of,
> return ret;
> }
>
> +static int smp_mon_event_count(void *arg)
> +{
> + mon_event_count(arg);
> +
> + return 0;
> +}
> +
> void mon_event_read(struct rmid_read *rr, struct rdt_resource *r,
> struct rdt_domain *d, struct rdtgroup *rdtgrp,
> int evtid, int first)
> {
> + int cpu;
> +
> + /* When picking a CPU from cpu_mask, ensure it can't race with cpuhp */

This comment is not accurate at this point. It should accompany the code it applies to.

> + lockdep_assert_held(&rdtgroup_mutex);
> +
> /*
> - * setup the parameters to send to the IPI to read the data.
> + * Setup the parameters to pass to mon_event_count() to read the data.
> */
> rr->rgrp = rdtgrp;
> rr->evtid = evtid;


Reinette