From patchwork Fri Jul 7 20:19:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13305254 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 C5E77C001DC for ; Fri, 7 Jul 2023 20:19:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 32F9C6B007E; Fri, 7 Jul 2023 16:19:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2DE526B0080; Fri, 7 Jul 2023 16:19:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1315B8D0001; Fri, 7 Jul 2023 16:19:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0503B6B007E for ; Fri, 7 Jul 2023 16:19:24 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C8231A0104 for ; Fri, 7 Jul 2023 20:19:23 +0000 (UTC) X-FDA: 80985930606.29.F1CD169 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) by imf28.hostedemail.com (Postfix) with ESMTP id C9E25C000D for ; Fri, 7 Jul 2023 20:19:21 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=cgDoU3tD; spf=pass (imf28.hostedemail.com: domain of 3SHOoZAgKCPsmldtl1dqjrrjoh.frpolqx0-ppnydfn.ruj@flex--jiaqiyan.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=3SHOoZAgKCPsmldtl1dqjrrjoh.frpolqx0-ppnydfn.ruj@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688761161; 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=dmSXGhNgjtW0Yb8+yIyK70NmvAjyR1vjV+RIYl0ULq4=; b=aKtKpWhgxJu0iS6t5UYSRLcDjFfgkEsobqSliyCC7xTsxmsTtH+vazBDpBuKePKofQTv/n gSR2kV8yD5Mi4Y5vyDRFWNfV8gv5iIMxmKmDXQhzlnWA/hpYcwCmbG+KI7LiwxJFDRZzqd M4YkY+RHxjlrKpVPjO9ZXhmVnyr9mu0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688761161; a=rsa-sha256; cv=none; b=Gh87O18xz3Tus+o7BZUSEXw6hmS8cnc11IfLfUxnU+PIwAmHnrN3Tsk3q/Xh0qH7Fm1giX WXViyVt18CSfIgPkjZPehmzaqYeSw9K4SGs2vXmDP6zk6niauoxPvoHPc+CkEq8J+VJYrQ r0RpTi2PAlVSdYheFynwnFydPtMHZR8= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=cgDoU3tD; spf=pass (imf28.hostedemail.com: domain of 3SHOoZAgKCPsmldtl1dqjrrjoh.frpolqx0-ppnydfn.ruj@flex--jiaqiyan.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=3SHOoZAgKCPsmldtl1dqjrrjoh.frpolqx0-ppnydfn.ruj@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-55b9ed8275aso2823226a12.1 for ; Fri, 07 Jul 2023 13:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688761160; x=1691353160; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=dmSXGhNgjtW0Yb8+yIyK70NmvAjyR1vjV+RIYl0ULq4=; b=cgDoU3tDkKP7JTQ+F0CzAiBgvzjb4qUPJbX80bmEdZNC2kBFPhSxB/2KWqZSIhGnu5 DNnicuDpK4RRjfvI8Od0feJbKV0/XU2e63+LYPuJBKE3rThjUkLPqnYx6RjItC6itmd6 E8oybw7gnCOvuqj/lkQyUEa8CGnU/e60XfcGhlrIjKezX1hZaq+Fbq1wQe5hiMJLfSxY 04YtCgIm9GcwTklBS9EFbPw5TLQgXGtx3bb42RDjvnpfonqnq7jboBzGk/LZy1us4JKo w+8/QeI5pWZgUe4X5h5uG4tRJUsMzcCNRRNm03kEX6WEvTDa0+st3K25FuKUsfWelq3J yj+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688761160; x=1691353160; 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=dmSXGhNgjtW0Yb8+yIyK70NmvAjyR1vjV+RIYl0ULq4=; b=IXarUKc1oF4qB0Yb/sgKdo3bP8LgsJ0FvWEiKNv2f7ueOzSDVs9RD4kA2MTo/AsqlW tunNGVP/Zry30RNUi/tjRvZEZFfcS3pyZbyAv/0KFGjE5B44uV+MeSqA7E8cNKscPTD4 mB+n2VDrcfyQljkHfGu1UsxrASgTsXCKapFsLCr4sQBtvwp6aCZfKEndpWTJaYcxNB3Z 0s4zdRIzk2iw42Nvu6M0g9QwiihW3fd9ZZKaNLov4owcHRQZUV7o7aHL1HawtjXf2TAg oxRLEwwXFVLPjBXLJhvCct3WY56h99Um4s7OehYjVNGqsSlWE6CE5q85pk+36YSiN7LY 5RRg== X-Gm-Message-State: ABy/qLb+jQqA4+xLiIgBxgfl4hV6Ai+0mV+W1L6tL20/yguBzF9VzLja LpR4Ihu3chQwsGRjN659T4LT6rwis/ia9A== X-Google-Smtp-Source: APBJJlH7Cq0eDn70cDDe92uconHq1/8/0rJBg2JnBViw/2FmoEOJgxc84w8NuFGWdffzBFiFeO6rajwXkfI/1A== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a63:9316:0:b0:53f:f32b:1f20 with SMTP id b22-20020a639316000000b0053ff32b1f20mr4028211pge.2.1688761160596; Fri, 07 Jul 2023 13:19:20 -0700 (PDT) Date: Fri, 7 Jul 2023 20:19:04 +0000 In-Reply-To: <20230707201904.953262-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20230707201904.953262-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog Message-ID: <20230707201904.953262-5-jiaqiyan@google.com> Subject: [PATCH v3 4/4] selftests/mm: add tests for HWPOISON hugetlbfs read From: Jiaqi Yan To: akpm@linux-foundation.org, mike.kravetz@oracle.com, naoya.horiguchi@nec.com Cc: songmuchun@bytedance.com, shy828301@gmail.com, linmiaohe@huawei.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, duenwen@google.com, axelrasmussen@google.com, jthoughton@google.com, Jiaqi Yan X-Rspamd-Queue-Id: C9E25C000D X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: y45gktamchr7a4d457ueztz5d9m4pwtk X-HE-Tag: 1688761161-356070 X-HE-Meta: U2FsdGVkX1/6Ky8XpAk5YYGXSx2r26tSimcGfexE5kUhymHF4IgKwkZCYm1cbFJy2WokFIs9+KZYb3QHeckOd0kc50e8OWsbzdA2XRG2uzhQ/8TITZAa6lF7zWNjo042VI5nRB3lRneWMCs3NEUTlyaEXqgDT42IPMGig5LSHUiFBP/XgCbJSGmxSiPv8vxVldsigvZ78xY7FjTjZJtmNwWQgRxC5XSZ7GMu4KexTg2Vhhm2K4SxLso4PXu56cNXx8SoVE0iMqRYa9tEN+Ahm9HftZt7fpVlXsrg1tb2Q4rGPx92S4Ocx6VTyuEDG1anxX9yZiGFjv8Ds4egraqvIOe6AGpUTQwHIvfGal7z07PoQqJMBW8XF2TnLpzUXtQKjme0QmdCMx/yLFoct0ExcmFEPHz/5pNVirgbZeaQmR5MOoLKIUzTh6uhhxVvrZAbmUaYIC23wJ338cT3QHoeeqDMW6GhoJ0wxyO9ulwyxSHmyvc7OaO9qcQ6a5dZ9qhWPhtJ8VdENlscgGU6Eq1NbIC+R2AlkpxC8OjeQMjBg+ZFGlFS21qErHnj6fQnhKNyDK7pe9A8MyUT2EYca3Bco9OoSrKF5U0b3LcxNKHgn0uIHDwSpIBS6OXlqoEI5YOoiRBamwwMQigLQnOsPvyX/f+0v5d/s4lNONPaBwVpZ4xYQbdKBoXoqA+Evn/4355zMelt9JT3FmzQsKiMoVAdRJMBDpTsjKoZ2ghmyCNmgEBDijH6WfKd1gAuIWes38mXv7UKWEuVyGF/7i2HlVGnmLAvFMe206T2ymmCbrPyT4MakCEa2du0BoaQYyh3mZuqFTlz0s3Af3enOBXO+SedsZsIx5i5NqLOikuF+309Smctce85gqj7QPzkZ39I9p5FpzmO1FdbCFYzkoLmEtufTheH7j1NDIiWwNCpWnP4uDTScpF+DAiAucuNFqC3gKMinCoDV2nFpdK3NvC4UmB 2Q4MBF/1 92a8Nm28L91i+7fdxnoCfNn/ut11odzQB6JmK7J79MtSVtjJkk/EtRrh9NnshuuiS91nvyC1A+AMoTCE3KK6Ebu9kYS6rSZG63yu5qtoTDx8TciU3vh0Bzv3bf8EPgSWGaZlwVC846s65SwNyIRfr5+YjQRaJzk8sEyrgB+8yPUeixcZQzEsF0GhFQC+owTB+NlRw6h+nKYiVoiLncPqcMDVMjLUll+7zGZqEZI66OR9JWCV0x1CmNGvPM1W1eUsYQBgcnESKanerbngwxwDIL2IsW5JOmfkUIjEZ6tFngm+sU9y0CbYzYBZC38++fBZjR+70o61n7RDG+I6TzjRv8tlOCbI1roCt6dUZg+w7WakOGPQy3az9b9LoTAxNnoyetn78+9yrD0KLNCZ+VNd/fJ5av8uR/QspnX/ApBWKJ2hnVp0ITF56nmdpqlJByyWhHfiIiTmQdN6ZZammkyZNnJ0hl5ND8arJv4ok7BTCBgweWG2VyVj7c8XC/xPMg/3A2kVsULX/7obXh7riXdKJvVmQ7y8/u+HXVa9NuUMpARvI15ZR4EwLVUoitt0RyLwZK8Kibl4qSiaL34xZd7wlwiVfrc/9fkbWFYSr3/Qom/UP+uUADKmfIOckEoqJLu0RpdWsF1PGqsgQTtkdNfy3OZW4WA1/kE5fxrxuTDtqr1yM9Bg= 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: Add tests for the improvement made to read operation on HWPOISON hugetlb page with different read granularities. For each chunk size, three read scenarios are tested: 1. Simple regression test on read without HWPOISON. 2. Sequential read page by page should succeed until encounters the 1st raw HWPOISON subpage. 3. After skip a raw HWPOISON subpage by lseek, read()s always succeed. Acked-by: Mike Kravetz Reviewed-by: Naoya Horiguchi Signed-off-by: Jiaqi Yan --- tools/testing/selftests/mm/.gitignore | 1 + tools/testing/selftests/mm/Makefile | 1 + .../selftests/mm/hugetlb-read-hwpoison.c | 322 ++++++++++++++++++ 3 files changed, 324 insertions(+) create mode 100644 tools/testing/selftests/mm/hugetlb-read-hwpoison.c diff --git a/tools/testing/selftests/mm/.gitignore b/tools/testing/selftests/mm/.gitignore index 7e2a982383c0..cdc9ce4426b9 100644 --- a/tools/testing/selftests/mm/.gitignore +++ b/tools/testing/selftests/mm/.gitignore @@ -5,6 +5,7 @@ hugepage-mremap hugepage-shm hugepage-vmemmap hugetlb-madvise +hugetlb-read-hwpoison khugepaged map_hugetlb map_populate diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 66d7c07dc177..b7fce9073279 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -41,6 +41,7 @@ TEST_GEN_PROGS += gup_longterm TEST_GEN_PROGS += gup_test TEST_GEN_PROGS += hmm-tests TEST_GEN_PROGS += hugetlb-madvise +TEST_GEN_PROGS += hugetlb-read-hwpoison TEST_GEN_PROGS += hugepage-mmap TEST_GEN_PROGS += hugepage-mremap TEST_GEN_PROGS += hugepage-shm diff --git a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c new file mode 100644 index 000000000000..ba6cc6f9cabc --- /dev/null +++ b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c @@ -0,0 +1,322 @@ +// SPDX-License-Identifier: GPL-2.0 + +#define _GNU_SOURCE +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "../kselftest.h" + +#define PREFIX " ... " +#define ERROR_PREFIX " !!! " + +#define MAX_WRITE_READ_CHUNK_SIZE (getpagesize() * 16) +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) + +enum test_status { + TEST_PASSED = 0, + TEST_FAILED = 1, + TEST_SKIPPED = 2, +}; + +static char *status_to_str(enum test_status status) +{ + switch (status) { + case TEST_PASSED: + return "TEST_PASSED"; + case TEST_FAILED: + return "TEST_FAILED"; + case TEST_SKIPPED: + return "TEST_SKIPPED"; + default: + return "TEST_???"; + } +} + +static int setup_filemap(char *filemap, size_t len, size_t wr_chunk_size) +{ + char iter = 0; + + for (size_t offset = 0; offset < len; + offset += wr_chunk_size) { + iter++; + memset(filemap + offset, iter, wr_chunk_size); + } + + return 0; +} + +static bool verify_chunk(char *buf, size_t len, char val) +{ + size_t i; + + for (i = 0; i < len; ++i) { + if (buf[i] != val) { + printf(PREFIX ERROR_PREFIX "check fail: buf[%lu] = %u != %u\n", + i, buf[i], val); + return false; + } + } + + return true; +} + +static bool seek_read_hugepage_filemap(int fd, size_t len, size_t wr_chunk_size, + off_t offset, size_t expected) +{ + char buf[MAX_WRITE_READ_CHUNK_SIZE]; + ssize_t ret_count = 0; + ssize_t total_ret_count = 0; + char val = offset / wr_chunk_size + offset % wr_chunk_size; + + printf(PREFIX PREFIX "init val=%u with offset=0x%lx\n", val, offset); + printf(PREFIX PREFIX "expect to read 0x%lx bytes of data in total\n", + expected); + if (lseek(fd, offset, SEEK_SET) < 0) { + perror(PREFIX ERROR_PREFIX "seek failed"); + return false; + } + + while (offset + total_ret_count < len) { + ret_count = read(fd, buf, wr_chunk_size); + if (ret_count == 0) { + printf(PREFIX PREFIX "read reach end of the file\n"); + break; + } else if (ret_count < 0) { + perror(PREFIX ERROR_PREFIX "read failed"); + break; + } + ++val; + if (!verify_chunk(buf, ret_count, val)) + return false; + + total_ret_count += ret_count; + } + printf(PREFIX PREFIX "actually read 0x%lx bytes of data in total\n", + total_ret_count); + + return total_ret_count == expected; +} + +static bool read_hugepage_filemap(int fd, size_t len, + size_t wr_chunk_size, size_t expected) +{ + char buf[MAX_WRITE_READ_CHUNK_SIZE]; + ssize_t ret_count = 0; + ssize_t total_ret_count = 0; + char val = 0; + + printf(PREFIX PREFIX "expect to read 0x%lx bytes of data in total\n", + expected); + while (total_ret_count < len) { + ret_count = read(fd, buf, wr_chunk_size); + if (ret_count == 0) { + printf(PREFIX PREFIX "read reach end of the file\n"); + break; + } else if (ret_count < 0) { + perror(PREFIX ERROR_PREFIX "read failed"); + break; + } + ++val; + if (!verify_chunk(buf, ret_count, val)) + return false; + + total_ret_count += ret_count; + } + printf(PREFIX PREFIX "actually read 0x%lx bytes of data in total\n", + total_ret_count); + + return total_ret_count == expected; +} + +static enum test_status +test_hugetlb_read(int fd, size_t len, size_t wr_chunk_size) +{ + enum test_status status = TEST_SKIPPED; + char *filemap = NULL; + + if (ftruncate(fd, len) < 0) { + perror(PREFIX ERROR_PREFIX "ftruncate failed"); + return status; + } + + filemap = mmap(NULL, len, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_POPULATE, fd, 0); + if (filemap == MAP_FAILED) { + perror(PREFIX ERROR_PREFIX "mmap for primary mapping failed"); + goto done; + } + + setup_filemap(filemap, len, wr_chunk_size); + status = TEST_FAILED; + + if (read_hugepage_filemap(fd, len, wr_chunk_size, len)) + status = TEST_PASSED; + + munmap(filemap, len); +done: + if (ftruncate(fd, 0) < 0) { + perror(PREFIX ERROR_PREFIX "ftruncate back to 0 failed"); + status = TEST_FAILED; + } + + return status; +} + +static enum test_status +test_hugetlb_read_hwpoison(int fd, size_t len, size_t wr_chunk_size, + bool skip_hwpoison_page) +{ + enum test_status status = TEST_SKIPPED; + char *filemap = NULL; + char *hwp_addr = NULL; + const unsigned long pagesize = getpagesize(); + + if (ftruncate(fd, len) < 0) { + perror(PREFIX ERROR_PREFIX "ftruncate failed"); + return status; + } + + filemap = mmap(NULL, len, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_POPULATE, fd, 0); + if (filemap == MAP_FAILED) { + perror(PREFIX ERROR_PREFIX "mmap for primary mapping failed"); + goto done; + } + + setup_filemap(filemap, len, wr_chunk_size); + status = TEST_FAILED; + + /* + * Poisoned hugetlb page layout (assume hugepagesize=2MB): + * |<---------------------- 1MB ---------------------->| + * |<---- healthy page ---->|<---- HWPOISON page ----->| + * |<------------------- (1MB - 8KB) ----------------->| + */ + hwp_addr = filemap + len / 2 + pagesize; + if (madvise(hwp_addr, pagesize, MADV_HWPOISON) < 0) { + perror(PREFIX ERROR_PREFIX "MADV_HWPOISON failed"); + goto unmap; + } + + if (!skip_hwpoison_page) { + /* + * Userspace should be able to read (1MB + 1 page) from + * the beginning of the HWPOISONed hugepage. + */ + if (read_hugepage_filemap(fd, len, wr_chunk_size, + len / 2 + pagesize)) + status = TEST_PASSED; + } else { + /* + * Userspace should be able to read (1MB - 2 pages) from + * HWPOISONed hugepage. + */ + if (seek_read_hugepage_filemap(fd, len, wr_chunk_size, + len / 2 + MAX(2 * pagesize, wr_chunk_size), + len / 2 - MAX(2 * pagesize, wr_chunk_size))) + status = TEST_PASSED; + } + +unmap: + munmap(filemap, len); +done: + if (ftruncate(fd, 0) < 0) { + perror(PREFIX ERROR_PREFIX "ftruncate back to 0 failed"); + status = TEST_FAILED; + } + + return status; +} + +static int create_hugetlbfs_file(struct statfs *file_stat) +{ + int fd; + + fd = memfd_create("hugetlb_tmp", MFD_HUGETLB); + if (fd < 0) { + perror(PREFIX ERROR_PREFIX "could not open hugetlbfs file"); + return -1; + } + + memset(file_stat, 0, sizeof(*file_stat)); + if (fstatfs(fd, file_stat)) { + perror(PREFIX ERROR_PREFIX "fstatfs failed"); + goto close; + } + if (file_stat->f_type != HUGETLBFS_MAGIC) { + printf(PREFIX ERROR_PREFIX "not hugetlbfs file\n"); + goto close; + } + + return fd; +close: + close(fd); + return -1; +} + +int main(void) +{ + int fd; + struct statfs file_stat; + enum test_status status; + /* Test read() in different granularity. */ + size_t wr_chunk_sizes[] = { + getpagesize() / 2, getpagesize(), + getpagesize() * 2, getpagesize() * 4 + }; + size_t i; + + for (i = 0; i < ARRAY_SIZE(wr_chunk_sizes); ++i) { + printf("Write/read chunk size=0x%lx\n", + wr_chunk_sizes[i]); + + fd = create_hugetlbfs_file(&file_stat); + if (fd < 0) + goto create_failure; + printf(PREFIX "HugeTLB read regression test...\n"); + status = test_hugetlb_read(fd, file_stat.f_bsize, + wr_chunk_sizes[i]); + printf(PREFIX "HugeTLB read regression test...%s\n", + status_to_str(status)); + close(fd); + if (status == TEST_FAILED) + return -1; + + fd = create_hugetlbfs_file(&file_stat); + if (fd < 0) + goto create_failure; + printf(PREFIX "HugeTLB read HWPOISON test...\n"); + status = test_hugetlb_read_hwpoison(fd, file_stat.f_bsize, + wr_chunk_sizes[i], false); + printf(PREFIX "HugeTLB read HWPOISON test...%s\n", + status_to_str(status)); + close(fd); + if (status == TEST_FAILED) + return -1; + + fd = create_hugetlbfs_file(&file_stat); + if (fd < 0) + goto create_failure; + printf(PREFIX "HugeTLB seek then read HWPOISON test...\n"); + status = test_hugetlb_read_hwpoison(fd, file_stat.f_bsize, + wr_chunk_sizes[i], true); + printf(PREFIX "HugeTLB seek then read HWPOISON test...%s\n", + status_to_str(status)); + close(fd); + if (status == TEST_FAILED) + return -1; + } + + return 0; + +create_failure: + printf(ERROR_PREFIX "Abort test: failed to create hugetlbfs file\n"); + return -1; +}