lkml.org 
[lkml]   [2011]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH]mm/migrate.c: clean up comment
On Sat, 07 May 2011 00:03:11 +0800
"Figo.zhang" <figo1802@gmail.com> wrote:

>
> clean up comment. prepare cgroup return 0 or -ENOMEN, others return -EAGAIN.
> avoid conflict meanings.
>
> Signed-off-by: Figo.zhang <figo1802@gmail.com>
> ---
> mm/migrate.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 34132f8..d65b351 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -647,7 +647,6 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
> if (unlikely(split_huge_page(page)))
> goto move_newpage;
>
> - /* prepare cgroup just returns 0 or -ENOMEM */
> rc = -EAGAIN;
>
> if (!trylock_page(page)) {
> @@ -687,7 +686,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
> goto unlock;
> }
>
> - /* charge against new page */
> + /* charge against new page, return 0 or -ENOMEM */
> charge = mem_cgroup_prepare_migration(page, newpage, &mem, GFP_KERNEL);
> if (charge == -ENOMEM) {
> rc = -ENOMEM;

Well it's still pretty confusing - the function can also return -EAGAIN
and -EBUSY, at least.

It would be better to remove this random sprinkle of commentlets and to
properly document unmap_and_move()'s interface in the usual fashion, in
its leading comment block.



\
 
 \ /
  Last update: 2011-05-09 23:17    [W:0.034 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site