lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160304180237.GD24204@dhcp22.suse.cz>
Date:	Fri, 4 Mar 2016 19:02:39 +0100
From:	Michal Hocko <mhocko@...nel.org>
To:	Johannes Weiner <hannes@...xchg.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Hugh Dickins <hughd@...gle.com>,
	Vladimir Davydov <vdavydov@...tuozzo.com>,
	Mateusz Guzik <mguzik@...hat.com>,
	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
	linux-mm@...ck.org, cgroups@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH 1/2] mm: migrate: consolidate mem_cgroup_migrate() calls

On Thu 04-02-16 15:07:46, Johannes Weiner wrote:
> Rather than scattering mem_cgroup_migrate() calls all over the place,
> have a single call from a safe place where every migration operation
> eventually ends up in - migrate_page_copy().

This is very nice!

> Signed-off-by: Johannes Weiner <hannes@...xchg.org>
> Suggested-by: Hugh Dickins <hughd@...gle.com>

Sorry for coming so late.
Acked-by: Michal Hocko <mhocko@...e.com>

> ---
>  mm/migrate.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 17db63b2dd36..90cbf7c65cac 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -331,8 +331,6 @@ int migrate_page_move_mapping(struct address_space *mapping,
>  		if (PageSwapBacked(page))
>  			SetPageSwapBacked(newpage);
>  
> -		mem_cgroup_migrate(page, newpage);
> -
>  		return MIGRATEPAGE_SUCCESS;
>  	}
>  
> @@ -428,8 +426,6 @@ int migrate_page_move_mapping(struct address_space *mapping,
>  	}
>  	local_irq_enable();
>  
> -	mem_cgroup_migrate(page, newpage);
> -
>  	return MIGRATEPAGE_SUCCESS;
>  }
>  
> @@ -471,8 +467,6 @@ int migrate_huge_page_move_mapping(struct address_space *mapping,
>  
>  	spin_unlock_irq(&mapping->tree_lock);
>  
> -	mem_cgroup_migrate(page, newpage);
> -
>  	return MIGRATEPAGE_SUCCESS;
>  }
>  
> @@ -586,6 +580,8 @@ void migrate_page_copy(struct page *newpage, struct page *page)
>  		end_page_writeback(newpage);
>  
>  	copy_page_owner(page, newpage);
> +
> +	mem_cgroup_migrate(page, newpage);
>  }
>  
>  /************************************************************
> @@ -1846,7 +1842,6 @@ fail_putback:
>  	}
>  
>  	mlock_migrate_page(new_page, page);
> -	mem_cgroup_migrate(page, new_page);
>  	page_remove_rmap(page, true);
>  	set_page_owner_migrate_reason(new_page, MR_NUMA_MISPLACED);
>  
> -- 
> 2.7.0

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ