Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1544135 > unrolled thread
| Started by | Vegard Nossum <vegard.nossum@oracle.com> |
|---|---|
| First post | 2016-12-18 13:40 +0100 |
| Last post | 2016-12-19 14:20 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 4/4] mm: clarify mm_struct.mm_{users,count} documentation Vegard Nossum <vegard.nossum@oracle.com> - 2016-12-18 13:40 +0100
Re: [PATCH 4/4] mm: clarify mm_struct.mm_{users,count} documentation Michal Hocko <mhocko@kernel.org> - 2016-12-19 14:20 +0100
| From | Vegard Nossum <vegard.nossum@oracle.com> |
|---|---|
| Date | 2016-12-18 13:40 +0100 |
| Subject | [PATCH 4/4] mm: clarify mm_struct.mm_{users,count} documentation |
| Message-ID | <sPIUW-7Lp-5@gated-at.bofh.it> |
Clarify documentation relating to mm_users and mm_count, and switch to
kernel-doc syntax.
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
---
include/linux/mm_types.h | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 08d947fc4c59..316c3e1fc226 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -407,8 +407,27 @@ struct mm_struct {
unsigned long task_size; /* size of task vm space */
unsigned long highest_vm_end; /* highest vma end address */
pgd_t * pgd;
- atomic_t mm_users; /* How many users with user space? */
- atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
+
+ /**
+ * @mm_users: The number of users including userspace.
+ *
+ * Use mmget()/mmget_not_zero()/mmput() to modify. When this drops
+ * to 0 (i.e. when the task exits and there are no other temporary
+ * reference holders), we also release a reference on @mm_count
+ * (which may then free the &struct mm_struct if @mm_count also
+ * drops to 0).
+ */
+ atomic_t mm_users;
+
+ /**
+ * @mm_count: The number of references to &struct mm_struct
+ * (@mm_users count as 1).
+ *
+ * Use mmgrab()/mmdrop() to modify. When this drops to 0, the
+ * &struct mm_struct is freed.
+ */
+ atomic_t mm_count;
+
atomic_long_t nr_ptes; /* PTE page table pages */
#if CONFIG_PGTABLE_LEVELS > 2
atomic_long_t nr_pmds; /* PMD page table pages */
--
2.11.0.1.gaa10c3f
[toc] | [next] | [standalone]
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Date | 2016-12-19 14:20 +0100 |
| Message-ID | <sQ61c-8fM-15@gated-at.bofh.it> |
| In reply to | #1544135 |
On Sun 18-12-16 13:32:29, Vegard Nossum wrote:
> Clarify documentation relating to mm_users and mm_count, and switch to
> kernel-doc syntax.
Looks good to me.
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> include/linux/mm_types.h | 23 +++++++++++++++++++++--
> 1 file changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 08d947fc4c59..316c3e1fc226 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -407,8 +407,27 @@ struct mm_struct {
> unsigned long task_size; /* size of task vm space */
> unsigned long highest_vm_end; /* highest vma end address */
> pgd_t * pgd;
> - atomic_t mm_users; /* How many users with user space? */
> - atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
> +
> + /**
> + * @mm_users: The number of users including userspace.
> + *
> + * Use mmget()/mmget_not_zero()/mmput() to modify. When this drops
> + * to 0 (i.e. when the task exits and there are no other temporary
> + * reference holders), we also release a reference on @mm_count
> + * (which may then free the &struct mm_struct if @mm_count also
> + * drops to 0).
> + */
> + atomic_t mm_users;
> +
> + /**
> + * @mm_count: The number of references to &struct mm_struct
> + * (@mm_users count as 1).
> + *
> + * Use mmgrab()/mmdrop() to modify. When this drops to 0, the
> + * &struct mm_struct is freed.
> + */
> + atomic_t mm_count;
> +
> atomic_long_t nr_ptes; /* PTE page table pages */
> #if CONFIG_PGTABLE_LEVELS > 2
> atomic_long_t nr_pmds; /* PMD page table pages */
> --
> 2.11.0.1.gaa10c3f
>
--
Michal Hocko
SUSE Labs
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web