cgroup/cpuset: Improve cpuset_css_alloc() description

Message ID 20221116054415.79157-1-kamalesh.babulal@oracle.com
State New
Headers
Series cgroup/cpuset: Improve cpuset_css_alloc() description |

Commit Message

Kamalesh Babulal Nov. 16, 2022, 5:44 a.m. UTC
  Change the function argument in the description of cpuset_css_alloc()
from 'struct cgroup' -> 'struct cgroup_subsys_state'.  The change to the
argument type was introduced by commit eb95419b023a ("cgroup: pass
around cgroup_subsys_state instead of cgroup in subsystem methods").
Also, add more information to its description.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
---
 kernel/cgroup/cpuset.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
  

Comments

Waiman Long Nov. 16, 2022, 2:36 p.m. UTC | #1
On 11/16/22 00:44, Kamalesh Babulal wrote:
> Change the function argument in the description of cpuset_css_alloc()
> from 'struct cgroup' -> 'struct cgroup_subsys_state'.  The change to the
> argument type was introduced by commit eb95419b023a ("cgroup: pass
> around cgroup_subsys_state instead of cgroup in subsystem methods").
> Also, add more information to its description.
>
> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
> ---
>   kernel/cgroup/cpuset.c | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index b474289c15b8..aac790462e74 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -3046,9 +3046,14 @@ static struct cftype dfl_files[] = {
>   };
>   
>   
> -/*
> - *	cpuset_css_alloc - allocate a cpuset css
> - *	cgrp:	control group that the new cpuset will be part of
> +/**
> + * cpuset_css_alloc - Allocate a cpuset css
> + * @parent_css: Parent css of the control group that the new cpuset will be
> + *              part of
> + * Return: cpuset css on success, -ENOMEM on failure.
> + *
> + * Allocate and initialize a new cpuset css, for non-root cpuset or return the
> + * top cpuset css for root cpuset.
Strictly speaking, it returns the css of top cpuset set for NULL input 
parameter.
>    */
>   
>   static struct cgroup_subsys_state *

While at it, could you also remove the blank line between the comment 
and the function body.

Thanks,
Longman
  
Kamalesh Babulal Nov. 16, 2022, 3:40 p.m. UTC | #2
On 11/16/22 20:06, Waiman Long wrote:
> On 11/16/22 00:44, Kamalesh Babulal wrote:
>> Change the function argument in the description of cpuset_css_alloc()
>> from 'struct cgroup' -> 'struct cgroup_subsys_state'.  The change to the
>> argument type was introduced by commit eb95419b023a ("cgroup: pass
>> around cgroup_subsys_state instead of cgroup in subsystem methods").
>> Also, add more information to its description.
>>
>> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
>> ---
>>   kernel/cgroup/cpuset.c | 11 ++++++++---
>>   1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>> index b474289c15b8..aac790462e74 100644
>> --- a/kernel/cgroup/cpuset.c
>> +++ b/kernel/cgroup/cpuset.c
>> @@ -3046,9 +3046,14 @@ static struct cftype dfl_files[] = {
>>   };
>>     -/*
>> - *    cpuset_css_alloc - allocate a cpuset css
>> - *    cgrp:    control group that the new cpuset will be part of
>> +/**
>> + * cpuset_css_alloc - Allocate a cpuset css
>> + * @parent_css: Parent css of the control group that the new cpuset will be
>> + *              part of
>> + * Return: cpuset css on success, -ENOMEM on failure.
>> + *
>> + * Allocate and initialize a new cpuset css, for non-root cpuset or return the
>> + * top cpuset css for root cpuset.
> Strictly speaking, it returns the css of top cpuset set for NULL input parameter.

Thank you for reviewing the patch. Does the following, rephrase, sound right:

Allocate and initialize a new cpuset css, for non-NULL @parent_css, return                             
top cpuset css otherwise.

>>    */
>>     static struct cgroup_subsys_state *
> 
> While at it, could you also remove the blank line between the comment and the function body.

Sure, will remove it.
  
Waiman Long Nov. 16, 2022, 5:20 p.m. UTC | #3
On 11/16/22 10:40, Kamalesh Babulal wrote:
>
> On 11/16/22 20:06, Waiman Long wrote:
>> On 11/16/22 00:44, Kamalesh Babulal wrote:
>>> Change the function argument in the description of cpuset_css_alloc()
>>> from 'struct cgroup' -> 'struct cgroup_subsys_state'.  The change to the
>>> argument type was introduced by commit eb95419b023a ("cgroup: pass
>>> around cgroup_subsys_state instead of cgroup in subsystem methods").
>>> Also, add more information to its description.
>>>
>>> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
>>> ---
>>>    kernel/cgroup/cpuset.c | 11 ++++++++---
>>>    1 file changed, 8 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>>> index b474289c15b8..aac790462e74 100644
>>> --- a/kernel/cgroup/cpuset.c
>>> +++ b/kernel/cgroup/cpuset.c
>>> @@ -3046,9 +3046,14 @@ static struct cftype dfl_files[] = {
>>>    };
>>>      -/*
>>> - *    cpuset_css_alloc - allocate a cpuset css
>>> - *    cgrp:    control group that the new cpuset will be part of
>>> +/**
>>> + * cpuset_css_alloc - Allocate a cpuset css
>>> + * @parent_css: Parent css of the control group that the new cpuset will be
>>> + *              part of
>>> + * Return: cpuset css on success, -ENOMEM on failure.
>>> + *
>>> + * Allocate and initialize a new cpuset css, for non-root cpuset or return the
>>> + * top cpuset css for root cpuset.
>> Strictly speaking, it returns the css of top cpuset set for NULL input parameter.
> Thank you for reviewing the patch. Does the following, rephrase, sound right:
>
> Allocate and initialize a new cpuset css, for non-NULL @parent_css, return
> top cpuset css otherwise.

That looks fine to me.

Cheers,
Longman

>>>     */
>>>      static struct cgroup_subsys_state *
>> While at it, could you also remove the blank line between the comment and the function body.
> Sure, will remove it.
>
  

Patch

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index b474289c15b8..aac790462e74 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -3046,9 +3046,14 @@  static struct cftype dfl_files[] = {
 };
 
 
-/*
- *	cpuset_css_alloc - allocate a cpuset css
- *	cgrp:	control group that the new cpuset will be part of
+/**
+ * cpuset_css_alloc - Allocate a cpuset css
+ * @parent_css: Parent css of the control group that the new cpuset will be
+ *              part of
+ * Return: cpuset css on success, -ENOMEM on failure.
+ *
+ * Allocate and initialize a new cpuset css, for non-root cpuset or return the
+ * top cpuset css for root cpuset.
  */
 
 static struct cgroup_subsys_state *