Re: linux-next: build failure after merge of the akpm-current tree

From: Andrew Morton
Date: Tue Jul 09 2019 - 16:42:41 EST


On Tue, 9 Jul 2019 21:15:59 +1000 Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:

> Hi all,
>
> After merging the akpm-current tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
>
> arm-linux-gnueabi-ld: mm/list_lru.o: in function `list_lru_add':
> list_lru.c:(.text+0x1a0): undefined reference to `memcg_set_shrinker_bit'
>
> Caused by commit
>
> ca37e9e5f18d ("mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2")
>
> CONFIG_MEMCG is not set for this build.
>
> I have reverted that commit for today.

Thanks. This, I suppose:

--- a/include/linux/memcontrol.h~mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2-fix
+++ a/include/linux/memcontrol.h
@@ -1259,6 +1259,8 @@ static inline bool mem_cgroup_under_sock
} while ((memcg = parent_mem_cgroup(memcg)));
return false;
}
+extern void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
+ int nid, int shrinker_id);
#else
#define mem_cgroup_sockets_enabled 0
static inline void mem_cgroup_sk_alloc(struct sock *sk) { };
@@ -1267,6 +1269,10 @@ static inline bool mem_cgroup_under_sock
{
return false;
}
+static inline void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
+ int nid, int shrinker_id)
+{
+}
#endif

struct kmem_cache *memcg_kmem_get_cache(struct kmem_cache *cachep);
_