[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/sched: avoid cpumasks on stack in sched/core.c



On Thu, 2020-01-23 at 10:03 +0100, Juergen Gross wrote:
> There are still several instances of cpumask_t on the stack in
> scheduling code. Avoid them as far as possible.
> 
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
>
Reviewed-by: Dario Faggioli <dfaggioli@xxxxxxxx>

Just curious...

> --- a/xen/common/sched/core.c
> +++ b/xen/common/sched/core.c
> @@ -2586,11 +2582,11 @@ static void schedule(void)
>  
>      if ( gran > 1 )
>      {
> -        cpumask_t mask;
> +        cpumask_t *mask = cpumask_scratch_cpu(cpu);
>  
>          prev->rendezvous_in_cnt = gran;
> -        cpumask_andnot(&mask, sr->cpus, cpumask_of(cpu));
> -        cpumask_raise_softirq(&mask, SCHED_SLAVE_SOFTIRQ);
> +        cpumask_andnot(mask, sr->cpus, cpumask_of(cpu));
> +        cpumask_raise_softirq(mask, SCHED_SLAVE_SOFTIRQ);
>
... why are we keeping the temporary variable (mask) ?

Thanks and Regards
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.