Skip to contentSkip to conversation

linux-next: manual merge of the bpf-next tree with the mm-unstable tree

DISCUSSION Stephen Rothwell 4 participants 5 messages Jan 5 – Jan 6

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

Hi all,

Today's linux-next merge of the bpf-next tree got a semantic conflict in:

include/linux/memcontrol.h
mm/memcontrol-v1.c
mm/memcontrol.c

between commit:

eb557e10dcac ("memcg: move mem_cgroup_usage memcontrol-v1.c")

from the mm-unstable tree and commit:

99430ab8b804 ("mm: introduce BPF kfuncs to access memcg statistics and events")

from the bpf-next tree producing this build failure:

mm/memcontrol-v1.c:430:22: error: static declaration of 'mem_cgroup_usage' follows non-static declaration
430 | static unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap)

      |                      ^~~~~~~~~~~~~~~~
In file included from mm/memcontrol-v1.c:3:
include/linux/memcontrol.h:953:15: note: previous declaration of 'mem_cgroup_usage' with type 'long unsigned int(struct mem_cgroup *, bool)' {aka 'long unsigned int(struct mem_cgroup *, _Bool)'}
  953 | unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap);
      |               ^~~~~~~~~~~~~~~~

I fixed it up (I reverted the mm-unstable tree commit) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 27 lines · Stephen Rothwell

Hi all,

Today's linux-next merge of the bpf-next tree got a semantic conflict in:

include/linux/memcontrol.h
mm/memcontrol-v1.c
mm/memcontrol.c

between commit:

eb557e10dcac ("memcg: move mem_cgroup_usage memcontrol-v1.c")

from the mm-unstable tree and commit:

99430ab8b804 ("mm: introduce BPF kfuncs to access memcg statistics and events")

from the bpf-next tree producing this build failure:

mm/memcontrol-v1.c:430:22: error: static declaration of 'mem_cgroup_usage' follows non-static declaration
430 | static unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap)

      |                      ^~~~~~~~~~~~~~~~
In file included from mm/memcontrol-v1.c:3:
include/linux/memcontrol.h:953:15: note: previous declaration of 'mem_cgroup_usage' with type 'long unsigned int(struct mem_cgroup *, bool)' {aka 'long unsigned int(struct mem_cgroup *, _Bool)'}
  953 | unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap);
      |               ^~~~~~~~~~~~~~~~
Quoted 6 lines

I fixed it up (I reverted the mm-unstable tree commit) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Hey All,

what's the proper fix here?

Roman,

looks like adding mem_cgroup_usage() to include/linux/memcontrol.h wasn't really necessary, since kfuncs don't use it anyway? Should we just remove that line in bpf-next?

Just:

include/linux/memcontrol.h +0 -1
index 6a5d65487b70..229ac9835adb 100644
@@ -950,7 +950,6 @@ static inline void mod_memcg_page_state(struct page *page,
 }
 
 unsigned long memcg_events(struct mem_cgroup *memcg, int event);
-unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap);
 unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx);
 unsigned long memcg_page_state_output(struct mem_cgroup *memcg, int item);
 bool memcg_stat_item_valid(int idx);

compiles fine.

If you agree pls send an official patch.

#2 lore raw
Quoted 37 lines · Alexei Starovoitov
Quoted 27 lines · Stephen Rothwell

Hi all,

Today's linux-next merge of the bpf-next tree got a semantic conflict in:

include/linux/memcontrol.h
mm/memcontrol-v1.c
mm/memcontrol.c

between commit:

eb557e10dcac ("memcg: move mem_cgroup_usage memcontrol-v1.c")

from the mm-unstable tree and commit:

99430ab8b804 ("mm: introduce BPF kfuncs to access memcg statistics and events")

from the bpf-next tree producing this build failure:

mm/memcontrol-v1.c:430:22: error: static declaration of 'mem_cgroup_usage' follows non-static declaration
430 | static unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap)

      |                      ^~~~~~~~~~~~~~~~
In file included from mm/memcontrol-v1.c:3:
include/linux/memcontrol.h:953:15: note: previous declaration of 'mem_cgroup_usage' with type 'long unsigned int(struct mem_cgroup *, bool)' {aka 'long unsigned int(struct mem_cgroup *, _Bool)'}
  953 | unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap);
      |               ^~~~~~~~~~~~~~~~
Quoted 6 lines

I fixed it up (I reverted the mm-unstable tree commit) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Hey All,

Quoted 8 lines

what's the proper fix here?

Roman,

looks like adding mem_cgroup_usage() to include/linux/memcontrol.h wasn't really necessary, since kfuncs don't use it anyway? Should we just remove that line in bpf-next?

I agree, mem_cgroup_usage() is not declared in next.

I'm wondering why there is a difference between next and bpf-next.

Quoted 18 lines

Just:

include/linux/memcontrol.h +0 -1
index 6a5d65487b70..229ac9835adb 100644
@@ -950,7 +950,6 @@ static inline void mod_memcg_page_state(struct page *page,
 }
 
 unsigned long memcg_events(struct mem_cgroup *memcg, int event);
-unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap);
 unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx);
 unsigned long memcg_page_state_output(struct mem_cgroup *memcg, int item);
 bool memcg_stat_item_valid(int idx);

compiles fine.

If you agree pls send an official patch.

Signature · 2 lines
Best regards,
Ridong
maintainer
#3 lore raw
In reply to Alexei Starovoitov
Quoted 39 lines · Alexei Starovoitov
Quoted 29 lines · Stephen Rothwell

Hi all,

Today's linux-next merge of the bpf-next tree got a semantic conflict in:

include/linux/memcontrol.h
mm/memcontrol-v1.c
mm/memcontrol.c

between commit:

eb557e10dcac ("memcg: move mem_cgroup_usage memcontrol-v1.c")

from the mm-unstable tree and commit:

99430ab8b804 ("mm: introduce BPF kfuncs to access memcg statistics and events")

from the bpf-next tree producing this build failure:

mm/memcontrol-v1.c:430:22: error: static declaration of 'mem_cgroup_usage' follows non-static declaration
430 | static unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap)

      |                      ^~~~~~~~~~~~~~~~

In file included from mm/memcontrol-v1.c:3:
include/linux/memcontrol.h:953:15: note: previous declaration of 'mem_cgroup_usage' with type 'long unsigned int(struct mem_cgroup *, bool)' {aka 'long unsigned int(struct mem_cgroup *, _Bool)'}

  953 | unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap);
      |               ^~~~~~~~~~~~~~~~
Quoted 6 lines

I fixed it up (I reverted the mm-unstable tree commit) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Hey All,

Quoted 7 lines

what's the proper fix here?

Roman,

looks like adding mem_cgroup_usage() to include/linux/memcontrol.h wasn't really necessary, since kfuncs don't use it anyway? Should we just remove that line in bpf-next?

Yep. It was used in the previous version, but not in the latest one.

Just sent an official fix.

Thanks!

#4 lore raw

Hi all,

Quoted 42 lines · On Mon, 05 Jan 2026 20:23:36 -0800 Roman Gushchin <[email protected]>…
Quoted 39 lines · Alexei Starovoitov
Quoted 27 lines · Stephen Rothwell

Today's linux-next merge of the bpf-next tree got a semantic conflict in:

include/linux/memcontrol.h
mm/memcontrol-v1.c
mm/memcontrol.c

between commit:

eb557e10dcac ("memcg: move mem_cgroup_usage memcontrol-v1.c")

from the mm-unstable tree and commit:

99430ab8b804 ("mm: introduce BPF kfuncs to access memcg statistics and events")

from the bpf-next tree producing this build failure:

mm/memcontrol-v1.c:430:22: error: static declaration of 'mem_cgroup_usage' follows non-static declaration
430 | static unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap)

      |                      ^~~~~~~~~~~~~~~~

In file included from mm/memcontrol-v1.c:3:
include/linux/memcontrol.h:953:15: note: previous declaration of 'mem_cgroup_usage' with type 'long unsigned int(struct mem_cgroup *, bool)' {aka 'long unsigned int(struct mem_cgroup *, _Bool)'}

  953 | unsigned long mem_cgroup_usage(struct mem_cgroup *memcg, bool swap);
      |               ^~~~~~~~~~~~~~~~
Quoted 6 lines

I fixed it up (I reverted the mm-unstable tree commit) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

what's the proper fix here?

Roman,

Quoted 7 lines
Quoted 3 lines

looks like adding mem_cgroup_usage() to include/linux/memcontrol.h wasn't really necessary, since kfuncs don't use it anyway? Should we just remove that line in bpf-next?

Yep. It was used in the previous version, but not in the latest one.

Just sent an official fix.

And with that now applied to the bpf-next tree, I will no longer revert the mm-unstable commit.

Thanks.

Signature · 2 lines
Cheers,
Stephen Rothwell