Re: [RESEND PATCH v4 08/15] fs/resctrl: Add interface to display supported and active kernel-mode policy

From: Reinette Chatre

Date: Wed Aug 12 2026 - 19:40:14 EST


Hi Babu,

On 8/12/26 3:57 PM, Moger, Babu wrote:
> On 8/10/2026 10:18 PM, Reinette Chatre wrote:
>> On 7/7/26 2:50 PM, Babu Moger wrote:

...

>>> +         */
>>> +        rdtgrp = resctrl_kcfg.k_rdtgrp;
>>> +        if (!rdtgrp) {
>>> +            ret = -ENOENT;
>>> +            goto out_unlock;
>>
>> If this fails there needs to be content in last_cmd_status. Otherwise this
>> fails and then last_cmd_status reads "ok" or worse .. an old failure message.
>
> if (WARN_ON(!rdtgrp)) {
>     rdt_last_cmd_puts("Invalid kernel mode group\n");
>     ret = -ENOENT;
>     goto out_unlock;
> }
It is not clear to me why the WARN_ON() was added. Is the resource group not being
associated with kernel mode not a legitimate scenario if the kernel mode group was
re-assigned while the reader of this file was blocked on the mutex?

Reinette