Re: [PATCH V2 09/10] x86/resctrl: Pseudo-lock portions of multiple resources

Reinette Chatre
2019-08-09T16:20:25Z

Hi Borislav,

On 8/9/2019 12:38 AM, Borislav Petkov wrote:
> On Thu, Aug 08, 2019 at 01:13:46PM -0700, Reinette Chatre wrote:
>> There is a locking order dependency between cpu_hotplug_lock and
>> rdtgroup_mutex (cpu_hotplug_lock before rdtgroup_mutex) that has to be
>> maintained. To do so in this flow you will find cpus_read_lock() in
>> rdtgroup_schemata_write(), so quite a distance from where it is needed.
>>
>> Perhaps I should add a comment at the location where the lock is
>> required to document where the lock is obtained?
>
> Even better - you can add:
>
> lockdep_assert_cpus_held();
>
> above it which documents *and* checks too. :-)
>

Will do.

Thank you

Reinette