From: Vegard Nossum <vegard.nossum@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.com>,
linux-mm@kvack.org
Cc: Peter Zijlstra <peterz@infradead.org>,
"Kirill A . Shutemov" <kirill@shutemov.name>,
linux-kernel@vger.kernel.org,
Vegard Nossum <vegard.nossum@oracle.com>
Subject: [PATCH 4/4] mm: clarify mm_struct.mm_{users,count} documentation
Date: Sun, 18 Dec 2016 13:32:29 +0100 [thread overview]
Message-ID: <20161218123229.22952-4-vegard.nossum@oracle.com> (raw)
In-Reply-To: <20161218123229.22952-1-vegard.nossum@oracle.com>
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
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-12-18 12:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-18 12:32 [PATCH 1/4] mm: add new mmgrab() helper Vegard Nossum
2016-12-18 12:32 ` [PATCH 2/4] mm: add new mmget() helper Vegard Nossum
2017-01-09 23:18 ` Andrew Morton
2016-12-18 12:32 ` [PATCH 3/4] mm: use mmget_not_zero() helper Vegard Nossum
2016-12-18 12:32 ` Vegard Nossum [this message]
2016-12-19 13:15 ` [PATCH 4/4] mm: clarify mm_struct.mm_{users,count} documentation Michal Hocko
2016-12-19 10:29 ` [PATCH 1/4] mm: add new mmgrab() helper Peter Zijlstra
2016-12-22 22:03 ` David Rientjes
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=20161218123229.22952-4-vegard.nossum@oracle.com \
--to=vegard.nossum@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=peterz@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox