All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: fixup get_user_pages* comments
Date: Wed, 26 Oct 2016 11:07:46 +0200	[thread overview]
Message-ID: <20161026090746.GB18382@dhcp22.suse.cz> (raw)
In-Reply-To: <20161025233435.5338-1-lstoakes@gmail.com>

On Wed 26-10-16 00:34:35, Lorenzo Stoakes wrote:
> In the previous round of get_user_pages* changes comments attached to
> __get_user_pages_unlocked() and get_user_pages_unlocked() were rendered
> incorrect, this patch corrects them.
> 
> In addition the get_user_pages_unlocked() comment seems to have already been
> outdated as it referred to tsk, mm parameters which were removed in c12d2da5
> ("mm/gup: Remove the macro overload API migration helpers from the get_user*()
> APIs"), this patch fixes this also.
> 
> Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/gup.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index ec4f827..e6147f1 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -857,14 +857,12 @@ long get_user_pages_locked(unsigned long start, unsigned long nr_pages,
>  EXPORT_SYMBOL(get_user_pages_locked);
>  
>  /*
> - * Same as get_user_pages_unlocked(...., FOLL_TOUCH) but it allows to
> - * pass additional gup_flags as last parameter (like FOLL_HWPOISON).
> + * Same as get_user_pages_unlocked(...., FOLL_TOUCH) but it allows for
> + * tsk, mm to be specified.
>   *
>   * NOTE: here FOLL_TOUCH is not set implicitly and must be set by the
> - * caller if required (just like with __get_user_pages). "FOLL_GET",
> - * "FOLL_WRITE" and "FOLL_FORCE" are set implicitly as needed
> - * according to the parameters "pages", "write", "force"
> - * respectively.
> + * caller if required (just like with __get_user_pages). "FOLL_GET"
> + * is set implicitly if "pages" is non-NULL.
>   */
>  __always_inline long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
>  					       unsigned long start, unsigned long nr_pages,
> @@ -894,10 +892,8 @@ EXPORT_SYMBOL(__get_user_pages_unlocked);
>   *      get_user_pages_unlocked(tsk, mm, ..., pages);
>   *
>   * It is functionally equivalent to get_user_pages_fast so
> - * get_user_pages_fast should be used instead, if the two parameters
> - * "tsk" and "mm" are respectively equal to current and current->mm,
> - * or if "force" shall be set to 1 (get_user_pages_fast misses the
> - * "force" parameter).
> + * get_user_pages_fast should be used instead if specific gup_flags
> + * (e.g. FOLL_FORCE) are not required.
>   */
>  long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
>  			     struct page **pages, unsigned int gup_flags)
> -- 
> 2.10.1

-- 
Michal Hocko
SUSE Labs

WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@kernel.org>
To: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: fixup get_user_pages* comments
Date: Wed, 26 Oct 2016 11:07:46 +0200	[thread overview]
Message-ID: <20161026090746.GB18382@dhcp22.suse.cz> (raw)
In-Reply-To: <20161025233435.5338-1-lstoakes@gmail.com>

On Wed 26-10-16 00:34:35, Lorenzo Stoakes wrote:
> In the previous round of get_user_pages* changes comments attached to
> __get_user_pages_unlocked() and get_user_pages_unlocked() were rendered
> incorrect, this patch corrects them.
> 
> In addition the get_user_pages_unlocked() comment seems to have already been
> outdated as it referred to tsk, mm parameters which were removed in c12d2da5
> ("mm/gup: Remove the macro overload API migration helpers from the get_user*()
> APIs"), this patch fixes this also.
> 
> Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/gup.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index ec4f827..e6147f1 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -857,14 +857,12 @@ long get_user_pages_locked(unsigned long start, unsigned long nr_pages,
>  EXPORT_SYMBOL(get_user_pages_locked);
>  
>  /*
> - * Same as get_user_pages_unlocked(...., FOLL_TOUCH) but it allows to
> - * pass additional gup_flags as last parameter (like FOLL_HWPOISON).
> + * Same as get_user_pages_unlocked(...., FOLL_TOUCH) but it allows for
> + * tsk, mm to be specified.
>   *
>   * NOTE: here FOLL_TOUCH is not set implicitly and must be set by the
> - * caller if required (just like with __get_user_pages). "FOLL_GET",
> - * "FOLL_WRITE" and "FOLL_FORCE" are set implicitly as needed
> - * according to the parameters "pages", "write", "force"
> - * respectively.
> + * caller if required (just like with __get_user_pages). "FOLL_GET"
> + * is set implicitly if "pages" is non-NULL.
>   */
>  __always_inline long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
>  					       unsigned long start, unsigned long nr_pages,
> @@ -894,10 +892,8 @@ EXPORT_SYMBOL(__get_user_pages_unlocked);
>   *      get_user_pages_unlocked(tsk, mm, ..., pages);
>   *
>   * It is functionally equivalent to get_user_pages_fast so
> - * get_user_pages_fast should be used instead, if the two parameters
> - * "tsk" and "mm" are respectively equal to current and current->mm,
> - * or if "force" shall be set to 1 (get_user_pages_fast misses the
> - * "force" parameter).
> + * get_user_pages_fast should be used instead if specific gup_flags
> + * (e.g. FOLL_FORCE) are not required.
>   */
>  long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
>  			     struct page **pages, unsigned int gup_flags)
> -- 
> 2.10.1

-- 
Michal Hocko
SUSE Labs

--
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:[~2016-10-26  9:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 23:34 [PATCH] mm: fixup get_user_pages* comments Lorenzo Stoakes
2016-10-25 23:34 ` Lorenzo Stoakes
2016-10-26  9:07 ` Michal Hocko [this message]
2016-10-26  9:07   ` 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=20161026090746.GB18382@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=torvalds@linux-foundation.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 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.