All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Varsha Rao <rvarsha016@gmail.com>
Cc: mawilcox@microsoft.com,
	 outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: Re: [Outreachy kernel] [PATCH 1/5] include: linux: pid: Update documentation.
Date: Sun, 26 Mar 2017 12:49:40 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1703261248590.2204@hadrien> (raw)
In-Reply-To: <58d79225.1bd1620a.579a7.5a9d@mx.google.com>



On Sun, 26 Mar 2017, Varsha Rao wrote:

> 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

>
> Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
> ---
>  include/linux/pid.h | 43 ++++++++++++++++++++++++++++++++-----------
>  1 file changed, 32 insertions(+), 11 deletions(-)
>
> diff --git a/include/linux/pid.h b/include/linux/pid.h
> index 4d17931..c2bea47 100644
> --- a/include/linux/pid.h
> +++ b/include/linux/pid.h
> @@ -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 pid
>
>  extern 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>


  reply	other threads:[~2017-03-26 10:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1490516333.git.rvarsha016@gmail.com>
2017-03-26 10:04 ` [PATCH 1/5] include: linux: pid: Update documentation Varsha Rao
2017-03-26 10:49   ` Julia Lawall [this message]
2017-03-26 13:52     ` [Outreachy kernel] " Matthew Wilcox
2017-03-26 14:10       ` Varsha Rao
2017-03-26 10:05 ` [PATCH 2/5] include: linux: pid: Move open brace to previous line Varsha Rao
2017-03-26 10:06 ` [PATCH 3/5] include: linux: pid: Add identifier to function definition argument Varsha Rao
2017-03-26 10:07 ` [PATCH 4/5] include: linux: pid: Add a blank line after declarations Varsha Rao
2017-03-26 10:08 ` [PATCH 5/5] include: linux: pid: Remove space before tabs Varsha Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1703261248590.2204@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=mawilcox@microsoft.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=rvarsha016@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.