include: linux: pid: Update documentation.
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/5 include: linux: pid: Update documentation.
This patch adds comments to update documentation. Also remove extra space between full stop and and new sentence, of existing comments.
--- include/linux/pid.h | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-)
include/linux/pid.h +32 -11
@@ -5,32 +5,32 @@enum pid_type { -PIDTYPE_PID , -PIDTYPE_PGID , -PIDTYPE_SID , -PIDTYPE_MAX +PIDTYPE_PID ,/* Process ID */ +PIDTYPE_PGID ,/* Process group ID */ +PIDTYPE_SID ,/* Process session ID */ +PIDTYPE_MAX /* Number of ID types */ };/* * What is struct pid? * * A struct pid is the kernel's internal notion of a process identifier. -* It refers to individual tasks, process groups, and sessions. While +* It refers to individual tasks, process groups, and sessions. While * there are processes attached to it the struct pid lives in a hash * table, so it and then the processes that it refers to can be found -* quickly from the numeric pid value. The attached processes may be +* quickly from the numeric pid value. The attached processes may be * quickly accessed by following pointers from struct pid. * * Storing pid_t values in the kernel and referring to them later has a -* problem. The process originally with that pid may have exited and the +* problem. The process originally with that pid may have exited and the * pid allocator wrapped, and another process could have come along * and been assigned that pid. * * Referring to user space processes by holding a reference to struct -* task_struct has a problem. When the user space process exits -* the now useless task_struct is still kept. A task_struct plus a -* stack consumes around 10K of low kernel memory. More precisely -* this is THREAD_SIZE + sizeof(struct task_struct). By comparison +* task_struct has a problem. When the user space process exits +* the now useless task_struct is still kept. A task_struct plus a +* stack consumes around 10K of low kernel memory. More precisely +* this is THREAD_SIZE + sizeof(struct task_struct). By comparison * a struct pid is about 64 bytes. * * Holding a reference to struct pid solves both of these problems.
@@ -45,6 +45,10 @@ enum pid_type* struct upid is used to get the id of the struct pid, as it is * seen in particular namespace. Later the struct pid is found with * find_pid_ns() using the int nr and struct pid_namespace *ns. +* +* @nr: Pid value. +* @ns: Represents the namespace to which pid value belongs. +* @pid_chain: Hash chain. */ struct upid {
@@ -54,6 +58,15 @@ struct upid {struct hlist_node pid_chain; }; +/* +* struct pid +* @count: Reference counter. +* @level: Number of namespaces in which the process is visible. +* @tasks: Lists of tasks. +* @rcu: RCU helper. +* @numbers: Instance of upid for each level. +*/ +struct pid {atomic_t count;
@@ -66,12 +79,20 @@ struct pidextern struct pid init_struct_pid; +/* +* struct pid_link is used for per process linkage into hash tables. +* @node: List element. +* @pid: Pointer to the struct pid of the process. +*/ struct pid_link {struct hlist_node node;struct pid *pid; }; +/* get_pid() checks availability of process id and if available assigns +* process ID. +*/ static inline struct pid *get_pid (struct pid *pid) {if (pid)
Signature · 1 line
2.9.3
Quoted 2 lines · Varsha Rao
This patch adds comments to update documentation. Also remove extra space between full stop and and new sentence, of existing comments.
Actually, at least in American English, a period should be followed by two spaces. Like in this email :)
julia
Quoted 112 lines
Signed-off-by Varsha Rao <[email protected]>--- include/linux/pid.h | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-)include/linux/pid.h +32
-12@@ -5,32 +5,32 @@enum pid_type { -PIDTYPE_PID , -PIDTYPE_PGID , -PIDTYPE_SID , -PIDTYPE_MAX +PIDTYPE_PID ,/* Process ID */ +PIDTYPE_PGID ,/* Process group ID */ +PIDTYPE_SID ,/* Process session ID */ +PIDTYPE_MAX /* Number of ID types */ };/* * What is struct pid? * * A struct pid is the kernel's internal notion of a process identifier. -* It refers to individual tasks, process groups, and sessions. While +* It refers to individual tasks, process groups, and sessions. While * there are processes attached to it the struct pid lives in a hash * table, so it and then the processes that it refers to can be found -* quickly from the numeric pid value. The attached processes may be +* quickly from the numeric pid value. The attached processes may be * quickly accessed by following pointers from struct pid. * * Storing pid_t values in the kernel and referring to them later has a -* problem. The process originally with that pid may have exited and the +* problem. The process originally with that pid may have exited and the * pid allocator wrapped, and another process could have come along * and been assigned that pid. * * Referring to user space processes by holding a reference to struct -* task_struct has a problem. When the user space process exits -* the now useless task_struct is still kept. A task_struct plus a -* stack consumes around 10K of low kernel memory. More precisely -* this is THREAD_SIZE + sizeof(struct task_struct). By comparison +* task_struct has a problem. When the user space process exits +* the now useless task_struct is still kept. A task_struct plus a +* stack consumes around 10K of low kernel memory. More precisely +* this is THREAD_SIZE + sizeof(struct task_struct). By comparison * a struct pid is about 64 bytes. * * Holding a reference to struct pid solves both of these problems. @@ -45,6 +45,10 @@ enum pid_type* struct upid is used to get the id of the struct pid, as it is * seen in particular namespace. Later the struct pid is found with * find_pid_ns() using the int nr and struct pid_namespace *ns. +* +* @nr: Pid value. +* @ns: Represents the namespace to which pid value belongs. +* @pid_chain: Hash chain. */ struct upid {@@ -54,6 +58,15 @@ struct upid {struct hlist_node pid_chain; }; +/* +* struct pid +* @count: Reference counter. +* @level: Number of namespaces in which the process is visible. +* @tasks: Lists of tasks. +* @rcu: RCU helper. +* @numbers: Instance of upid for each level. +*/ +struct pid {atomic_t count;@@ -66,12 +79,20 @@ struct pidextern struct pid init_struct_pid; +/* +* struct pid_link is used for per process linkage into hash tables. +* @node: List element. +* @pid: Pointer to the struct pid of the process. +*/ struct pid_link {struct hlist_node node;struct pid *pid; }; +/* get_pid() checks availability of process id and if available assigns +* process ID. +*/ static inline struct pid *get_pid (struct pid *pid) {if (pid) --2.9.3
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/58d79225.1bd1620a.579a7.5a9d%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.
It's not a hard and fast rule in any English dialect. I always double-space after a full stop, but there are various style manuals that prohibit it, and others that require it. Typesetters (amateur and professional) disagree intensely on it. We should not change what the original author has done.
Quoted 137 lines
-----Original Message-----
From: Julia Lawall [mailto:[email protected]]
Sent: Sunday, March 26, 2017 6:50 AM
To: Varsha Rao <[email protected]>
Cc: Matthew Wilcox <[email protected]>; outreachy-kernel <[email protected]>
Subject: Re: [Outreachy kernel] [PATCH 1/5] include: linux: pid: Update documentation.Quoted 2 lines · Varsha Rao
This patch adds comments to update documentation. Also remove extra space between full stop and and new sentence, of existing comments.
Actually, at least in American English, a period should be followed by two spaces. Like in this email :)
julia
Quoted 105 lines
Signed-off-by Varsha Rao <[email protected]>--- include/linux/pid.h | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-)include/linux/pid.h +32
-12@@ -5,32 +5,32 @@enum pid_type { -PIDTYPE_PID , -PIDTYPE_PGID , -PIDTYPE_SID , -PIDTYPE_MAX +PIDTYPE_PID ,/* Process ID */ +PIDTYPE_PGID ,/* Process group ID */ +PIDTYPE_SID ,/* Process session ID */ +PIDTYPE_MAX /* Number of ID types */ };/* * What is struct pid? * * A struct pid is the kernel's internal notion of a process identifier. -* It refers to individual tasks, process groups, and sessions. While +* It refers to individual tasks, process groups, and sessions. While * there are processes attached to it the struct pid lives in a hash * table, so it and then the processes that it refers to can be found -* quickly from the numeric pid value. The attached processes may be +* quickly from the numeric pid value. The attached processes may be * quickly accessed by following pointers from struct pid. * * Storing pid_t values in the kernel and referring to them later has a -* problem. The process originally with that pid may have exited and the +* problem. The process originally with that pid may have exited and the * pid allocator wrapped, and another process could have come along * and been assigned that pid. * * Referring to user space processes by holding a reference to struct -* task_struct has a problem. When the user space process exits -* the now useless task_struct is still kept. A task_struct plus a -* stack consumes around 10K of low kernel memory. More precisely -* this is THREAD_SIZE + sizeof(struct task_struct). By comparison +* task_struct has a problem. When the user space process exits +* the now useless task_struct is still kept. A task_struct plus a +* stack consumes around 10K of low kernel memory. More precisely +* this is THREAD_SIZE + sizeof(struct task_struct). By comparison * a struct pid is about 64 bytes. * * Holding a reference to struct pid solves both of these problems. @@ -45,6 +45,10 @@ enum pid_type* struct upid is used to get the id of the struct pid, as it is * seen in particular namespace. Later the struct pid is found with * find_pid_ns() using the int nr and struct pid_namespace *ns. +* +* @nr: Pid value. +* @ns: Represents the namespace to which pid value belongs. +* @pid_chain: Hash chain. */ struct upid {@@ -54,6 +58,15 @@ struct upid {struct hlist_node pid_chain; }; +/* +* struct pid +* @count: Reference counter. +* @level: Number of namespaces in which the process is visible. +* @tasks: Lists of tasks. +* @rcu: RCU helper. +* @numbers: Instance of upid for each level. +*/ +struct pid {atomic_t count;@@ -66,12 +79,20 @@ struct pidextern struct pid init_struct_pid; +/* +* struct pid_link is used for per process linkage into hash tables. +* @node: List element. +* @pid: Pointer to the struct pid of the process. +*/ struct pid_link {struct hlist_node node;struct pid *pid; }; +/* get_pid() checks availability of process id and if available assigns +* process ID. +*/ static inline struct pid *get_pid (struct pid *pid) {if (pid) --2.9.3
Quoted 2 lines
--
You received this message because you are subscribed to the Google Groups"outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
Quoted 2 lines
To post to this group, send email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-
kernel/58d79225.1bd1620a.579a7.5a9d%40mx.google.com.Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.
Quoted 7 lines
It's not a hard and fast rule in any English dialect. I always double-space after a full stop, but there are various style manuals that prohibit it, and others that require it. Typesetters (amateur and professional) disagree intensely on it. We should not change what the original author has done.
Okay. I'll send the revised patchset.
Regards,
Varsha Rao
PATCH 2/5 include: linux: pid: Move open brace to previous line.
In reply to a message not in the archiveMove open braces to the same line, as that of struct and enum. This patch fixes the checkpatch issue.
--- include/linux/pid.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
include/linux/pid.h +3 -6
@@ -3,8 +3,7 @@#include <linux/rculist.h> -enum pid_type -{ +enum pid_type {PIDTYPE_PID ,/* Process ID */ PIDTYPE_PGID ,/* Process group ID */ PIDTYPE_SID ,/* Process session ID */
@@ -67,8 +66,7 @@ struct upid {* @numbers: Instance of upid for each level. */ -struct pid -{ +struct pid {atomic_t count;unsigned int level;/* lists of tasks that use this pid */
@@ -84,8 +82,7 @@ extern struct pid init_struct_pid;* @node: List element. * @pid: Pointer to the struct pid of the process. */ -struct pid_link -{ +struct pid_link {struct hlist_node node;struct pid *pid; };
Signature · 1 line
2.9.3
PATCH 3/5 include: linux: pid: Add identifier to function definition argument.
In reply to a message not in the archiveAdd ns as the identifier to function definition argument struct pid_namespace and this patch fixes the checkpatch issue.
--- include/linux/pid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/pid.h +1 -1
@@ -132,7 +132,7 @@ extern struct pid *find_vpid(int nr);* Lookup a PID in the hash table, and return with it's count elevated. */ extern struct pid *find_get_pid (int nr); -extern struct pid *find_ge_pid (int nr,struct pid_namespace *); +extern struct pid *find_ge_pid (int nr,struct pid_namespace *ns);int next_pidmap (struct pid_namespace *pid_ns,unsigned int last);extern struct pid *alloc_pid (struct pid_namespace *ns);
Signature · 1 line
2.9.3
PATCH 4/5 include: linux: pid: Add a blank line after declarations.
In reply to a message not in the archiveAdd a blank line after declarations and this patch fixes the checkpatch issue.
--- include/linux/pid.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/pid.h +2 -0
@@ -152,6 +152,7 @@ extern void disable_pid_allocation(struct pid_namespace *ns);static inline struct pid_namespace *ns_of_pid (struct pid *pid) {struct pid_namespace *ns =NULL ; +if (pid) ns = pid->numbers[pid->level].ns;return ns;
@@ -182,6 +183,7 @@ static inline bool is_child_reaper(struct pid *pid)static inline pid_t pid_nr (struct pid *pid) {pid_t nr =0 ; +if (pid) nr = pid->numbers[0 ].nr;return nr;
Signature · 1 line
2.9.3
PATCH 5/5 include: linux: pid: Remove space before tabs.
In reply to a message not in the archiveRemove space before tabs. This patch fixes the following checkpatch issue:
WARNING: please, no space before tabs
--- include/linux/pid.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/pid.h +4 -4
@@ -144,10 +144,10 @@ extern void disable_pid_allocation(struct pid_namespace *ns);* allocated. * * NOTE: -* ns_of_pid() is expected to be called for a process (task) that has -* an attached 'struct pid' (see attach_pid(), detach_pid()) i.e @pid -* is expected to be non-NULL. If @pid is NULL, caller should handle -* the resulting NULL pid-ns. +* ns_of_pid() is expected to be called for a process (task) that has +* an attached 'struct pid' (see attach_pid(), detach_pid()) i.e @pid +* is expected to be non-NULL. If @pid is NULL, caller should handle +* the resulting NULL pid-ns. */ static inline struct pid_namespace *ns_of_pid (struct pid *pid) {
Signature · 1 line
2.9.3