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: <20201106184527.GD3976735@iweiny-DESK2.sc.intel.com>
Date:   Fri, 6 Nov 2020 10:45:27 -0800
From:   Ira Weiny <ira.weiny@...el.com>
To:     Alex Shi <alex.shi@...ux.alibaba.com>
Cc:     hannes@...xchg.org, akpm@...ux-foundation.org,
        Michal Hocko <mhocko@...nel.org>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        cgroups@...r.kernel.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/memcg: update page struct member in comments

On Fri, Nov 06, 2020 at 07:33:33PM +0800, Alex Shi wrote:
> The page->mem_cgroup member is replaced by memcg_data, and add a helper
> page_memcg() for it. Need to update comments to avoid confusing.

I'm not an expert in this code but IMO the pointer manipulation of
page->mem_cgroup could be thought of as local to the code in mm/memcontrol.c.
As such the detail of the member of the page struct that the code depends on is
a valuable part of the comment.  Having to look at page_memcg() to find out
this information is kind of annoying.

Ira

> 
> Signed-off-by: Alex Shi <alex.shi@...ux.alibaba.com>
> Cc: Johannes Weiner <hannes@...xchg.org> 
> Cc: Michal Hocko <mhocko@...nel.org> 
> Cc: Vladimir Davydov <vdavydov.dev@...il.com> 
> Cc: Andrew Morton <akpm@...ux-foundation.org> 
> Cc: cgroups@...r.kernel.org 
> Cc: linux-mm@...ck.org 
> Cc: linux-kernel@...r.kernel.org 
> ---
>  mm/memcontrol.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index b2aa3b73ab82..8a8debea34fc 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1310,7 +1310,7 @@ int mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
>   * @page: the page
>   * @pgdat: pgdat of the page
>   *
> - * This function relies on page->mem_cgroup being stable - see the
> + * This function relies on page_memcg(page) being stable - see the
>   * access rules in commit_charge().
>   */
>  struct lruvec *mem_cgroup_page_lruvec(struct page *page, struct pglist_data *pgdat)
> @@ -2862,7 +2862,7 @@ static void commit_charge(struct page *page, struct mem_cgroup *memcg)
>  {
>  	VM_BUG_ON_PAGE(page_memcg(page), page);
>  	/*
> -	 * Any of the following ensures page->mem_cgroup stability:
> +	 * Any of the following ensures page_memcg(page) stability:
>  	 *
>  	 * - the page lock
>  	 * - LRU isolation
> -- 
> 1.8.3.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ