linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, Peter Zijlstra <peterz@infradead.org>,
	"Kirill A . Shutemov" <kirill@shutemov.name>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] mm: add new mmget() helper
Date: Mon, 9 Jan 2017 15:18:08 -0800	[thread overview]
Message-ID: <20170109151808.f2ea647c1cf3d2cc9734a88c@linux-foundation.org> (raw)
In-Reply-To: <20161218123229.22952-2-vegard.nossum@oracle.com>

On Sun, 18 Dec 2016 13:32:27 +0100 Vegard Nossum <vegard.nossum@oracle.com> wrote:

> Apart from adding the helper function itself, the rest of the kernel is
> converted mechanically using:
> 
>   git grep -l 'atomic_inc.*mm_users' | xargs sed -i 's/atomic_inc(&\(.*\)->mm_users);/mmget\(\1\);/'
>   git grep -l 'atomic_inc.*mm_users' | xargs sed -i 's/atomic_inc(&\(.*\)\.mm_users);/mmget\(\&\1\);/'
> 
> This is needed for a later patch that hooks into the helper, but might be
> a worthwhile cleanup on its own.
>
> ...
>

mmgrap() and mmget() naming is really quite confusing.

> --- a/arch/arc/kernel/smp.c
> +++ b/arch/arc/kernel/smp.c
> @@ -124,7 +124,7 @@ void start_kernel_secondary(void)
>  	/* MMU, Caches, Vector Table, Interrupts etc */
>  	setup_processor();
>  
> -	atomic_inc(&mm->mm_users);
> +	mmget(mm);

I wonder if mmuse() would be a bit clearer than mmget().  Although that
sounds like use_mm().

--
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>

  reply	other threads:[~2017-01-09 23:16 UTC|newest]

Thread overview: 10+ 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 [this message]
2016-12-18 12:32 ` [PATCH 3/4] mm: use mmget_not_zero() helper Vegard Nossum
2016-12-18 12:32 ` [PATCH 4/4] mm: clarify mm_struct.mm_{users,count} documentation Vegard Nossum
2016-12-19 13:15   ` Michal Hocko
2016-12-19 10:29 ` [PATCH 1/4] mm: add new mmgrab() helper Peter Zijlstra
2016-12-22 22:03 ` David Rientjes
  -- strict thread matches above, loose matches on Subject: below --
2016-12-16  8:21 Vegard Nossum
2016-12-16  8:22 ` [PATCH 2/4] mm: add new mmget() helper Vegard Nossum
2016-12-16  9:26   ` Michal Hocko

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=20170109151808.f2ea647c1cf3d2cc9734a88c@linux-foundation.org \
    --to=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 \
    --cc=vegard.nossum@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).