From patchwork Fri May 31 21:34:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13682200 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 A4027C25B75 for ; Fri, 31 May 2024 21:34:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2FD7F6B00A5; Fri, 31 May 2024 17:34:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 286386B00A9; Fri, 31 May 2024 17:34:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D99E6B00AB; Fri, 31 May 2024 17:34:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DCACD6B00A5 for ; Fri, 31 May 2024 17:34:51 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 982C9160BC8 for ; Fri, 31 May 2024 21:34:51 +0000 (UTC) X-FDA: 82179995982.27.B443114 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf13.hostedemail.com (Postfix) with ESMTP id D271420007 for ; Fri, 31 May 2024 21:34:49 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=hX2G165z; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf13.hostedemail.com: domain of 3eEJaZggKCJ8IH9PHX9MFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--jiaqiyan.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3eEJaZggKCJ8IH9PHX9MFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--jiaqiyan.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717191289; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PSzGyHzMerzTaST3R5/MMuosQBVUwsZqbBH4EMH0Fg0=; b=II9CaOD3MKN9kGHba1wwUz6Y1aIZLdXH7mBldRDPi7p6OxS4VImw4sIQN0bgYQUb71xYkf NO6Z8XZ1j6aJNqkd7hpyOOPB/olI2kwHbVCguaGdNYFsSCJe/v2DbOZJGPFBXFzffXsSQP U+x/yItDqrak5xrAcPmI39hk+LH1Q6E= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=hX2G165z; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf13.hostedemail.com: domain of 3eEJaZggKCJ8IH9PHX9MFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--jiaqiyan.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3eEJaZggKCJ8IH9PHX9MFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--jiaqiyan.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717191289; a=rsa-sha256; cv=none; b=2BKYFq9rPZQdE3vcJflMvompT5Ld/K0cl26CjghLJ9RJoXPojbqQeTdGMuKLYYZfD5GkXs SjkGPOGP9E1zBXHe0IY0rYc2TnL06TWs6rBDb3Sqqr+8lSsMo5QxbgP+3AKREA3gmimJh8 o7ssKeYlv6orJ+cA8KfrYG8CoG/ChKw= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-627eb3fb46cso42602877b3.2 for ; Fri, 31 May 2024 14:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717191289; x=1717796089; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=PSzGyHzMerzTaST3R5/MMuosQBVUwsZqbBH4EMH0Fg0=; b=hX2G165zt+fZVfFq3kPbh7gg/Z9uTySM0xJV3LzPpv1ld9fdMz04ag7G1EbthyNEci 3QsOxKS6pAQOVbsapAf/EHFTNA3CVd7MDlrZvUzMgPgSGtLfnWHvoiQCMr0sFk10N43W s0cCBYjLpmbZVeV0JW0GAjTXEi4yls+OEDWsbAwIY6tyQ9P4phS3UQHjlJcYRALtH16+ 6GJjzZ+J4VCqsRzeJ6fwf7zHpvrEMuz0gCHUUlXTB8fkRPNMYN383SHgaZxwhs77+q0O k3OM4CVZd+CjTNPVwXBT/dGDIG27wBV3ClQZXchiLGr43qoaFaUWAf998GcakhG0yddk r/WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717191289; x=1717796089; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PSzGyHzMerzTaST3R5/MMuosQBVUwsZqbBH4EMH0Fg0=; b=Eq7Y5YQ8BM9IjnEajYLtRHHag4U27rLMcSi+6lggW0WvtfB6Z6+1Popt5/W55dwprd avMh7JJgTjZJAFL0cMezSQ95PZA7rHESBWpV2rZ3N36D37eq7G7ckzFRZ56vtZ5i+bRW CyxKVvH8/vcm8bHPSdc7D/7D1K+5cLs5l7y0ZLQyxil00tunwvqAv9HlLESDzJh1kt2f vuGHF3Ge37NCVrZPlIfI5g6d5S18taOx/YBam1unYhdII+RkjH9MkbQfjV8h9fq/sMTm U2H6FmJRxzq6Sv3vUE9ZprtKI3etwf5fzv3uz52OpRcyXWQWZTIoTD1AjJZWcTp/Bp2e kl0w== X-Forwarded-Encrypted: i=1; AJvYcCVxeQw6VBIQhJJ2y/cocSL9+CXZSEXMfcyN0TQBoUknF7g3pCCupV3MwHIVylDtgPUhsqUcRmJ8i0EizRlEMA0vtKQ= X-Gm-Message-State: AOJu0YxcIP0JGeF0CG1g6QsbbNmBMogK6mmiuZWO5qvEAq7QqhxMmZfS Do6l2Zv3/GJL5KHaaERmPTJFD6tPt0FxYHndutqeMLhyKU+4+DowAEeo6iWHZxCj8qr/Z/sII94 c+4pmTOGETQ== X-Google-Smtp-Source: AGHT+IEQi1nZ7QRqcXRTdtpnROLucQXBPkROpipk0R8nebc5FNrDvH4o9mUOqbtoIoIFxgTSbLnzJMZjzIErxw== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a05:6902:1003:b0:df7:62ec:c517 with SMTP id 3f1490d57ef6-dfa73dba365mr150746276.11.1717191288972; Fri, 31 May 2024 14:34:48 -0700 (PDT) Date: Fri, 31 May 2024 21:34:38 +0000 In-Reply-To: <20240531213439.2958891-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240531213439.2958891-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.1.288.g0e0cd299f1-goog Message-ID: <20240531213439.2958891-3-jiaqiyan@google.com> Subject: [PATCH v1 2/3] selftest/mm: test softoffline_corrected_errors behaviors From: Jiaqi Yan To: naoya.horiguchi@nec.com, muchun.song@linux.dev, linmiaohe@huawei.com Cc: akpm@linux-foundation.org, mike.kravetz@oracle.com, shuah@kernel.org, corbet@lwn.net, osalvador@suse.de, rientjes@google.com, duenwen@google.com, fvdl@google.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, Jiaqi Yan X-Rspamd-Queue-Id: D271420007 X-Stat-Signature: bt15i8c81j7z87em83chrxwy67wfgphg X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1717191289-582537 X-HE-Meta: U2FsdGVkX18qooWvGQdgFzgfE2r5I6BEWNCWzz+MCtSlAaks50NXHpgroHn2uqw7OXW8jL7k11wQHP8NEGrMGmCh8GB4yzsV2GdgxKUrLVRmqaLz/zMFB1LN15XJ0S19gD28CAK7hWa2taWuSDmHJ7+cFeO38BhwnU17joI+Zo553IbKSAiq2HdugcMY/hzS85k4x7iRqtEu5wtl4esVkmX9g56j86BbhoFnMIKMhFaCKBGRKONK5YZP2U7PLNefXvtJ5fBdnBCDI8mHGXzHeP6sm2oM2MeuBqG6ZalraJa4qWroV+W1vsrJ0YsAaKrKz/IvCAU1Q5wdLobWYZCgcweWhxkqZAojlxXsOEOYrMXaCKjxI2LQ31z5SbjEswMLeukmQS96JfnnDhNzaTHirEc5ajqCvi4sAsvteIVilUPuAhTa3k5zYgkKHEfq54q86elH3w9lPzmMNEOl+pO67ahHGX6Z6fae+KiKELRp2lQ//u3khram4CBIaBDMzgOf/PpLKDgA8XvPvxq0uU2pBhuEoMELpmtAI3FuYxw+KrYYrnosFB2JVyRhyZa+qwqTcux5H8ders84bhLlP9lGZSd+/jANOLhGImcbf8O/A1f4KiJOk0wWLv9iJmvYxkrDJ8bth2lNAWUFbChUXIdHnr75dPM79qN1QAYM+5mh1KOfG86QDrZVgZY+f2wBEA2X6+ps3D4k6I9gLyFX3eS5xhBVryMFq5RANVajW1J/2bmIy1WvLqvpASnC+M3uD3OmNhhsaNJz/dj9ioggQGi+EmRzsHB6CLkvoyoE72C4b/tbZDCDAsd+Q9hfydLjsc6F3KzXVkPSCGwBCM4lM4eCxIkIsNYh839riHeRD5mt9QWqwza6TFji4YLuab5Qxk2ZEoPwL+Nbuyrx8FZkpUWY96+nobBwvywCw8162XxEzsmgDZzMpOxBT8crEKa3eOrAe3W1RATH5qhT3yKySFG NS5fwOdT a8soPAYw+SjMbFVHNGbfHkL/QbJX29LNmPPqD2kE5HZWzdb/2JqhanKIMTTwK4B0nq8uRk/tuzpu8o7q9MIInyt3SlekQoRXHlDhV2oGRa9OYdl5Oa+K8carIVKXclpEwOoIXcbJAo3C/pHb8j7akzerBhsWEqY541+h9w78fKfqHb/EbInRExUj+u7RJBWrSYcoURmKkhUbNzLAe6NKl5XV4W5fiZ4XUWT0/9R4Zd9GwSwlGObMZQqaoSGoT/oDxWGXTslr7ccYaHPyyO5BYyPQHJmnsQiH6plS8tH4EA2+9WRCCNXgYgSNsoV0Pk4PZKsv9vuU8ZGGlmMU+ZSlxZiHpCDcfi04VETCB4X+fNc33TDH0QSmbo0g5CNcLrTDEilmBzqvdgAwAIwOMvKbKBaFBAJPBbT0ZILd6tyhQoaNqcI2oNzlduB5HEOA2dLVTkqPW0iRItlxJrgD06vm9DNqOJCBhy6Bvx/2x0KM+cxQYz6bOm1i1LEzNRTQNC2cdVFmgeNAZFDey1z7Fq8JqobgrdNsUNm5Eo3AlrAaYDwHY+vXUVTJGIEkpJvcF+4gDl75FQWWT53sErtTG4an7hbHchDw9JqZa1dlvbJQZ2R0Mf5NWwe2uwv4kxSU2/Dcd8if8IvXP+8VOXZyOvG7y2DJcDiMgBsjJX3K5K9E2drCbtd0= 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: Add regression and new tests when hugepage has correctable memory errors, and how userspace wants to deal with it: * if softoffline_corrected_errors=0, mapped hugepage is soft offlined * if softoffline_corrected_errors=1, mapped hugepage is intact Free hugepages case is not explicitly covered by the tests. Hugepage having corrected memory errors is emulated with MADV_SOFT_OFFLINE. Signed-off-by: Jiaqi Yan --- tools/testing/selftests/mm/.gitignore | 1 + tools/testing/selftests/mm/Makefile | 1 + .../selftests/mm/hugetlb-soft-offline.c | 262 ++++++++++++++++++ tools/testing/selftests/mm/run_vmtests.sh | 4 + 4 files changed, 268 insertions(+) create mode 100644 tools/testing/selftests/mm/hugetlb-soft-offline.c diff --git a/tools/testing/selftests/mm/.gitignore b/tools/testing/selftests/mm/.gitignore index 0b9ab987601c..064e7b125643 100644 --- a/tools/testing/selftests/mm/.gitignore +++ b/tools/testing/selftests/mm/.gitignore @@ -6,6 +6,7 @@ hugepage-shm hugepage-vmemmap hugetlb-madvise hugetlb-read-hwpoison +hugetlb-soft-offline khugepaged map_hugetlb map_populate diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 3b49bc3d0a3b..d166067d75ef 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -42,6 +42,7 @@ TEST_GEN_FILES += gup_test TEST_GEN_FILES += hmm-tests TEST_GEN_FILES += hugetlb-madvise TEST_GEN_FILES += hugetlb-read-hwpoison +TEST_GEN_FILES += hugetlb-soft-offline TEST_GEN_FILES += hugepage-mmap TEST_GEN_FILES += hugepage-mremap TEST_GEN_FILES += hugepage-shm diff --git a/tools/testing/selftests/mm/hugetlb-soft-offline.c b/tools/testing/selftests/mm/hugetlb-soft-offline.c new file mode 100644 index 000000000000..8d1d7d4a84d8 --- /dev/null +++ b/tools/testing/selftests/mm/hugetlb-soft-offline.c @@ -0,0 +1,262 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Test soft offline behavior for HugeTLB pages: + * - if softoffline_corrected_errors = 0, hugepages should stay intact and soft + * offlining failed with EINVAL. + * - if softoffline_corrected_errors > 0, a hugepage should be dissolved and + * nr_hugepages should be reduced by 1. + * + * Before running, make sure more than 2 hugepages of default_hugepagesz + * are allocated. For example, if /proc/meminfo/Hugepagesize is 2048kB: + * echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#ifndef MADV_SOFT_OFFLINE +#define MADV_SOFT_OFFLINE 101 +#endif + +#define PREFIX " ... " +#define EPREFIX " !!! " + +enum test_status { + TEST_PASS = 0, + TEST_FAILED = 1, + // From ${ksft_skip} in run_vmtests.sh. + TEST_SKIPPED = 4, +}; + +static enum test_status do_soft_offline(int fd, size_t len, int expect_ret) +{ + char *filemap = NULL; + char *hwp_addr = NULL; + const unsigned long pagesize = getpagesize(); + int ret = 0; + enum test_status status = TEST_SKIPPED; + + if (ftruncate(fd, len) < 0) { + perror(EPREFIX "ftruncate to len failed"); + return status; + } + + filemap = mmap(NULL, len, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_POPULATE, fd, 0); + if (filemap == MAP_FAILED) { + perror(EPREFIX "mmap failed"); + goto untruncate; + } + + memset(filemap, 0xab, len); + printf(PREFIX "Allocated %#lx bytes of hugetlb pages\n", len); + + hwp_addr = filemap + len / 2; + ret = madvise(hwp_addr, pagesize, MADV_SOFT_OFFLINE); + printf(PREFIX "MADV_SOFT_OFFLINE %p ret=%d, errno=%d\n", + hwp_addr, ret, errno); + if (ret != 0) + perror(EPREFIX "madvise failed"); + + if (errno == expect_ret) + status = TEST_PASS; + else { + printf(EPREFIX "MADV_SOFT_OFFLINE should ret %d\n", expect_ret); + status = TEST_FAILED; + } + + munmap(filemap, len); +untruncate: + if (ftruncate(fd, 0) < 0) + perror(EPREFIX "ftruncate back to 0 failed"); + + return status; +} + +static int set_softoffline_corrected_errors(unsigned long hugepage_size, int value) +{ + char cmd[256] = {0}; + FILE *cmdfile = NULL; + + if (value != 0 && value != 1) + return -EINVAL; + + sprintf(cmd, + "echo %d > /sys/kernel/mm/hugepages/hugepages-%ldkB/softoffline_corrected_errors", + value, hugepage_size); + cmdfile = popen(cmd, "r"); + + if (cmdfile == NULL) + perror(EPREFIX "failed to set softoffline_corrected_errors"); + else + printf(PREFIX + "softoffline_corrected_errors=%d for %ldkB hugepages\n", + value, hugepage_size); + + pclose(cmdfile); + return 0; +} + +static int read_nr_hugepages(unsigned long hugepage_size, + unsigned long *nr_hugepages) +{ + char buffer[256] = {0}; + char cmd[256] = {0}; + + sprintf(cmd, "cat /sys/kernel/mm/hugepages/hugepages-%ldkB/nr_hugepages", + hugepage_size); + FILE *cmdfile = popen(cmd, "r"); + + if (!fgets(buffer, sizeof(buffer), cmdfile)) { + perror(EPREFIX "failed to read nr_hugepages"); + pclose(cmdfile); + return -1; + } + + *nr_hugepages = atoll(buffer); + pclose(cmdfile); + return 0; +} + +static int create_hugetlbfs_file(struct statfs *file_stat) +{ + int fd; + + fd = memfd_create("hugetlb_tmp", MFD_HUGETLB); + if (fd < 0) { + perror(EPREFIX "could not open hugetlbfs file"); + return -1; + } + + memset(file_stat, 0, sizeof(*file_stat)); + if (fstatfs(fd, file_stat)) { + perror(EPREFIX "fstatfs failed"); + goto close; + } + if (file_stat->f_type != HUGETLBFS_MAGIC) { + printf(EPREFIX "not hugetlbfs file\n"); + goto close; + } + + return fd; +close: + close(fd); + return -1; +} + +static enum test_status test_soft_offline(void) +{ + int fd; + struct statfs file_stat; + unsigned long hugepagesize_kb = 0; + unsigned long nr_hugepages_before = 0; + unsigned long nr_hugepages_after = 0; + enum test_status status = TEST_SKIPPED; + + printf("Test Soft Offline When softoffline_corrected_errors=1\n"); + + fd = create_hugetlbfs_file(&file_stat); + if (fd < 0) { + printf(EPREFIX "Failed to create hugetlbfs file\n"); + return status; + } + + hugepagesize_kb = file_stat.f_bsize / 1024; + printf(PREFIX "Hugepagesize is %ldkB\n", hugepagesize_kb); + + if (set_softoffline_corrected_errors(hugepagesize_kb, 1)) + return TEST_FAILED; + + if (read_nr_hugepages(hugepagesize_kb, &nr_hugepages_before) != 0) + return TEST_FAILED; + + printf(PREFIX "Before MADV_SOFT_OFFLINE nr_hugepages=%ld\n", + nr_hugepages_before); + + status = do_soft_offline(fd, 2 * file_stat.f_bsize, /*expect_ret=*/0); + + if (read_nr_hugepages(hugepagesize_kb, &nr_hugepages_after) != 0) + return TEST_FAILED; + + printf(PREFIX "After MADV_SOFT_OFFLINE nr_hugepages=%ld\n", + nr_hugepages_after); + + if (nr_hugepages_before != nr_hugepages_after + 1) { + printf(EPREFIX "MADV_SOFT_OFFLINE should reduced 1 hugepage\n"); + return TEST_FAILED; + } + + return status; +} + +static enum test_status test_disable_soft_offline(void) +{ + int fd; + struct statfs file_stat; + unsigned long hugepagesize_kb = 0; + unsigned long nr_hugepages_before = 0; + unsigned long nr_hugepages_after = 0; + enum test_status status = TEST_SKIPPED; + + printf("Test Soft Offline When softoffline_corrected_errors=0\n"); + + fd = create_hugetlbfs_file(&file_stat); + if (fd < 0) { + printf(EPREFIX "Failed to create hugetlbfs file\n"); + return status; + } + + hugepagesize_kb = file_stat.f_bsize / 1024; + printf(PREFIX "Hugepagesize is %ldkB\n", hugepagesize_kb); + + if (set_softoffline_corrected_errors(hugepagesize_kb, 0)) + return TEST_FAILED; + + if (read_nr_hugepages(hugepagesize_kb, &nr_hugepages_before) != 0) + return TEST_FAILED; + + printf(PREFIX "Before MADV_SOFT_OFFLINE nr_hugepages=%ld\n", + nr_hugepages_before); + + status = do_soft_offline(fd, 2 * file_stat.f_bsize, /*expect_ret=*/EINVAL); + + if (read_nr_hugepages(hugepagesize_kb, &nr_hugepages_after) != 0) + return TEST_FAILED; + + printf(PREFIX "After MADV_SOFT_OFFLINE nr_hugepages=%ld\n", + nr_hugepages_after); + + if (nr_hugepages_before != nr_hugepages_after) { + printf(EPREFIX "MADV_SOFT_OFFLINE reduced %lu hugepages\n", + nr_hugepages_before - nr_hugepages_after); + return TEST_FAILED; + } + + return status; +} + +int main(void) +{ + enum test_status status; + + status = test_soft_offline(); + if (status != TEST_PASS) + return status; + + status = test_disable_soft_offline(); + if (status != TEST_PASS) + return status; + + printf("Test Soft Offline All Good!\n"); + return TEST_PASS; +} diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 3157204b9047..91db9971ba69 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -332,6 +332,10 @@ CATEGORY="hugetlb" run_test ./charge_reserved_hugetlb.sh -cgroup-v2 CATEGORY="hugetlb" run_test ./hugetlb_reparenting_test.sh -cgroup-v2 if $RUN_DESTRUCTIVE; then CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison +nr_hugepages_tmp=$(cat /proc/sys/vm/nr_hugepages) +echo 8 > /proc/sys/vm/nr_hugepages +CATEGORY="hugetlb" run_test ./hugetlb-soft-offline +echo "$nr_hugepages_tmp" > /proc/sys/vm/nr_hugepages fi if [ $VADDR64 -ne 0 ]; then