Re: [PATCH v4 12/19] mm: memcg/slab: use a single set of kmem_caches for all accounted allocations
From: Vlastimil Babka
Date: Wed May 27 2020 - 12:01:25 EST
On 5/26/20 11:42 PM, Roman Gushchin wrote:
> @@ -549,17 +503,14 @@ static __always_inline int charge_slab_page(struct page *page,
> gfp_t gfp, int order,
> struct kmem_cache *s)
> {
> -#ifdef CONFIG_MEMCG_KMEM
> if (memcg_kmem_enabled() && !is_root_cache(s)) {
> int ret;
>
> ret = memcg_alloc_page_obj_cgroups(page, s, gfp);
> if (ret)
> return ret;
> -
> - percpu_ref_get_many(&s->memcg_params.refcnt, 1 << order);
> }
> -#endif
> +
> mod_node_page_state(page_pgdat(page), cache_vmstat_idx(s),
> PAGE_SIZE << order);
> return 0;
> @@ -568,12 +519,9 @@ static __always_inline int charge_slab_page(struct page *page,
> static __always_inline void uncharge_slab_page(struct page *page, int order,
> struct kmem_cache *s)
> {
> -#ifdef CONFIG_MEMCG_KMEM
> if (memcg_kmem_enabled() && !is_root_cache(s)) {
> memcg_free_page_obj_cgroups(page);
> - percpu_ref_put_many(&s->memcg_params.refcnt, 1 << order);
> - }
This now leaves the { bracket unterminated, breaking compilation.