Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544514

Re: [PATCH 4/4] mm: clarify mm_struct.mm_{users,count} documentation

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 4/4] mm: clarify mm_struct.mm_{users,count} documentation
Date Mon, 19 Dec 2016 14:20:02 +0100
Message-ID <sQ61c-8fM-15@gated-at.bofh.it> (permalink)
References <sPIUW-7Lp-7@gated-at.bofh.it> <sPIUW-7Lp-5@gated-at.bofh.it>
X-Original-To Vegard Nossum <vegard.nossum@oracle.com>
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=a3UaqFLMDlPYLjzlx62YBws1JXU2jDkyjPCswOehYcM=; b=FUVASGxtYNuvDfge0X4+TzncYCwz49KVk43SRaYLL09U4fY2gdFMzuI6uULkkFdqG+ NCUjT93lcnMXd1x5Si2d0HZZXS/VUWkMU0mWM16Q8c9tbIN9vxqiIhZgjTjuKpnlN8s8 RaxZzYb1iofSEChIGctWSNvy7fxUncqUSHRm1UHxr7qXLM384bypJ6fxnhcARveXtZGR N0HGMBT6/O5cE5krGNuI4AGV+u8a3oubhz7fYAwNi2KlHkkdPbrh8KvPrTl6upxbja3k 2PYKIEVUHQBP+FucmAB7WriJ4leWq4gjzHAcbBg/gbv4fr3k6KIe/ItZ6jfNg7s4aOC1 cUAw==
X-Gm-Message-State AKaTC01G/4KoVuf1fOH/Tya3U79Q8oIgp21eYNfCSfGLp56KEBLO3FLEn9GLc/Ek8kYsGA==
X-Received by 10.194.171.200 with SMTP id aw8mr13206770wjc.79.1482153357646; Mon, 19 Dec 2016 05:15:57 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.6.0 (2016-04-01)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 55
Organization linux.* mail to news gateway
X-Original-Cc Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, Peter Zijlstra <peterz@infradead.org>, "Kirill A . Shutemov" <kirill@shutemov.name>, linux-kernel@vger.kernel.org
X-Original-Date Mon, 19 Dec 2016 14:15:56 +0100
X-Original-Message-ID <20161219131556.GA5164@dhcp22.suse.cz>
X-Original-References <20161218123229.22952-1-vegard.nossum@oracle.com> <20161218123229.22952-4-vegard.nossum@oracle.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1544514

Show key headers only | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[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

csiph-web