From patchwork Mon Jan 1 08:36:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13508611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53A75C47074 for ; Mon, 1 Jan 2024 08:36:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D6936B0266; Mon, 1 Jan 2024 03:36:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 485FD6B0269; Mon, 1 Jan 2024 03:36:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34D686B026A; Mon, 1 Jan 2024 03:36:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2395D6B0266 for ; Mon, 1 Jan 2024 03:36:23 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D4FF8140372 for ; Mon, 1 Jan 2024 08:36:22 +0000 (UTC) X-FDA: 81630085404.24.B1681E4 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by imf05.hostedemail.com (Postfix) with ESMTP id 2C9E910000C for ; Mon, 1 Jan 2024 08:36:20 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=Ih5HKF13; dmarc=pass (policy=quarantine) header.from=collabora.com; spf=pass (imf05.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704098181; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=67hZCxmCWr64yEhuzarT0pHn0dKsId92sEpePOPIJUE=; b=p6So24oI+ftL56msGxDDOpxhIRS6HXKqO94AjnrW36rHRH0DAK/z4Iap6/OU6JsMLNCvXi /FwVptr7iFJsZNhzIImz0oxDJilFw2fK8mIKLxr5kyIH9I68jieQxz3diJPQi5Byho3t1z TFVRyRwFCBeuueZGczIEc0nogGEqMgc= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=Ih5HKF13; dmarc=pass (policy=quarantine) header.from=collabora.com; spf=pass (imf05.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704098181; a=rsa-sha256; cv=none; b=1T1mscOOsrVczlhVeWh6752McABdoD46iwjQdciD5LPwJ4KI6RwBpMffwLtn4YQ+hX9cuS 9m/DCi+CGq3rmB2d26Lgwt67cBEjceWXPXOSHQAAE6GHWhCdcJhk0zDdlYdgDpQuBZp7x3 zeNdVVQyPKx98r4r2r4F4TkngoaExro= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704098179; bh=+gfEvPhINeOZS8khMkMB/mit5yJKB+pQv1n24ICuSNo=; h=From:To:Cc:Subject:Date:From; b=Ih5HKF13oEvT0bH79pnSPQX3Cu92PdkFswDDQ4n1MV89I9Ddfo7Ek1Y8dYNc9VQyG 7bIk1vYKqGtQVJYhJ6C5cHKTQm6hbVRafuwV+xd5ax10Y0PjhXkgCTvVpKac4FDeEi WTiLgsRIuKyxEJFttoiqTIbfLBwZC0XGUrc88cdv8zO1U4WQUHfbLwmR0Wck+FI6CF rLrc+y1pBwP7s1wKcPpijmFR6yj9bCa2OZHJF94YKA/YK8BHP1jCuQIKRbX3ZHmjQI F54bvDJFwsyRc0GhuDfn+vgosQkZyPHELOtEwekO0JWNzh2Mt4okN3XzP4PbTZ7WgB G/TkxMaaDW4Dg== Received: from localhost.localdomain (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A03FE378000B; Mon, 1 Jan 2024 08:36:17 +0000 (UTC) From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] selftests/mm: conform test to TAP format output Date: Mon, 1 Jan 2024 13:36:12 +0500 Message-ID: <20240101083614.1076768-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: 2C9E910000C X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: weqpd8p14b5xuzsk816uttoqcxutstzn X-HE-Tag: 1704098180-952980 X-HE-Meta: U2FsdGVkX1/aw71fLheQv+fQijeNffKNAMYgoo3R0TOeI8iXrrDJildEFyr9+CyCvsFeqWV8Fp/ToRK4YnpSxIO97ABFago6ddEX1sBDtDFTl1h6xv+9cWQ0dmCMheLEpYGmaH+wR8CDVI4hDZd2xXE8vByq/iFdgCvvIlompa6w5DtP+RncNjzjVasI5wfFnnwOV95UjzIA6mcN3Om57bAVE7+PBXa5/CRcH2abIFa4JpyA1bPl2pnd9GiZNBJMicHV/mttEwicbwlzR3GXujP8OFLMeEPohk3tVTVzRLybh1PPpfFPnZ9NmrLRGEOp8BFgnEjeJ+fU3qm4T+1HU4jWav+TkFIJoAvWSQRhb81TZrNDXR+s8HnIOlJkhBDKPOMvYPAVMMH1L1LQSFaxlJFIaY1O8xe4vMyFO5vtV22jr5KPY+mcJ94iSdX9ioLMFMajJdkgUiTcZnW7UtcGl8MbcHuIIL1u3ram6hOAE8d6FZdLPEPXjL3y0BqtcdT8rTFQgk5F35MQB4ZUPZpHQMnMK6sM+9BF/AyuiBRwb6WJNEXeDhZnVvO4I6LvAiVYAGEp/Ya6JI9Zcfc30iTBl9l5jQ3oRv42kA3OEXa5iNNfB8GWyuiw23i4IrFm4B6+RvqLN5lVbnMrVTjxKOABqzKA7hHhotQV8JVpE3gJE9Iyaaf6ZQdVU1ficmvEKXxeDllEaP5a/yAc/XL3xoZnl7WD+17rbOk5zyc4lb9w4fgpE6qwe+kSZw78NZzNMZTBCsBmj5FI6C11v48BYSZsifeCCNR3Ckx6dpokjPv6SfZnEVAQS5sEF1VOaxTXOwxPluYPH46h0jA1w5szzfPEn4WZCNiFG2ym9ST+r4v+qRxNjGV2rZtrbhQvd/8PmDZoasdSV9WOBAeMHxq+48Q+/0ZZndbrXYj56q7J2N8k9uZImuQKn0PVDctuOoJ262LB5PS4osGIAhS2QJEHfSS feBRmMYY j5Ae3jx8J1FAhJ/lPCvtwIFxJ4f9dzz2QJTQZ53bc4xuB4DGVxrWfWJO6SyDzzRI/72pprtjiJlkossut2Yz5kRpb3kl+b2cnEa0r1FsLS4E6GFlgwjKdo/jEWQsoRwGznQ2COtoHOEW3qwkISUg3Ima6rq5TQdtm7cxlNlD3RfjXJ2Rrr2c6M9ZQrtmA0JGbsuyeor3KZ1z8Zg19DQP3SeDsr+PE4W0bet/2gHw2VtjbkS7p5DsCNEEH7w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/compaction_test.c | 91 ++++++++++---------- 1 file changed, 44 insertions(+), 47 deletions(-) diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c index 9b420140ba2b..707b0809b717 100644 --- a/tools/testing/selftests/mm/compaction_test.c +++ b/tools/testing/selftests/mm/compaction_test.c @@ -33,7 +33,7 @@ int read_memory_info(unsigned long *memfree, unsigned long *hugepagesize) FILE *cmdfile = popen(cmd, "r"); if (!(fgets(buffer, sizeof(buffer), cmdfile))) { - perror("Failed to read meminfo\n"); + ksft_print_msg("Failed to read meminfo: %s\n", strerror(errno)); return -1; } @@ -44,7 +44,7 @@ int read_memory_info(unsigned long *memfree, unsigned long *hugepagesize) cmdfile = popen(cmd, "r"); if (!(fgets(buffer, sizeof(buffer), cmdfile))) { - perror("Failed to read meminfo\n"); + ksft_print_msg("Failed to read meminfo: %s\n", strerror(errno)); return -1; } @@ -62,14 +62,14 @@ int prereq(void) fd = open("/proc/sys/vm/compact_unevictable_allowed", O_RDONLY | O_NONBLOCK); if (fd < 0) { - perror("Failed to open\n" - "/proc/sys/vm/compact_unevictable_allowed\n"); + ksft_print_msg("Failed to open /proc/sys/vm/compact_unevictable_allowed: %s\n", + strerror(errno)); return -1; } if (read(fd, &allowed, sizeof(char)) != sizeof(char)) { - perror("Failed to read from\n" - "/proc/sys/vm/compact_unevictable_allowed\n"); + ksft_print_msg("Failed to read from /proc/sys/vm/compact_unevictable_allowed: %s\n", + strerror(errno)); close(fd); return -1; } @@ -78,12 +78,13 @@ int prereq(void) if (allowed == '1') return 0; + ksft_print_msg("Compaction isn't allowed\n"); return -1; } int check_compaction(unsigned long mem_free, unsigned int hugepage_size) { - int fd; + int fd, ret = -1; int compaction_index = 0; char initial_nr_hugepages[10] = {0}; char nr_hugepages[10] = {0}; @@ -94,18 +95,21 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size) fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK); if (fd < 0) { - perror("Failed to open /proc/sys/vm/nr_hugepages"); + ksft_test_result_fail("Failed to open /proc/sys/vm/nr_hugepages: %s\n", + strerror(errno)); return -1; } if (read(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) <= 0) { - perror("Failed to read from /proc/sys/vm/nr_hugepages"); + ksft_test_result_fail("Failed to read from /proc/sys/vm/nr_hugepages: %s\n", + strerror(errno)); goto close_fd; } /* Start with the initial condition of 0 huge pages*/ if (write(fd, "0", sizeof(char)) != sizeof(char)) { - perror("Failed to write 0 to /proc/sys/vm/nr_hugepages\n"); + ksft_test_result_fail("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n", + strerror(errno)); goto close_fd; } @@ -114,14 +118,16 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size) /* Request a large number of huge pages. The Kernel will allocate as much as it can */ if (write(fd, "100000", (6*sizeof(char))) != (6*sizeof(char))) { - perror("Failed to write 100000 to /proc/sys/vm/nr_hugepages\n"); + ksft_test_result_fail("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n", + strerror(errno)); goto close_fd; } lseek(fd, 0, SEEK_SET); if (read(fd, nr_hugepages, sizeof(nr_hugepages)) <= 0) { - perror("Failed to re-read from /proc/sys/vm/nr_hugepages\n"); + ksft_test_result_fail("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n", + strerror(errno)); goto close_fd; } @@ -129,67 +135,58 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size) huge pages */ compaction_index = mem_free/(atoi(nr_hugepages) * hugepage_size); - if (compaction_index > 3) { - printf("No of huge pages allocated = %d\n", - (atoi(nr_hugepages))); - fprintf(stderr, "ERROR: Less that 1/%d of memory is available\n" - "as huge pages\n", compaction_index); - goto close_fd; - } - - printf("No of huge pages allocated = %d\n", - (atoi(nr_hugepages))); - lseek(fd, 0, SEEK_SET); if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages)) != strlen(initial_nr_hugepages)) { - perror("Failed to write value to /proc/sys/vm/nr_hugepages\n"); + ksft_test_result_fail("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n", + strerror(errno)); goto close_fd; } - close(fd); - return 0; + if (compaction_index > 3) { + ksft_print_msg("ERROR: Less that 1/%d of memory is available\n" + "as huge pages\n", compaction_index); + ksft_test_result_fail("No of huge pages allocated = %d\n", (atoi(nr_hugepages))); + goto close_fd; + } + + ksft_test_result_pass("Memory compaction succeeded. No of huge pages allocated = %d\n", + (atoi(nr_hugepages))); + ret = 0; close_fd: close(fd); - printf("Not OK. Compaction test failed."); - return -1; + return ret; } int main(int argc, char **argv) { struct rlimit lim; - struct map_list *list, *entry; + struct map_list *list = NULL, *entry; size_t page_size, i; void *map = NULL; unsigned long mem_free = 0; unsigned long hugepage_size = 0; long mem_fragmentable_MB = 0; - if (prereq() != 0) { - printf("Either the sysctl compact_unevictable_allowed is not\n" - "set to 1 or couldn't read the proc file.\n" - "Skipping the test\n"); - return KSFT_SKIP; - } + ksft_print_header(); + + if (prereq() != 0) + return ksft_exit_pass(); + + ksft_set_plan(1); lim.rlim_cur = RLIM_INFINITY; lim.rlim_max = RLIM_INFINITY; - if (setrlimit(RLIMIT_MEMLOCK, &lim)) { - perror("Failed to set rlimit:\n"); - return -1; - } + if (setrlimit(RLIMIT_MEMLOCK, &lim)) + ksft_exit_fail_msg("Failed to set rlimit: %s\n", strerror(errno)); page_size = getpagesize(); - list = NULL; - - if (read_memory_info(&mem_free, &hugepage_size) != 0) { - printf("ERROR: Cannot read meminfo\n"); - return -1; - } + if (read_memory_info(&mem_free, &hugepage_size) != 0) + ksft_exit_fail_msg("Failed to get meminfo\n"); mem_fragmentable_MB = mem_free * 0.8 / 1024; @@ -225,7 +222,7 @@ int main(int argc, char **argv) } if (check_compaction(mem_free, hugepage_size) == 0) - return 0; + return ksft_exit_pass(); - return -1; + return ksft_exit_fail(); } From patchwork Mon Jan 1 08:36:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13508612 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CE3EC4706F for ; Mon, 1 Jan 2024 08:36:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 524236B0195; Mon, 1 Jan 2024 03:36:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D4D96B0196; Mon, 1 Jan 2024 03:36:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C3326B0197; Mon, 1 Jan 2024 03:36:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2D66E6B0195 for ; Mon, 1 Jan 2024 03:36:26 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D469B405C0 for ; Mon, 1 Jan 2024 08:36:25 +0000 (UTC) X-FDA: 81630085530.10.CAC0CCA Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by imf13.hostedemail.com (Postfix) with ESMTP id 38B512001D for ; Mon, 1 Jan 2024 08:36:23 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b="mJ5H00/h"; spf=pass (imf13.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704098184; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fXgVIMW3zsuKjeqFUyQYUY8CiLbJ9ZJoTUgFE6XA/tI=; b=iJ5kULMj9Sgzo8/ygDGbTPNT+ZgczjyrDCwwMOdrlF3yxA5lplIp6bKyvc1ca01yXt8Jbg WOLxN+JIY2dPctcpE2lughr/ghuig0GC98dJ41PNwz5C5zYJfHFdo0Ss/5flF/LYYrt8iq hSUTUZn9rfKhFniRy3WJkxbvIFtRhig= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b="mJ5H00/h"; spf=pass (imf13.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704098184; a=rsa-sha256; cv=none; b=nbm1h5NPHmXICQTdiKmy6pim1hbn4xdXcxrk725cDK3Z2SzW6Sa3bjYNGfkgowvB8UH2Bz 9r5oRIMtoobZRSpi60ENF+ZixKJDoQspuckEwhTmnknuTMulun71D0POvPSkYx2SgU9yrC FrSkcpCvNwOs1o3GaYUqjhH18xFiZx0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704098183; bh=giHGWwDeltvyjzRJyE60kEU8wo+8AOWtU2n4rpsZokA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mJ5H00/hzYa7ecJ8yDwgc+W5yoNyAGqahFf2l+LnINskO8F7x2swpkhkcqzQeuomo wy5BCXS+iB16I2qtXXD0d5R36w5bYjTWwtXhjZse9YYzyOedJ/mJrIRiyAejGk4hPX QQVNXSuyTOGs9fvp8JPi5WWbT8hOO0c9YiuGy3Un1Eff82GApXYA6XuNPHO/VxYgUk HMBxwUdf32sqyIt/1lhe407G2ciTAmHBgWtTseS4kornAhmbqSRGBkGrVGWN+0xkfD ePybNEAuihCMN8hf9k4dw04GkfAl71aelQ5iEUnuh9phQQNB0v3Nqe8tifym2B3QAE zcT/Uq4MH85Nw== Received: from localhost.localdomain (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6592B3780894; Mon, 1 Jan 2024 08:36:20 +0000 (UTC) From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] selftests/mm: skip test if application doesn't has root privileges Date: Mon, 1 Jan 2024 13:36:13 +0500 Message-ID: <20240101083614.1076768-2-usama.anjum@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240101083614.1076768-1-usama.anjum@collabora.com> References: <20240101083614.1076768-1-usama.anjum@collabora.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 38B512001D X-Rspam-User: X-Stat-Signature: jjtryh7kww9d48b1sudy5o8ysiq7y5cg X-Rspamd-Server: rspam01 X-HE-Tag: 1704098183-957591 X-HE-Meta: U2FsdGVkX18CRKvbp4fX3KuC5DX/RLOzNp9Zkxm8HQvqfE8UsjApnHpXOwD7eZIg6FjKrFpsBKX2HnTe/wbIY84EGBBFW1rex99whznpjjIVob0R7WxyobtuNBqBuq92dFBt1mhsuiLk/fE0BpHJvCiGVogUGK4c0yPU8CMooSwESUuFqmYR5kVdp7QNBFjFpqUZhOp68CQ4JTmN2jwGrCn7gqJ13BqnhGIEvW3AmIZK+Mj7PzY+B7vA3W6nUQaL6Xa6YBeTHP278S6Z+M0r8s+g3tQuEHau3r7la+IqenQi4frYHVeHO7xKg6AjSgbDZQWf2wUPqwol/2DWGkmr+b5T4sQ/nc953IDotpE79GB/zLG6HvrKZK5kIWydNYm/H6I+zs3/5oIeTMkz2tA2armknDz6r6+Od7jbAg/r8aWQ5D88DWGkT1WGgew5PIZMhN1ebXXLWKUor0NrlxQPX7SstQr0bmJUBjHAtMuldfSsh+f13OwE+Ay2ncomYgsI2XYGYk+n6GvJ4+4gD71oHqHECqgQb2sajer9dnD8nurkoBrT273E4vyMczEmQzzUQQ7ObQE9oy7R0Q8OvAOywVLTwMkxw/mUoc7UaX77Ge+0F6GgmHSwGWUEfGhp3KvRzOhkEHoOwtilHW9qi3d1EvTUXejg07h6txjbp9yaMbK4CJX71FuVrj3t/tMIF3scIRHZ1IqSxIoFi0L+QRS0qeUMV7rzhBhUwyFVS5WJaX/S6ag4UQZvKwFab/WpFifp4aUH2scSlmCpb5Q3fDfC5LAv1b02jG/b/Qqod2c8JY8vFntB/AlPMWQHy6VyQC2ZXyVVyoN81BGPTbAt923QDypCFvCRMyZEnsQvQC5DNCZDwic7q4YpkvUEToGSedY6+p+F40zvGEus395AE6i/D34ST3rdIqJ7yQAzYPJpt5yaSv8m5SK0pLJXipZQ7FnRG4mjL0QvY9ZTF87wJ2O 6oS/Zd9H ZPVWVefFysiHLwbQIZ/OfGmU2FIwwUWXhJUwZ6dw8DGCI+wKALOMeVr7iWACgu/5/3XQR6MwBKZt1NLPKVHXMEbbEOxc7ezCFLyjbVX6UA8EGQfjbePs9lU2Us7X4AgYzGVBGIBLxi1J5cHjo8pqAMF+kQbBfC9z4ek2PDjKdMDoFebu2vw9HtQG/Y1G2nL38CCkLFUWdpclTQ9ufbnmrkfu+jJarEGlOcEsIYh60WAZBDme1oKG5nu1+Aw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000045, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The test depends on writing to nr_hugepages which isn't possible without root privileges. So skip the test in this case. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/compaction_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c index 707b0809b717..656afba02dbc 100644 --- a/tools/testing/selftests/mm/compaction_test.c +++ b/tools/testing/selftests/mm/compaction_test.c @@ -173,7 +173,7 @@ int main(int argc, char **argv) ksft_print_header(); - if (prereq() != 0) + if (prereq() || geteuid()) return ksft_exit_pass(); ksft_set_plan(1);