From patchwork Wed Aug 17 21:47:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Rasmussen X-Patchwork-Id: 12946525 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 0D853C25B08 for ; Wed, 17 Aug 2022 21:47:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9F3EB8D0007; Wed, 17 Aug 2022 17:47:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A36D8D0002; Wed, 17 Aug 2022 17:47:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86B278D0007; Wed, 17 Aug 2022 17:47:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7932E8D0002 for ; Wed, 17 Aug 2022 17:47:47 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 578C51C6DD4 for ; Wed, 17 Aug 2022 21:47:47 +0000 (UTC) X-FDA: 79810422174.05.82E0DF6 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) by imf04.hostedemail.com (Postfix) with ESMTP id DA64F4019F for ; Wed, 17 Aug 2022 21:47:45 +0000 (UTC) Received: by mail-pg1-f202.google.com with SMTP id l190-20020a6388c7000000b00429eadd0a58so522229pgd.19 for ; Wed, 17 Aug 2022 14:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc; bh=jnCzi2soCjCrdoYyE26okeRANWMjNTuMb/vBG8/63Ug=; b=KZ0P1170IwcAUTv8uQbp9z7pte5r8kbVvoL+qqtlH3QccUqJDgZWrT/GJqfAKRnvAK CzZLov1dutB82SgbWPPzafLbe4YaRt7nlqDWzpwzjvXJ1vIbUcBzRXJWjlaGaSLqYEns FoLMoKN+UHsLMa1XItGd8jNF2ArKMQZhcmw+3Q+Hjpr0JdoQ0gVe+/+Ls57ppTFJ3zEk 9ReRy0BgHOs/xGg2zwKIF/plGC6NvWST4LGC8hdXiPFxmbd0zWTPsdGp73UpgXt7/Jo5 Y7sx0Ehv6+9al+cCFThmxBBXb5blmspH061tjTD7GYZLCKIaVqXu2A93PxXnKLVAnpIi hnyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc; bh=jnCzi2soCjCrdoYyE26okeRANWMjNTuMb/vBG8/63Ug=; b=PYqHQXA90+Ke0UXmYWuhKA54vHKqsF/E5L+73DTXdmlfptHAy5t6h8mfI20xvIJDCQ 9MxyNHY2Hl8iLay+lNW7oOuDF3bFIPdeJvWOcsxO/wew6DMIt2Rh9q9v0UMARA8eXFe4 sv9VtgzWXJ2eAmijWWVTFvvFGnI7tV4vgV4w62llj4B+mn126HWipehG9VpEjGULI9WZ qX6hPGm7hYMdtU1hqR0q/S+5Icft94OIjzOpD2LySWCHCDlrwzVN3o6WlUBt900rHZWZ qKNu7ojS2eNh6Dyx9pw3bLbc5+gzf1e/zA8UKq8vFCw23ptjvtYvcBBTdoFNBgV6JWaP 4RPQ== X-Gm-Message-State: ACgBeo072BHEGWVZSdBPcwjxr9MgiDL9BAMibSSgqrsj0ziZfZmtGX2u 9hDZ8nHOl0rjXikRNhsf2zXVy6F9aJoTFJw5AXDz X-Google-Smtp-Source: AA6agR5jERdtN3diOuEm1pmrj1QHlYiMHvWG8qI727CmuqPey4kLQo+pfMvxcFs9I8HGucRMJxmUfmrjgGwpfsKtL631 X-Received: from ajr0.svl.corp.google.com ([2620:15c:2d4:203:2f41:f176:4bac:b729]) (user=axelrasmussen job=sendgmr) by 2002:a17:90b:1b48:b0:1f4:f4e5:c189 with SMTP id nv8-20020a17090b1b4800b001f4f4e5c189mr5408096pjb.226.1660772864770; Wed, 17 Aug 2022 14:47:44 -0700 (PDT) Date: Wed, 17 Aug 2022 14:47:28 -0700 In-Reply-To: <20220817214728.489904-1-axelrasmussen@google.com> Message-Id: <20220817214728.489904-6-axelrasmussen@google.com> Mime-Version: 1.0 References: <20220817214728.489904-1-axelrasmussen@google.com> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH v6 5/5] selftests: vm: add /dev/userfaultfd test cases to run_vmtests.sh From: Axel Rasmussen To: Alexander Viro , Andrew Morton , Dave Hansen , "Dmitry V . Levin" , Gleb Fotengauer-Malinovskiy , Hugh Dickins , Jan Kara , Jonathan Corbet , Mel Gorman , Mike Kravetz , Mike Rapoport , Nadav Amit , Peter Xu , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , zhangyi Cc: Axel Rasmussen , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, Shuah Khan ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=KZ0P1170; spf=pass (imf04.hostedemail.com: domain of 3AGL9Yg0KCNc3Q7EK3LFNLL7G9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--axelrasmussen.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=3AGL9Yg0KCNc3Q7EK3LFNLL7G9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--axelrasmussen.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660772865; a=rsa-sha256; cv=none; b=nClNSPxE+JJfsQbr30PpvJBnTN3mDoERMpIO5UkQXH+hLMTd7SqMANDTBjQa+7KHb5PNFm ZK1FAvvSZw9hL0dRR/9h2CLjPkO03lW3v8sscLoT/LFejMFSKU9Zjbi/0j2t/eDusffulP yxzY+UJXEsopElPXIUitTS0oa+n7JFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660772865; 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=jnCzi2soCjCrdoYyE26okeRANWMjNTuMb/vBG8/63Ug=; b=JI8h3lCbqEPRY+bzq2lG7gJ62pn14xDydfmqyNYM9SXhzr2Zeb7d0YViRAvFZHRjgwaZFS hNy1Bt8ZywDudXgkZa+jEHkEuj969XMNmOgFEEMBD98TREZ0E6htg1jH+JTH6bzaqSgWNX 9dVCwTVrxr0TZlu1QLB1GPFqOt8BID0= Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=KZ0P1170; spf=pass (imf04.hostedemail.com: domain of 3AGL9Yg0KCNc3Q7EK3LFNLL7G9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--axelrasmussen.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=3AGL9Yg0KCNc3Q7EK3LFNLL7G9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--axelrasmussen.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: o5wwcn8oppf4sqh6a54xhkw399cp5phg X-Rspamd-Queue-Id: DA64F4019F X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1660772865-172109 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: This new mode was recently added to the userfaultfd selftest. We want to exercise both userfaultfd(2) as well as /dev/userfaultfd, so add both test cases to the script. Reviewed-by: Shuah Khan Acked-by: Peter Xu Signed-off-by: Axel Rasmussen --- tools/testing/selftests/vm/run_vmtests.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/vm/run_vmtests.sh b/tools/testing/selftests/vm/run_vmtests.sh index b8e7f6f38d64..e780e76c26b8 100755 --- a/tools/testing/selftests/vm/run_vmtests.sh +++ b/tools/testing/selftests/vm/run_vmtests.sh @@ -120,13 +120,16 @@ run_test ./gup_test -a # Dump pages 0, 19, and 4096, using pin_user_pages: run_test ./gup_test -ct -F 0x1 0 19 0x1000 -run_test ./userfaultfd anon 20 16 -# 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 "$half_ufd_size_MB" 32 -run_test ./userfaultfd hugetlb_shared "$half_ufd_size_MB" 32 "$mnt"/uffd-test -rm -f "$mnt"/uffd-test -run_test ./userfaultfd shmem 20 16 +uffd_mods=("" ":dev") +for mod in "${uffd_mods[@]}"; do + run_test ./userfaultfd anon${mod} 20 16 + # 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 shmem${mod} 20 16 +done #cleanup umount "$mnt"