On 14/02/2019 13:12, Jan Beulich wrote:
>>>> On 14.02.19 at 13:38, <paul.durr...@citrix.com> wrote:
>>> From: Juergen Gross [mailto:jgr...@suse.com]
>>> Sent: 14 February 2019 12:35
>>>
>>> On 14/02/2019 13:10, Paul Durrant wrote:
>>>> v2:
>>>>  - Use cpumask_scratch
>>> That's not a good idea. cpumask_scratch may be used from other cpus as
>>> long as the respectice scheduler lock is being held. See the comment in
>>> include/xen/sched-if.h:
>>>
>>> /*
>>>  * Scratch space, for avoiding having too many cpumask_t on the stack.
>>>  * Within each scheduler, when using the scratch mask of one pCPU:
>>>  * - the pCPU must belong to the scheduler,
>>>  * - the caller must own the per-pCPU scheduler lock (a.k.a. runqueue
>>>  *   lock).
>>>  */
>>>
>>> So please don't use cpumask_scratch outside the scheduler!
>> Ah, yes, it's because of cpumask_scratch_cpu()... I'd indeed missed that. In 
>> which case a dedicated flush_cpumask is still required.
> And I didn't recall this aspect either - I'm sorry for misguiding you.
> So Jürgen - thanks for spotting!

Can cpumask_scratch move into a scheduler private header file so the
compiler won't let us accidentally make this mistake again?

~Andrew

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

Reply via email to