403Webshell
Server IP : 13.213.54.232  /  Your IP : 216.73.217.11
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ip-172-31-17-110 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 7.1.33-67+ubuntu22.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/modules/6.8.0-1029-aws/build/tools/testing/selftests/memfd/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/modules/6.8.0-1029-aws/build/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
#!/bin/bash
# please run as root

# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4

#
# To test memfd_create with hugetlbfs, there needs to be hpages_test
# huge pages free.  Attempt to allocate enough pages to test.
#
hpages_test=8

#
# Get count of free huge pages from /proc/meminfo
#
while read name size unit; do
        if [ "$name" = "HugePages_Free:" ]; then
                freepgs=$size
        fi
done < /proc/meminfo

#
# If not enough free huge pages for test, attempt to increase
#
if [ -n "$freepgs" ] && [ $freepgs -lt $hpages_test ]; then
	nr_hugepgs=`cat /proc/sys/vm/nr_hugepages`
	hpages_needed=`expr $hpages_test - $freepgs`

	if [ $UID != 0 ]; then
		echo "Please run memfd with hugetlbfs test as root"
		exit $ksft_skip
	fi

	echo 3 > /proc/sys/vm/drop_caches
	echo $(( $hpages_needed + $nr_hugepgs )) > /proc/sys/vm/nr_hugepages
	while read name size unit; do
		if [ "$name" = "HugePages_Free:" ]; then
			freepgs=$size
		fi
	done < /proc/meminfo
fi

#
# If still not enough huge pages available, exit.  But, give back any huge
# pages potentially allocated above.
#
if [ $freepgs -lt $hpages_test ]; then
	# nr_hugepgs non-zero only if we attempted to increase
	if [ -n "$nr_hugepgs" ]; then
		echo $nr_hugepgs > /proc/sys/vm/nr_hugepages
	fi
	printf "Not enough huge pages available (%d < %d)\n" \
		$freepgs $needpgs
	exit $ksft_skip
fi

#
# Run the hugetlbfs test
#
./memfd_test hugetlbfs
./run_fuse_test.sh hugetlbfs

#
# Give back any huge pages allocated for the test
#
if [ -n "$nr_hugepgs" ]; then
	echo $nr_hugepgs > /proc/sys/vm/nr_hugepages
fi

Youez - 2016 - github.com/yon3zu
LinuXploit