LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Wang Long <wanglong19@meituan.com>
Cc: hannes@cmpxchg.org, vdavydov.dev@gmail.com,
	aryabinin@virtuozzo.com, akpm@linux-foundation.org,
	khlebnikov@yandex-team.ru, xboe@kernel.dk, jack@suse.cz,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	gthelen@google.com, tj@kernel.org
Subject: Re: [PATCH v2] memcg: writeback: use memcg->cgwb_list directly
Date: Fri, 27 Apr 2018 13:46:03 +0200	[thread overview]
Message-ID: <20180427114603.GG17484@dhcp22.suse.cz> (raw)
In-Reply-To: <1524406173-212182-1-git-send-email-wanglong19@meituan.com>

On Sun 22-04-18 22:09:33, Wang Long wrote:
> mem_cgroup_cgwb_list is a very simple wrapper and it will
> never be used outside of code under CONFIG_CGROUP_WRITEBACK.
> so use memcg->cgwb_list directly.

Thanks for adding the changelog
 
> Reviewed-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Wang Long <wanglong19@meituan.com>

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

> ---
>  include/linux/memcontrol.h | 1 -
>  mm/backing-dev.c           | 4 ++--
>  mm/memcontrol.c            | 5 -----
>  3 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index d99b71b..c0056e0 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -1093,7 +1093,6 @@ static inline void dec_lruvec_page_state(struct page *page,
>  
>  #ifdef CONFIG_CGROUP_WRITEBACK
>  
> -struct list_head *mem_cgroup_cgwb_list(struct mem_cgroup *memcg);
>  struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb);
>  void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages,
>  			 unsigned long *pheadroom, unsigned long *pdirty,
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 023190c..0a48e05 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -555,7 +555,7 @@ static int cgwb_create(struct backing_dev_info *bdi,
>  	memcg = mem_cgroup_from_css(memcg_css);
>  	blkcg_css = cgroup_get_e_css(memcg_css->cgroup, &io_cgrp_subsys);
>  	blkcg = css_to_blkcg(blkcg_css);
> -	memcg_cgwb_list = mem_cgroup_cgwb_list(memcg);
> +	memcg_cgwb_list = &memcg->cgwb_list;
>  	blkcg_cgwb_list = &blkcg->cgwb_list;
>  
>  	/* look up again under lock and discard on blkcg mismatch */
> @@ -734,7 +734,7 @@ static void cgwb_bdi_unregister(struct backing_dev_info *bdi)
>   */
>  void wb_memcg_offline(struct mem_cgroup *memcg)
>  {
> -	struct list_head *memcg_cgwb_list = mem_cgroup_cgwb_list(memcg);
> +	struct list_head *memcg_cgwb_list = &memcg->cgwb_list;
>  	struct bdi_writeback *wb, *next;
>  
>  	spin_lock_irq(&cgwb_lock);
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index e074f7c..d1adb9c 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3562,11 +3562,6 @@ static int mem_cgroup_oom_control_write(struct cgroup_subsys_state *css,
>  
>  #ifdef CONFIG_CGROUP_WRITEBACK
>  
> -struct list_head *mem_cgroup_cgwb_list(struct mem_cgroup *memcg)
> -{
> -	return &memcg->cgwb_list;
> -}
> -
>  static int memcg_wb_domain_init(struct mem_cgroup *memcg, gfp_t gfp)
>  {
>  	return wb_domain_init(&memcg->cgwb_domain, gfp);
> -- 
> 1.8.3.1

-- 
Michal Hocko
SUSE Labs

      parent reply	other threads:[~2018-04-27 11:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-22 14:09 Wang Long
2018-04-26 18:54 ` Tejun Heo
2018-04-27 11:46 ` Michal Hocko [this message]

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=20180427114603.GG17484@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=gthelen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=jack@suse.cz \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.org \
    --cc=vdavydov.dev@gmail.com \
    --cc=wanglong19@meituan.com \
    --cc=xboe@kernel.dk \
    --subject='Re: [PATCH v2] memcg: writeback: use memcg->cgwb_list directly' \
    /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

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