Re: [RESEND PATCH v4 13/15] fs/resctrl: Add interface to modify kernel-mode via info/kernel_mode

"Moger, Babu" <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.linux-doc
Message-ID <[email protected]>
Hi Reinette,

On 8/13/2026 4:21 PM, Reinette Chatre wrote:
> Hi Babu,
> 
> On 8/13/26 1:55 PM, Babu Moger wrote:
>> On 8/10/26 22:40, Reinette Chatre wrote:
>>> On 7/7/26 2:50 PM, Babu Moger wrote:
> 
> 
>>>> + *
>>>> + * Return: @nbytes on success, negative errno with last_cmd_status set on error.
>>>> + */
>>>> +static ssize_t resctrl_kernel_mode_write(struct kernfs_open_file *of,
>>>> +                     char *buf, size_t nbytes, loff_t off)
>>>> +{
>>>> +    enum resctrl_kernel_mode mode;
>>>> +    char *mode_str, *group_str, *slash;
>>>> +    const char *ctrl_name, *mon_name;
>>>
> 
> ...
> 
>>>> +
>>>> +    for (mode = 0; mode < RESCTRL_NUM_KERNEL_MODES; mode++)
>>>> +        if (!strcmp(mode_str, resctrl_mode_str[mode]))
>>>> +            break;
>>>> +
>>>> +    if (mode == RESCTRL_NUM_KERNEL_MODES) {
>>>> +        rdt_last_cmd_puts("Unknown kernel mode\n");
>>>> +        ret = -EINVAL;
>>>> +        goto out_unlock;
>>>> +    }
>>>> +
>>>> +    if (!(test_bit(mode, &resctrl_kcfg.kmode))) {
>>>> +        rdt_last_cmd_puts("Kernel mode not available\n");
>>>> +        ret = -EINVAL;
>>>> +        goto out_unlock;
>>>> +    }
>>>> +
>>>> +    /*
>>>> +     * INHERIT mode binds no rdtgroup. Ignore any user-supplied :group=
>>>> +     * suffix and let show print the mode without a group.
>>>
>>> copy&paste?
>>
>> Hmm.. Text seems correct here to me. Did I miss something?
> 
> This is the function that parses user input so the comment describing what should
> be displayed to user space seems out of place.
> 

Got it. Thanks
Babu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.