From patchwork Fri Jun 23 16:40:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13290812 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 0B24BEB64D7 for ; Fri, 23 Jun 2023 16:40:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 258038D0009; Fri, 23 Jun 2023 12:40:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E1C98D0001; Fri, 23 Jun 2023 12:40:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 05B1D8D0009; Fri, 23 Jun 2023 12:40:29 -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 ECB648D0001 for ; Fri, 23 Jun 2023 12:40:28 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B9E211202C1 for ; Fri, 23 Jun 2023 16:40:28 +0000 (UTC) X-FDA: 80934575736.10.283DAF5 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf21.hostedemail.com (Postfix) with ESMTP id 998CC1C0016 for ; Fri, 23 Jun 2023 16:40:26 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=Qcx52ve9; spf=pass (imf21.hostedemail.com: domain of 3-cqVZAgKCBI10s80Gs5y66y3w.u64305CF-442Dsu2.69y@flex--jiaqiyan.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3-cqVZAgKCBI10s80Gs5y66y3w.u64305CF-442Dsu2.69y@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=1687538426; 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=YIyoXn+1WkJIHdk0UP5PwbMUr6M5AyBU7f22CzTi81I=; b=5P7Aq0TH9LmkYPkGL4+9JDM2onXH6fkfFRjeZ8jWTSG/aURKwHbXSlxnkvCj4ysL0DAfOC HdRP0rttjGSw7mx/4isoF8VamBmiHz9D5OR+ZoDya/dIlLOiRMuEtGZD+rvOHwbKVojljH oHazyZJRwJ2ipveN32Cwkj065WgJdqQ= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=Qcx52ve9; spf=pass (imf21.hostedemail.com: domain of 3-cqVZAgKCBI10s80Gs5y66y3w.u64305CF-442Dsu2.69y@flex--jiaqiyan.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3-cqVZAgKCBI10s80Gs5y66y3w.u64305CF-442Dsu2.69y@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687538426; a=rsa-sha256; cv=none; b=UiepRWXOXXodEy1YTOG6Q/iPoCvt6Q2R/gZOR6gORtposNxyywzR855o41NFX++kueefuP cRkZnVaSTTFSSMwQVAlGur/DmTUvCUe5lczfCC5FyG0GBlb7i7WneiF/7I+2QyNQabWgXw GdaSYIdPZDrcZJ0EKwVOjBnUn5RVJKw= Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-bf179fcc200so1194430276.0 for ; Fri, 23 Jun 2023 09:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687538425; x=1690130425; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=YIyoXn+1WkJIHdk0UP5PwbMUr6M5AyBU7f22CzTi81I=; b=Qcx52ve9KgnXSTCkr0swZ2WTRjlDvDcsTWcwzblh7tcWx6rHnkyrDMr08/A05+ATOe IA56VxpPNT4kOPlnQyBmMq4uwH5E01E1zJj3irtYUFzCwkTgTjgj/miAX+7YfOdXiaIG FoNf3ahcKhTXUjgjjszmudDkx0Opu+tRA2YOhKowD3T1Z19zz2Gdoa4f0lkkGsPiiokE kaVIPt8Bkw+1+XNTrEoN4uwjtVzikw5oQRYfBZy+WD0cnNsxcyqL/Cd9mapd8EUSMpMH 9q8Yug4/qANGyBOhnT2VJXRFRlG2PBI3piIArguO6lpdO6lpCxW45PSZg9IBGGNrPrq0 X45Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687538425; x=1690130425; 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=YIyoXn+1WkJIHdk0UP5PwbMUr6M5AyBU7f22CzTi81I=; b=Okcf7abc9Yxjsg3/SvaKhDZr2AqhgWIITjnv9Ua55Sq+ndwhoiGMvkulvLD5Z7Xsn0 DfBc8V8jkNuV5eEriGRxjdChPwxJp4gbULzYZQbjcJH0UAr1TgzHpj9Jnm3PVj27yFb/ s5nBLKm34PESsXYCGxEQ+zxxNTi1o6dG6CSKVDYn0jktz6/qFvm0czyE6qsRNDyI+5e9 WzP2f0P8/bBpgsbLmsvdOuYieSNanLxfhtB+S0wXk+NXefLFRK/aUsjbR8GU85rhoxwD vjcBrF5r5DM886qdMMkG59zFa5Owt/Mx7g4aSGny1tBXmhe8RX3pQ/3AvlxGDe0H7vOG uYXA== X-Gm-Message-State: AC+VfDxZWDhhKJGJTFr6o1/FEbWkIUzIKjjQQpvQJ8AHXXKl+kf6KyDm lPZR2HU/smSzBy8gK00amkzh+D4/3w3mYA== X-Google-Smtp-Source: ACHHUZ4ZR54fVwuIAJMMF1saAYALIlGVpfUcualmuGLE51PKcjNTNVVMGPaP9n2mhGuS+ww/528Oud+RHoTUsA== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a25:e78a:0:b0:bc4:ef98:681c with SMTP id e132-20020a25e78a000000b00bc4ef98681cmr3885496ybh.13.1687538425732; Fri, 23 Jun 2023 09:40:25 -0700 (PDT) Date: Fri, 23 Jun 2023 16:40:15 +0000 In-Reply-To: <20230623164015.3431990-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20230623164015.3431990-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230623164015.3431990-5-jiaqiyan@google.com> Subject: [PATCH v2 4/4] selftests/mm: add tests for HWPOISON hugetlbfs read From: Jiaqi Yan To: mike.kravetz@oracle.com, naoya.horiguchi@nec.com Cc: songmuchun@bytedance.com, shy828301@gmail.com, linmiaohe@huawei.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, duenwen@google.com, axelrasmussen@google.com, jthoughton@google.com, Jiaqi Yan X-Rspamd-Queue-Id: 998CC1C0016 X-Rspam-User: X-Stat-Signature: aegzm86e9hnx9qg5sjxdhizonawngqu1 X-Rspamd-Server: rspam01 X-HE-Tag: 1687538426-770943 X-HE-Meta: U2FsdGVkX18buLX3MI7YaFDSR9/ZURBpllFUHkm6ro9OeCAGR6TD4u+k92vyoA8sI8IBP9Ey4S7OynImuzlY5xJilAgPhTO50C53zGvpMeMgJvL9WeGsxOdZpIrs4hdlXdxlZ9UYachQGwL1RKQTGqHVXihBklSyJJo6in2RQ/qL34vaOpcaCYqNY7C3Ki9uit5Prw0xYO1c9dPSVpCKs5b/8ZOanZSn6L6gHF8Lsc/UqP6uocqXH38jX6QpQoQ4XAG54o7OLI+raIHuVNp1BFie9uYaATE5moVHQc9MZAlkqDsmj7Lfu3LjEFjQw8cCfLHzYngyCIFu6w4FzS53yjrswqwGQa91it7XS69UqHVpI6pfot5D86CPA9u2Nm3y0zfZ7yPHFD5IBaqYJG5c/CrOnwSXo9wvvV7q/daArGOVPcCVgPdTgRF6XeEV8wgVnpNcE3gRvwyi+hQj/XUnGZH06/oz/Cby9l4ReJw+2GLOX4bhhAqhchLPD04DumysqRGoCpMC54OwmKgoXqdniaU60SXuo/zKFawPpwFX65ft02atvIR6cQDIonL0oN6msBh8YGhc7kbzxY/eVmIS/krsBoSvTHITrzd+qe2Xfioa7rJOeuh9z6xR/uP4czaxTaMujQqVdeQY4laqb4fxIbRXCBpkUhsbf2jaxQJBgBKiu+Tgnc3qg7aeP9bj/Y15esH2+veyBwOZMyAO/3E6RMjz0Jdmvw26tzEGf8zX/40tNy0IA416a0uRlzGxMWYDTJdOiwzj/dqsUMNgD+739TJFyxbLUH49o9AVgsSFdn0GB1BOlHQVn+/z/m8xC5spFD2j4i7Je7rzqSWQUjvuMNSAG4HiLdlaZXhG/2bZ9j3/tz1S8KrMRtTkpBDV3erN2e079YdQECTM+SV/G4tsQGHb+E9jD00+rX3YPqSeOcYpS+ApBjB50LyNUV5sipVJRk8FnqBZxMNZwgoLr+s Csf7rdf+ uiTuFfvuRrVsF6JEhKo+pmyV0CXPtbPdk/MmYdpX8uTOEJJfnYpvklLHw4gx6o2LdrRT+pXcPbS5XMDDSmqxkRbRznnQ1HrQgA+DCQ89DAMrG4FuQWAAIFtHsFh79HYly20Q9oI92tPb4WDbGEGeOmd7VYRoX/nfEAwJUUvhufpCg7CJApCZ36EDu81KR7f+KLAQHdzbwNjy2K/CwsT+v4CT+5ihgCiNooPK908Hd63BBxKwWk2oq1Z8nH+EZyAUI8R7ADYF/EjgvU0Ptk1C9ta0Bp1UBMwl0TDB1DwK+5MmQiG8hwkSIQ08iK+TOtolxnMJ0R2zv+qcXI8xa1sWKGWXlVVBHDeNB89sE/pml2dQnr7iW5QqtWXC6me0ti8KGvSn92HBFj+he1ZAxgwuj4+Em9H+t9vYBeZW7yHScfC80+UX0DB4MH74G38M0aLDlDTkyzrBm3o4OMpdyTJheqB6YhTSZ6KnkMSyuo+XKubmjPGZDSOLSlJ7Gb+Ry36V/gn5tSWXARw7PXBYv9TgQ+TCCuLShtQe7w5lgYCfkeht5IhJe0WTxNEYRYc6nn9VNXUHLgCOEddQbhOZ01TWwwqGngebCLZSvSjIs4vULEWVZ2eK0GRzXC5o45g== 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 raw HWPOISON subpage by lseek, read()s always succeed. Signed-off-by: Jiaqi Yan Acked-by: Mike Kravetz Reviewed-by: Naoya Horiguchi --- 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 5599cf287694..37419296bf79 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 95acb099315e..63fcc7e3e9f0 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -38,6 +38,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; +}