linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Roman Gushchin <guro@fb.com>, Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Shakeel Butt <shakeelb@google.com>,
	linux-mm@kvack.org, kernel-team@fb.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] mm: slab: rename (un)charge_slab_page() to (un)account_slab_page()
Date: Wed, 8 Jul 2020 13:16:44 +0200	[thread overview]
Message-ID: <70dedb7e-7402-0297-4ed3-5c0da64d46cd@suse.cz> (raw)
In-Reply-To: <20200707173612.124425-2-guro@fb.com>

On 7/7/20 7:36 PM, Roman Gushchin wrote:
> charge_slab_page() and uncharge_slab_page() are not related anymore
> to memcg charging and uncharging. In order to make their names
> less confusing, let's rename them to account_slab_page() and
> unaccount_slab_page() respectively.
> 
> Signed-off-by: Roman Gushchin <guro@fb.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/slab.c | 4 ++--
>  mm/slab.h | 8 ++++----
>  mm/slub.c | 4 ++--
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index fafd46877504..300adfb67245 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -1379,7 +1379,7 @@ static struct page *kmem_getpages(struct kmem_cache *cachep, gfp_t flags,
>  		return NULL;
>  	}
>  
> -	charge_slab_page(page, cachep->gfporder, cachep);
> +	account_slab_page(page, cachep->gfporder, cachep);
>  	__SetPageSlab(page);
>  	/* Record if ALLOC_NO_WATERMARKS was set when allocating the slab */
>  	if (sk_memalloc_socks() && page_is_pfmemalloc(page))
> @@ -1403,7 +1403,7 @@ static void kmem_freepages(struct kmem_cache *cachep, struct page *page)
>  
>  	if (current->reclaim_state)
>  		current->reclaim_state->reclaimed_slab += 1 << order;
> -	uncharge_slab_page(page, order, cachep);
> +	unaccount_slab_page(page, order, cachep);
>  	__free_pages(page, order);
>  }
>  
> diff --git a/mm/slab.h b/mm/slab.h
> index 704a65713f81..72ff7cd933db 100644
> --- a/mm/slab.h
> +++ b/mm/slab.h
> @@ -440,15 +440,15 @@ static inline struct kmem_cache *virt_to_cache(const void *obj)
>  	return page->slab_cache;
>  }
>  
> -static __always_inline void charge_slab_page(struct page *page, int order,
> -					     struct kmem_cache *s)
> +static __always_inline void account_slab_page(struct page *page, int order,
> +					      struct kmem_cache *s)
>  {
>  	mod_node_page_state(page_pgdat(page), cache_vmstat_idx(s),
>  			    PAGE_SIZE << order);
>  }
>  
> -static __always_inline void uncharge_slab_page(struct page *page, int order,
> -					       struct kmem_cache *s)
> +static __always_inline void unaccount_slab_page(struct page *page, int order,
> +						struct kmem_cache *s)
>  {
>  	if (memcg_kmem_enabled())
>  		memcg_free_page_obj_cgroups(page);
> diff --git a/mm/slub.c b/mm/slub.c
> index d9b33a935e58..5cffd3fd440b 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -1621,7 +1621,7 @@ static inline struct page *alloc_slab_page(struct kmem_cache *s,
>  		page = __alloc_pages_node(node, flags, order);
>  
>  	if (page)
> -		charge_slab_page(page, order, s);
> +		account_slab_page(page, order, s);
>  
>  	return page;
>  }
> @@ -1844,7 +1844,7 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
>  	page->mapping = NULL;
>  	if (current->reclaim_state)
>  		current->reclaim_state->reclaimed_slab += pages;
> -	uncharge_slab_page(page, order, s);
> +	unaccount_slab_page(page, order, s);
>  	__free_pages(page, order);
>  }
>  
> 


  parent reply	other threads:[~2020-07-08 11:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 17:36 [PATCH 1/3] mm: memcg/slab: remove unused argument by charge_slab_page() Roman Gushchin
2020-07-07 17:36 ` [PATCH 2/3] mm: slab: rename (un)charge_slab_page() to (un)account_slab_page() Roman Gushchin
2020-07-07 17:51   ` Shakeel Butt
2020-07-08 11:16   ` Vlastimil Babka [this message]
2020-07-07 17:36 ` [PATCH 3/3] mm: kmem: switch to static_branch_likely() in memcg_kmem_enabled() Roman Gushchin
2020-07-07 17:52   ` Shakeel Butt
2020-07-08 11:17   ` Vlastimil Babka
2020-07-07 17:50 ` [PATCH 1/3] mm: memcg/slab: remove unused argument by charge_slab_page() Shakeel Butt
2020-07-08 11:16 ` Vlastimil Babka

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=70dedb7e-7402-0297-4ed3-5c0da64d46cd@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=shakeelb@google.com \
    /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 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).