From patchwork Tue Oct 4 21:41:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12998715 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 B3BC7C433F5 for ; Tue, 4 Oct 2022 21:41:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 40E4C6B0073; Tue, 4 Oct 2022 17:41:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BEE16B0074; Tue, 4 Oct 2022 17:41:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2ADCD6B0075; Tue, 4 Oct 2022 17:41:33 -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 187C16B0073 for ; Tue, 4 Oct 2022 17:41:33 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E61251602D5 for ; Tue, 4 Oct 2022 21:41:32 +0000 (UTC) X-FDA: 79984588824.28.C573C56 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf30.hostedemail.com (Postfix) with ESMTP id 77A948000C for ; Tue, 4 Oct 2022 21:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664919692; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/w2JwM8JeFqa2ztqMSbd+xEgiAESxi1m1hIt+DBhlCQ=; b=VR1RROPqQmZ1PUyJTTCx5GBHtugFwZhbkzY/XoeFttWi4i+V65UCFdbpeqEs1P/U8s8BYy 3IsWDYak8uF+0zLoOWwa/DN/wacWhy8Z8CP1U3FTIXi32HzVOORsa0UzLOyihH6rIhev5U QCQjEgC1wKhRTZbK/z2qsXAXzDxNaws= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-643-DC-E6Yl-PHeyG5--Z0_gEw-1; Tue, 04 Oct 2022 17:41:29 -0400 X-MC-Unique: DC-E6Yl-PHeyG5--Z0_gEw-1 Received: by mail-qt1-f200.google.com with SMTP id d1-20020ac80601000000b00388b0fc84beso1822926qth.3 for ; Tue, 04 Oct 2022 14:41:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=/w2JwM8JeFqa2ztqMSbd+xEgiAESxi1m1hIt+DBhlCQ=; b=eyXAd9uAhuQNPQKa6sj08Y2D9wnCdMFzpqOpl/x9HBHT5wroYTL33uYcV6boCr6slo EkMggnws7KeMxa2IOxdNLe2y6EF24SCSRengvUHHvdoqBBK0LoJGSQKKlfeTvF3E+PpI HYJn5LbpoR3w0nxFM7cjOFixlFeehVxubzTuEOQ3DYtl60c3jCJsQ/fsFoyvfsICzcG4 uY3KV38S+fYn9sZmAe89RQ0W8+EFWtd8rU0fXAWJR2902gXKOqPzJp/u19drJ+BB1hGL jKYGyOcKwrJf1NLSTDt2Tmq9rhcCWGijuPPdR8i4ZiyAVRdduY3zrxmEPZmNnhkydi7S Yyhw== X-Gm-Message-State: ACrzQf2cWTjRH8YSuEA5H1k4smkyLoolLv68kDKnb1RKN5DdIyAGRdKz MWPNRoVCFWAYFiLD5JtgaNALGLeUcyeG02ydHeVkWBtJe/ZNWnNASmCX3dSMfU+LvS4elr2qDUi Ui9KZvqnd0U0= X-Received: by 2002:ac8:5cd5:0:b0:35b:bbd1:20ea with SMTP id s21-20020ac85cd5000000b0035bbbd120eamr21123619qta.549.1664919688608; Tue, 04 Oct 2022 14:41:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qF+0TqymelkGkoObEdmZR55zlKAQ3919cYMgIiCESflQCNd2+DsttJ2F1dVn6tCX0I6g9Yg== X-Received: by 2002:ac8:5cd5:0:b0:35b:bbd1:20ea with SMTP id s21-20020ac85cd5000000b0035bbbd120eamr21123607qta.549.1664919688375; Tue, 04 Oct 2022 14:41:28 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id y15-20020a05620a25cf00b006bbf85cad0fsm15519956qko.20.2022.10.04.14.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 14:41:27 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , peterx@redhat.com, Axel Rasmussen , Mike Kravetz Subject: [PATCH 1/4] selftests/vm: Use memfd for hugetlb tests Date: Tue, 4 Oct 2022 17:41:22 -0400 Message-Id: <20221004214125.120993-2-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221004214125.120993-1-peterx@redhat.com> References: <20221004214125.120993-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664919692; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/w2JwM8JeFqa2ztqMSbd+xEgiAESxi1m1hIt+DBhlCQ=; b=mLz/9EVeYaauo0vYqmFXaxgWMq9Wq+fSlw0Cc9B1lE6tg4hUcixrOxLG8gOSVpGPDTLSqy qTYVqQG1CRYQxauSR/SlXoIiZVmGy5gAL1hqEiykS9gGXj3G/l0s/x+uHhIPu0AReCIZoD S92JAJ/Lfmf1+xGRnnvxXsybCK0Yk3s= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VR1RROPq; spf=pass (imf30.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664919692; a=rsa-sha256; cv=none; b=jR+WmsGydkJUvLamXcjjuJOz+rMQ47iDkRQojZwDQjwH1SoC22SaNjlXOs36Jzijc8sAYy ANRVOIN3adgDTpRkDLANEHaEgpzlhMXnQgtMpO1I3TqrZyeN/j0np0pKC+IIBgv+p8u2eA hoYB75ERiOf/5XIVWmOGUoKrtMFRrQA= X-Rspamd-Queue-Id: 77A948000C Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VR1RROPq; spf=pass (imf30.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: 8knxhqz4boejc36pt3ktjo8pph4gqhte X-HE-Tag: 1664919692-343976 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: We already used memfd for shmem test, move it forward with hugetlb too so that we don't need user to specify the hugetlb file path explicitly when running hugetlb shared tests. Signed-off-by: Peter Xu Reviewed-by: Axel Rasmussen --- tools/testing/selftests/vm/userfaultfd.c | 60 ++++++++---------------- 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index 74babdbc02e5..c0c6853cdce5 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c @@ -93,10 +93,8 @@ static volatile bool test_uffdio_zeropage_eexist = true; static bool test_uffdio_wp = true; /* Whether to test uffd minor faults */ static bool test_uffdio_minor = false; - static bool map_shared; -static int shm_fd; -static int huge_fd; +static int mem_fd; static unsigned long long *count_verify; static int uffd = -1; static int uffd_flags, finished, *pipefd; @@ -260,35 +258,21 @@ static void hugetlb_release_pages(char *rel_area) static void hugetlb_allocate_area(void **alloc_area, bool is_src) { + off_t size = nr_pages * page_size; + off_t offset = is_src ? 0 : size; void *area_alias = NULL; char **alloc_area_alias; - if (!map_shared) - *alloc_area = mmap(NULL, - nr_pages * page_size, - PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | - (is_src ? 0 : MAP_NORESERVE), - -1, - 0); - else - *alloc_area = mmap(NULL, - nr_pages * page_size, - PROT_READ | PROT_WRITE, - MAP_SHARED | - (is_src ? 0 : MAP_NORESERVE), - huge_fd, - is_src ? 0 : nr_pages * page_size); + *alloc_area = mmap(NULL, size, PROT_READ | PROT_WRITE, + (map_shared ? MAP_SHARED : MAP_PRIVATE) | + (is_src ? 0 : MAP_NORESERVE), + mem_fd, offset); if (*alloc_area == MAP_FAILED) err("mmap of hugetlbfs file failed"); if (map_shared) { - area_alias = mmap(NULL, - nr_pages * page_size, - PROT_READ | PROT_WRITE, - MAP_SHARED, - huge_fd, - is_src ? 0 : nr_pages * page_size); + area_alias = mmap(NULL, size, PROT_READ | PROT_WRITE, + MAP_SHARED, mem_fd, offset); if (area_alias == MAP_FAILED) err("mmap of hugetlb file alias failed"); } @@ -334,14 +318,14 @@ static void shmem_allocate_area(void **alloc_area, bool is_src) } *alloc_area = mmap(p, bytes, PROT_READ | PROT_WRITE, MAP_SHARED, - shm_fd, offset); + mem_fd, offset); if (*alloc_area == MAP_FAILED) err("mmap of memfd failed"); if (test_collapse && *alloc_area != p) err("mmap of memfd failed at %p", p); area_alias = mmap(p_alias, bytes, PROT_READ | PROT_WRITE, MAP_SHARED, - shm_fd, offset); + mem_fd, offset); if (area_alias == MAP_FAILED) err("mmap of memfd alias failed"); if (test_collapse && area_alias != p_alias) @@ -1821,21 +1805,17 @@ int main(int argc, char **argv) } nr_pages = nr_pages_per_cpu * nr_cpus; - if (test_type == TEST_HUGETLB && map_shared) { - if (argc < 5) - usage(); - huge_fd = open(argv[4], O_CREAT | O_RDWR, 0755); - if (huge_fd < 0) - err("Open of %s failed", argv[4]); - if (ftruncate(huge_fd, 0)) - err("ftruncate %s to size 0 failed", argv[4]); - } else if (test_type == TEST_SHMEM) { - shm_fd = memfd_create(argv[0], 0); - if (shm_fd < 0) + if (test_type == TEST_SHMEM || test_type == TEST_HUGETLB) { + unsigned int memfd_flags = 0; + + if (test_type == TEST_HUGETLB) + memfd_flags = MFD_HUGETLB; + mem_fd = memfd_create(argv[0], memfd_flags); + if (mem_fd < 0) err("memfd_create"); - if (ftruncate(shm_fd, nr_pages * page_size * 2)) + if (ftruncate(mem_fd, nr_pages * page_size * 2)) err("ftruncate"); - if (fallocate(shm_fd, + if (fallocate(mem_fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, nr_pages * page_size * 2)) err("fallocate"); From patchwork Tue Oct 4 21:41:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12998716 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 5FAFEC4332F for ; Tue, 4 Oct 2022 21:41:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D62696B0074; Tue, 4 Oct 2022 17:41:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C72E76B0075; Tue, 4 Oct 2022 17:41:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC3CC6B0078; Tue, 4 Oct 2022 17:41:33 -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 9CA306B0074 for ; Tue, 4 Oct 2022 17:41:33 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 71A571607A5 for ; Tue, 4 Oct 2022 21:41:33 +0000 (UTC) X-FDA: 79984588866.21.D49960A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 1BD934000E for ; Tue, 4 Oct 2022 21:41:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664919691; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zhrtCe5O8iJscoLdf85Accar6WxcllS+eYr7bBy1HkM=; b=dJaHvDIYcugfcbZXI9MGjISejh5vRgBChdcjH0EX9gK2PQj+b+fXG3t17UHlBLb8jdj1yK 2Z55fE+yYvcGEOf2L1Jboc4PS7FvGShcZezLeSolAJm6G/f9lXfiss1mCN+VM5I9NkbKjE t8XW6WBULBEp0OipNqWRSkD5ufkSG/w= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-121-it2t_aZqP3yT7XvSsSOnUQ-1; Tue, 04 Oct 2022 17:41:30 -0400 X-MC-Unique: it2t_aZqP3yT7XvSsSOnUQ-1 Received: by mail-qt1-f200.google.com with SMTP id g6-20020ac84b66000000b0035cf832dec9so10100430qts.6 for ; Tue, 04 Oct 2022 14:41:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=zhrtCe5O8iJscoLdf85Accar6WxcllS+eYr7bBy1HkM=; b=JLuZDlEUS1i+o9lCHRkNBVRoWYcmqnUwwNK63MbSpns5Xk2GR063NaPUBU3gPV0XLL 4HjUe5cbYlIXWoI1yPxFX+D5xIkjCxtYc4WZ2OMMSz8SAiTFqnWRU8rXHCjOqK7Bu82z 27s76RXWkCm44GiNDxCIT/9dGq/JktbnczJu3hHv+KMHuancGr2F30g69UGeXTtfyT8f H6X6Srhs/Ttsz+khKRM+rpr12l3zbXQqgTVAt0ClbnaaMuqWVN+JlS4lqIeEcATAKciJ Z+zHMoHPaCfVa0HztLrO2QUyCsUi8QDGHMt9gcphv+yS3eW+JssVS34aGb554DGcP0OT dCDw== X-Gm-Message-State: ACrzQf0c0T+0TlU9+oI7L4TUvN0fRvQN4LSvELAmCrMOFmv2WDYKd2zO e37bQamoB/VtlyChmvS6i5I5JJGOmdPfCmqe1VnrtL5OgkvuNdkb3LFF5j+9s0og+8Dy1AjlyS0 otZtJRIwhpYY= X-Received: by 2002:a05:6214:c6d:b0:4b1:c751:ac7 with SMTP id t13-20020a0562140c6d00b004b1c7510ac7mr400606qvj.96.1664919689911; Tue, 04 Oct 2022 14:41:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5na/pwjmQhLcKutEJzsIkykeE5fgN/HwlF3WpQM1DgGubYNqpa+trsw7pJkJNONLm/cQp/ew== X-Received: by 2002:a05:6214:c6d:b0:4b1:c751:ac7 with SMTP id t13-20020a0562140c6d00b004b1c7510ac7mr400597qvj.96.1664919689696; Tue, 04 Oct 2022 14:41:29 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id y15-20020a05620a25cf00b006bbf85cad0fsm15519956qko.20.2022.10.04.14.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 14:41:29 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , peterx@redhat.com, Axel Rasmussen , Mike Kravetz Subject: [PATCH 2/4] selftests/vm: Use memfd for hugetlb-madvise test Date: Tue, 4 Oct 2022 17:41:23 -0400 Message-Id: <20221004214125.120993-3-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221004214125.120993-1-peterx@redhat.com> References: <20221004214125.120993-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664919692; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zhrtCe5O8iJscoLdf85Accar6WxcllS+eYr7bBy1HkM=; b=n72IiMCsxGQ5/nOd9ccEXVgXSzONBkf9x65ALIIjebBD0SoGlqrRfQRkUX/NpknXBOVvnu m3BBUc9S5d8QMg4EjhVI1DP8/YE33+6XmcKvQF5OcfKB4ZPOHT6QbnzIEGe5f4d9xtHknz 4zIXz/0f8/vDUS2V/4IIpAIn8IeBsQ8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dJaHvDIY; spf=pass (imf17.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664919692; a=rsa-sha256; cv=none; b=8cpKCrP047z6XMuADWXBWJ8VAzVhJdEng1jHGTB2iuV13hiyk6hV8J85xM2SWog3GKXoXU Rfb+ken/hMA1KrjDBZSrCWAmxRMBVI94S8HMMDznv1YdnhmO/iaYeEh/v2JDMTb8jLMjFq lzrJuiKZ9iYbV7uUJEx7XKUMimDmp/s= X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dJaHvDIY; spf=pass (imf17.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 1BD934000E X-Stat-Signature: d83eiu8m1tos4xwyh1n9hm3786wb46t5 X-HE-Tag: 1664919691-12300 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: For dropping the hugetlb mountpoint in run_vmtests.sh. Since no parameter is needed, drop USAGE too. Signed-off-by: Peter Xu --- tools/testing/selftests/vm/hugetlb-madvise.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/vm/hugetlb-madvise.c b/tools/testing/selftests/vm/hugetlb-madvise.c index 3c9943131881..f96435b70986 100644 --- a/tools/testing/selftests/vm/hugetlb-madvise.c +++ b/tools/testing/selftests/vm/hugetlb-madvise.c @@ -12,6 +12,7 @@ * directory. */ +#define _GNU_SOURCE #include #include #include @@ -19,7 +20,6 @@ #define __USE_GNU #include -#define USAGE "USAGE: %s \n" #define MIN_FREE_PAGES 20 #define NR_HUGE_PAGES 10 /* common number of pages to map/allocate */ @@ -103,11 +103,6 @@ int main(int argc, char **argv) int fd; int ret; - if (argc != 2) { - printf(USAGE, argv[0]); - exit(1); - } - huge_page_size = default_huge_page_size(); if (!huge_page_size) { printf("Unable to determine huge page size, exiting!\n"); @@ -125,9 +120,9 @@ int main(int argc, char **argv) exit(1); } - fd = open(argv[1], O_CREAT | O_RDWR, 0755); + fd = memfd_create(argv[0], MFD_HUGETLB); if (fd < 0) { - perror("Open failed"); + perror("memfd_create() failed"); exit(1); } @@ -406,6 +401,5 @@ int main(int argc, char **argv) (void)munmap(addr2, NR_HUGE_PAGES * huge_page_size); close(fd); - unlink(argv[1]); return 0; } From patchwork Tue Oct 4 21:43:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12998724 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 C2FFAC433FE for ; Tue, 4 Oct 2022 21:43:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 595776B0071; Tue, 4 Oct 2022 17:43:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5451F6B0073; Tue, 4 Oct 2022 17:43:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E6046B0074; Tue, 4 Oct 2022 17:43:08 -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 2C5B06B0071 for ; Tue, 4 Oct 2022 17:43:08 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0374A1602D5 for ; Tue, 4 Oct 2022 21:43:07 +0000 (UTC) X-FDA: 79984592856.08.C0AD130 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf21.hostedemail.com (Postfix) with ESMTP id A83F51C000E for ; Tue, 4 Oct 2022 21:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664919787; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iDP4uYCeHzqEOaCGXbcAwOcK1rZC2BBuQ6aTX5fgU3w=; b=cM7qRnpkZjQEY+Ujh9rGEuA89d+cTGs8Wg553RYc2JgYt2n6Ho9oaaph8I/589smYnJodG uVbaE9milM70QaDpc/de1JKEwc223QKnr+/SHNmJJhQ0wR+ANFjSjkb5j+HBwmKkvQivKj OiJWkRkEHcNP/J7ETkXicx8EQBmya1s= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-600-rZkJRcUXMjCO7jhLx3k9Xg-1; Tue, 04 Oct 2022 17:43:06 -0400 X-MC-Unique: rZkJRcUXMjCO7jhLx3k9Xg-1 Received: by mail-qk1-f197.google.com with SMTP id ay35-20020a05620a17a300b006cfc01b4436so12814605qkb.13 for ; Tue, 04 Oct 2022 14:43:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=iDP4uYCeHzqEOaCGXbcAwOcK1rZC2BBuQ6aTX5fgU3w=; b=6eMMEvE9Kje2PRK74xvtJ1TyAZJD4uaxhaxqGL2m2F5YLyiZuYzBV5Mx6fS96ePakH vDxIqilIcTQKMlsVvTtW3gCstE1sxI8El8pFpLzOCRa9L+ZeuiWDZYptyVR2R9mPq9UB MABSFd5BS84e7EyI4Gxr96wA0okW1tiqYjHd+4loBYIjYGs9Th0cDUMRuIznQmDp0Uay hhsMHA4Mh7zOeat8LYtiDvK41z469Me97H3QX2jctHeDpe7TQaIxxcAoODl83q/04LPQ PjyQVFPugkSPVnFs1/eHJBX6mjjKAZnHMGMesgGSJG5nvS0N3CFdgNzoCuIckBWw0SgK HsVA== X-Gm-Message-State: ACrzQf1vDr02cNE2TkB5dhcHw6upB7rqq1F9gr2zhcRr/Ekel9yHHj2E 8NLPv9I7hfDr8kAiHX7crX1eCGpXaiGEdMrB+RQhWi+lLceIj/XfZcjaS5Hz+XtyKylz4AJTEfR X6tBIGnvhzS4= X-Received: by 2002:a37:4553:0:b0:6cf:4dbd:b5f6 with SMTP id s80-20020a374553000000b006cf4dbdb5f6mr18472728qka.339.1664919785784; Tue, 04 Oct 2022 14:43:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM77JL7JEmps8VFSIv2pFu3zdKv9SaLpBJ+ezlOLM+yMue29M9e7KeiI1bvH4JScBSCCgMYdkQ== X-Received: by 2002:a37:4553:0:b0:6cf:4dbd:b5f6 with SMTP id s80-20020a374553000000b006cf4dbdb5f6mr18472717qka.339.1664919785571; Tue, 04 Oct 2022 14:43:05 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id a5-20020ac85b85000000b0035ba7012724sm13297803qta.70.2022.10.04.14.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 14:43:05 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: peterx@redhat.com, Axel Rasmussen , Mike Kravetz , Andrew Morton Subject: [PATCH 3/4] selftests/vm: Use memfd for hugepage-mremap test Date: Tue, 4 Oct 2022 17:43:03 -0400 Message-Id: <20221004214303.121394-1-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221004214125.120993-1-peterx@redhat.com> References: <20221004214125.120993-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664919787; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=iDP4uYCeHzqEOaCGXbcAwOcK1rZC2BBuQ6aTX5fgU3w=; b=BNijvuLbOzOWlFBOWQ4+v349JxqS3Lt0p/DeBZRCVH6d6amO4jp/4F3TKy2DO9Hyz/x5HZ Pe3WmkPz2t72NQuNCsWxVRZetk8J9fOiGqIxPkp8K4pWDG7O+qfSTBQNfi7EDXltjDFi9f 6+E1/lKHhcz0PzgQAZkVXzYL8X+bYfo= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cM7qRnpk; spf=pass (imf21.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664919787; a=rsa-sha256; cv=none; b=F9N4khXHZivcgEAfDA1eEoZzQSD7Hxx+0yYXR3YRmuzleaaJgEKjr1becSP1MXUdLmds2r qk3/q/E30njV6GmLD0BJo/vH4sah1YAUg8ZosEdxIJG+zEWKFs63ge1bpvARPxOypmmkFr jV2Oq8ioG/ha0OJublTmHZPQQwaa0X4= X-Rspamd-Queue-Id: A83F51C000E Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cM7qRnpk; spf=pass (imf21.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: nwtyfosqj5zr6zmqyf6c8dn51wi6kqu7 X-HE-Tag: 1664919787-196106 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: For dropping the hugetlb mountpoint in run_vmtests.sh. Cleaned it up a little bit around the changed codes. Signed-off-by: Peter Xu --- tools/testing/selftests/vm/hugepage-mremap.c | 21 +++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/vm/hugepage-mremap.c b/tools/testing/selftests/vm/hugepage-mremap.c index e63a0214f639..e53b5eaa8fce 100644 --- a/tools/testing/selftests/vm/hugepage-mremap.c +++ b/tools/testing/selftests/vm/hugepage-mremap.c @@ -22,6 +22,7 @@ #include /* Definition of SYS_* constants */ #include #include +#include #define DEFAULT_LENGTH_MB 10UL #define MB_TO_BYTES(x) (x * 1024 * 1024) @@ -108,26 +109,23 @@ static void register_region_with_uffd(char *addr, size_t len) int main(int argc, char *argv[]) { size_t length = 0; + int ret = 0, fd; - if (argc != 2 && argc != 3) { - printf("Usage: %s [length_in_MB] \n", argv[0]); + if (argc >= 2 && !strcmp(argv[1], "-h")) { + printf("Usage: %s [length_in_MB]\n", argv[0]); exit(1); } /* Read memory length as the first arg if valid, otherwise fallback to * the default length. */ - if (argc == 3) - length = argc > 2 ? (size_t)atoi(argv[1]) : 0UL; + if (argc >= 2) + length = (size_t)atoi(argv[1]); + else + length = DEFAULT_LENGTH_MB; - length = length > 0 ? length : DEFAULT_LENGTH_MB; length = MB_TO_BYTES(length); - - int ret = 0; - - /* last arg is the hugetlb file name */ - int fd = open(argv[argc-1], O_CREAT | O_RDWR, 0755); - + fd = memfd_create(argv[0], MFD_HUGETLB); if (fd < 0) { perror("Open failed"); exit(1); @@ -185,7 +183,6 @@ int main(int argc, char *argv[]) } close(fd); - unlink(argv[argc-1]); return ret; } From patchwork Tue Oct 4 21:43:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12998725 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 B9E07C433F5 for ; Tue, 4 Oct 2022 21:43:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F8F76B0073; Tue, 4 Oct 2022 17:43:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A97A6B0074; Tue, 4 Oct 2022 17:43:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34A6B6B0075; Tue, 4 Oct 2022 17:43:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 22CAB6B0073 for ; Tue, 4 Oct 2022 17:43:10 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E4B491C664C for ; Tue, 4 Oct 2022 21:43:09 +0000 (UTC) X-FDA: 79984592898.22.B4BFE4E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 8D8A31C0026 for ; Tue, 4 Oct 2022 21:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664919789; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1leZa+nnl9FNTENOcXSgCnyxuJRrfcW3iiJbWx0HuuA=; b=C121Aoo8tsktwYue02bnSXh2o66cdYdXUND6CF5Iq+5IkMsTW7HPqBHTTedivbIAFk0kxB PDshUsJM5FE1Js3s0Y+/vxnc3QbGjhn9sY3VWgvtrOBj2tTqzWVBbD5opTorhVRmx9Hk28 UfNhPWCBRxyu7rsCLWSipffz/S4NWf8= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-597-xpOCxh7fMZitvPStXs7ENw-1; Tue, 04 Oct 2022 17:43:08 -0400 X-MC-Unique: xpOCxh7fMZitvPStXs7ENw-1 Received: by mail-qt1-f197.google.com with SMTP id n16-20020ac85b50000000b0035ce9e26eb1so10090055qtw.8 for ; Tue, 04 Oct 2022 14:43:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=1leZa+nnl9FNTENOcXSgCnyxuJRrfcW3iiJbWx0HuuA=; b=vYdxFM29oi1DPSuUALIwMljJIMBOYGWAdKWGa+XC6eFbUsKLLmuIkOSq2hceD3S6aK hNH/OZpKnYpgtMCE7dzHFe88ETY+RIYb9zn93IrL0xHYPNm7BcHKhcPH3Y6KTnv1+HW4 RWNImkB4xUdfsFssQUFPPVO+lEguKrYW9OVviLBh1EajFeqKifLAs8Mp070JVvYolbq0 F+FMh4wRSfyQBT5cv4MC3KT0uwxlnlRF+AaJG95BrOGKZBuK0FVFNMggjCQznlcUCiXs IaPu8Avww8OR74xfmt10Jrt5mgbgYDM9Aa13An4o2vsdqn2jJsPzX5mL1ANaGT3HtzYc aI7Q== X-Gm-Message-State: ACrzQf3TTKw28Esg9+71EWfNjka6n0c8kSswo2QIlvb4+BzCNkHCJp5O fYHomBe/GhEXkhWLKYT5NoHhc0G/2gQtPSNw0VGskTiDus8hmwK44FNQOiflsxVuSS9Usxqmksa Sygbyyzmh3Ks= X-Received: by 2002:a05:622a:1aa8:b0:35c:c831:d601 with SMTP id s40-20020a05622a1aa800b0035cc831d601mr21283891qtc.434.1664919787641; Tue, 04 Oct 2022 14:43:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5/aHhdBDx5/pr6lLga5+ZqFgqfZHwQEpATTsLPquYDFCPYwZ1/spc/bamiVaGZogL3kF2qCQ== X-Received: by 2002:a05:622a:1aa8:b0:35c:c831:d601 with SMTP id s40-20020a05622a1aa800b0035cc831d601mr21283879qtc.434.1664919787439; Tue, 04 Oct 2022 14:43:07 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id l20-20020ac81494000000b0035d27b254f3sm12482275qtj.40.2022.10.04.14.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 14:43:07 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: peterx@redhat.com, Axel Rasmussen , Mike Kravetz , Andrew Morton Subject: [PATCH 4/4] selftests/vm: Drop mnt point for hugetlb in run_vmtests.sh Date: Tue, 4 Oct 2022 17:43:05 -0400 Message-Id: <20221004214305.121405-1-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221004214125.120993-1-peterx@redhat.com> References: <20221004214125.120993-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664919789; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1leZa+nnl9FNTENOcXSgCnyxuJRrfcW3iiJbWx0HuuA=; b=SXBmegNbaWly60GSk8z3CdooiOSTcinH5HmV9kx+t3/tCTWSqq1+MGjvynFCre7iAWEdTq lfOGDSVV3/DM/4uMVeI3SQypgDZgIBaKXsBtWqSpJmnBi4pSndICaUp+tWfWc4EjeMdN0O 27OuAozJuE/WPTVDKsuzsB9G+fYpg6I= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=C121Aoo8; spf=pass (imf20.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664919789; a=rsa-sha256; cv=none; b=V/gJ6KzuVcce1NL3vBwhx/WzdAVJz8a+kooKx+WgsjxnfaNhfx4Lk+MEXYvZW0gkuIOtQT zHqVXI8lbnRUOX/og1kzQ5Iy3/ApxZ3l3yzTMSs+gDi70vLM/9lGhESTbBj2B8g5R6bZE7 50/N0R7PYAhSJT02K3r/zj1IgeHf0cw= Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=C121Aoo8; spf=pass (imf20.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 8D8A31C0026 X-Rspam-User: X-Stat-Signature: qdduq3dtjfk5xb6dh3zcasaz49yon3yp X-HE-Tag: 1664919789-249904 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: After converting all the three relevant testcases (uffd, madvise, mremap) to use memfd, no test will need the hugetlb mount point anymore. Drop the code. Signed-off-by: Peter Xu Reviewed-by: Axel Rasmussen --- tools/testing/selftests/vm/run_vmtests.sh | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/vm/run_vmtests.sh b/tools/testing/selftests/vm/run_vmtests.sh index e780e76c26b8..0dc9f545a32d 100755 --- a/tools/testing/selftests/vm/run_vmtests.sh +++ b/tools/testing/selftests/vm/run_vmtests.sh @@ -5,7 +5,6 @@ # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 -mnt=./huge exitcode=0 #get huge pagesize and freepages from /proc/meminfo @@ -84,9 +83,6 @@ run_test() { fi } -mkdir "$mnt" -mount -t hugetlbfs none "$mnt" - run_test ./hugepage-mmap shmmax=$(cat /proc/sys/kernel/shmmax) @@ -98,14 +94,9 @@ echo "$shmmax" > /proc/sys/kernel/shmmax echo "$shmall" > /proc/sys/kernel/shmall run_test ./map_hugetlb - -run_test ./hugepage-mremap "$mnt"/huge_mremap -rm -f "$mnt"/huge_mremap - +run_test ./hugepage-mremap run_test ./hugepage-vmemmap - -run_test ./hugetlb-madvise "$mnt"/madvise-test -rm -f "$mnt"/madvise-test +run_test ./hugetlb-madvise echo "NOTE: The above hugetlb tests provide minimal coverage. Use" echo " https://github.com/libhugetlbfs/libhugetlbfs.git for" @@ -126,14 +117,11 @@ for mod in "${uffd_mods[@]}"; do # Hugetlb tests require source and destination huge pages. Pass in half # the size ($half_ufd_size_MB), which is used for *each*. run_test ./userfaultfd hugetlb${mod} "$half_ufd_size_MB" 32 - run_test ./userfaultfd hugetlb_shared${mod} "$half_ufd_size_MB" 32 "$mnt"/uffd-test - rm -f "$mnt"/uffd-test + run_test ./userfaultfd hugetlb_shared${mod} "$half_ufd_size_MB" 32 run_test ./userfaultfd shmem${mod} 20 16 done #cleanup -umount "$mnt" -rm -rf "$mnt" echo "$nr_hugepgs" > /proc/sys/vm/nr_hugepages run_test ./compaction_test