Re: [PATCH v4 12/19] mm: memcg/slab: use a single set of kmem_caches for all accounted allocations

From: Roman Gushchin
Date: Wed May 27 2020 - 12:30:20 EST


On Wed, May 27, 2020 at 06:01:20PM +0200, Vlastimil Babka wrote:
> 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.

Ah, indeed, thank you for noticing!
It's fixed by later patches in the patchset, so this is how I missed it.

Let me fix the build, add yours and Johannes's acks and send v5.

Thanks!