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

From: Mark Brown <[email-masked]>
Date: Mon, 18 May 2026 17:10:45 +0100

Hi all,

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

  tools/testing/selftests/cgroup/test_memcontrol.c

between commit:

  186fdfd222a15 ("selftests/cgroup: rename PAGE_SIZE to BUF_SIZE in cgroup_util")

from the mm-unstable tree and commit:

  2a7d34eba5f5a ("selftests/cgroup: check malloc return value in alloc_anon functions")

from the cgroup tree.

I fixed it up (see below) 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.

diff --cc tools/testing/selftests/cgroup/test_memcontrol.c
index 44338dbaee819,21aedb35cc122..0000000000000
--- a/tools/testing/selftests/cgroup/test_memcontrol.c
+++ b/tools/testing/selftests/cgroup/test_memcontrol.c
@@@ -61,10 -60,26 +61,26 @@@ static char *alloc_and_populate_anon(si
  	char *buf, *ptr;
  
  	buf = malloc(size);
+ 	if (buf == NULL) {
+ 		fprintf(stderr, "malloc() failed\n");
+ 		return NULL;
+ 	}
+ 
 -	for (ptr = buf; ptr < buf + size; ptr += PAGE_SIZE)
 +	for (ptr = buf; ptr < buf + size; ptr += page_size)
  		*ptr = 0;
  
+ 	return buf;
+ }
+ 
+ int alloc_anon(const char *cgroup, void *arg)
+ {
+ 	size_t size = (unsigned long)arg;
+ 	char *buf;
+ 
+ 	buf = alloc_and_populate_anon(size);
+ 	if (!buf)
+ 		return -1;
+ 
  	free(buf);
  	return 0;
  }