Commit 8fdc9eaf authored by Harshit Mogalapalli's avatar Harshit Mogalapalli Committed by sanglipeng1
Browse files

Revert "selftests: mm: fix map_hugetlb failure on 64K page size systems"

stable inclusion
from stable-v5.10.218
commit 719225b0f93289360b02eacbdec6deb852e1d6b8
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAX0QZ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=719225b0f93289360b02eacbdec6deb852e1d6b8



--------------------------------

This reverts commit c9c3cc6a13bddc76bb533ad8147a5528cac5ba5a which is
commit 91b80cc5b39f00399e8e2d17527cad2c7fa535e2 upstream.

map_hugetlb.c:18:10: fatal error: vm_util.h: No such file or directory
   18 | #include "vm_util.h"
      |          ^~~~~~~~~~~
compilation terminated.

vm_util.h is not present in 5.10.y, as commit:642bc52a ("selftests:
vm: bring common functions to a new file") is not present in stable
kernels <=6.1.y

Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: default avatarsanglipeng1 <sanglipeng1@jd.com>
parent d8ed0fc3
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#include "vm_util.h"

#define LENGTH (256UL*1024*1024)
#define PROTECTION (PROT_READ | PROT_WRITE)
@@ -71,16 +70,10 @@ int main(int argc, char **argv)
{
	void *addr;
	int ret;
	size_t hugepage_size;
	size_t length = LENGTH;
	int flags = FLAGS;
	int shift = 0;

	hugepage_size = default_huge_page_size();
	/* munmap with fail if the length is not page aligned */
	if (hugepage_size > length)
		length = hugepage_size;

	if (argc > 1)
		length = atol(argv[1]) << 20;
	if (argc > 2) {