From patchwork Fri Aug 19 20:52:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Rasmussen X-Patchwork-Id: 12949222 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 E6557C32771 for ; Fri, 19 Aug 2022 20:52:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7FCB38D0003; Fri, 19 Aug 2022 16:52:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7AC058E0002; Fri, 19 Aug 2022 16:52:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 673EC8D0005; Fri, 19 Aug 2022 16:52:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 575C88D0003 for ; Fri, 19 Aug 2022 16:52:23 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 34234AC392 for ; Fri, 19 Aug 2022 20:52:23 +0000 (UTC) X-FDA: 79817540166.31.CB7173A Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf27.hostedemail.com (Postfix) with ESMTP id DFA344000C for ; Fri, 19 Aug 2022 20:52:22 +0000 (UTC) Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-335cf0fd1a4so94353617b3.11 for ; Fri, 19 Aug 2022 13:52:22 -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=dIpcC3duR2F4UdEnpnHe2+B2ki05YIFseJ6XkifI1ovJCzemg2dHLOQR3Hcrc13yAL Lpy72mYkw+OVc8KXup1+UJK4XLguOgG5HwNBjH22RGBbJMIcWlulfNwQfWuP3eCH1lzl b6B/y6zPicu82sY/bgXGd+sZ7zR21n9PVfNhwwMc7sFL1dgEFNdgDl4r6Df+26JDnzoX D/QTc2Uc0q9CmmICpeKvhxd1UkQnOMlXqy1sHiVX7JddGHfDA7XMLC1N6qy4z3fF6Ds0 wKDnL40gO8YfOaMBnPWMebrtf+ROzhZfFnwNXLkDKPFG0O28730Y0sG1orQLamNZ7Y7E ZYzw== 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=Vxs2pK4/9e4lzoL6G5ivMpDKw3TuAtPqt3+jJ+8ghRCcIA5NVKQS8uMht9sz93wwHi A5x3Xk8MpQAZHei4CuH0XKZ3PfI5RkNTWZGpSE043TpOhaVngV66zqbH1xt6vTe2VFuy jMIi+kC4WTAcwu1H77ch0/GR/0h9BG3nMNRXXb8M+fjG/+wmgKuemPkqzWKYTESJ2Nj2 xvIfVLMv9wtRqY+U+873m0ZRN50NuFtGnklr7ddjmJDhhwm/J1Dzowyp8bwV8pswYulK yKUH+CdAkcspwnLiia+UkCU+PkrINKzaVofw2xKAZkxL9nkSBqt/cUaq46AWahNdTG0g SgvQ== X-Gm-Message-State: ACgBeo3Ob0VZ5OiK4P6Sboo288258d6QbbzPKdZAhwidyLjGs/kCFmv1 RZCF467xGpGst3RJ+ydpjFKkveatt73sWQAK5Vcq X-Google-Smtp-Source: AA6agR6tYdLSyLary3+Q5VuCsv3LcSs1JihCOYeNOoWw3HYFbFr1DaLds4QXVaepr+bVaJJ9uL2y6ztcYfkdMgBc8C6B X-Received: from ajr0.svl.corp.google.com ([2620:15c:2d4:203:baf:4c5:18b:2c4b]) (user=axelrasmussen job=sendgmr) by 2002:a81:eb04:0:b0:329:94ef:3e68 with SMTP id n4-20020a81eb04000000b0032994ef3e68mr9476724ywm.309.1660942342250; Fri, 19 Aug 2022 13:52:22 -0700 (PDT) Date: Fri, 19 Aug 2022 13:52:01 -0700 In-Reply-To: <20220819205201.658693-1-axelrasmussen@google.com> Message-Id: <20220819205201.658693-6-axelrasmussen@google.com> Mime-Version: 1.0 References: <20220819205201.658693-1-axelrasmussen@google.com> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH v7 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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660942342; a=rsa-sha256; cv=none; b=6KFUoolrf3NxfSNUiR6u55R2MmUoHhtBN6BfGACnac5FZcbSoz2WyJ/YsbrNImlnDK5/ky R17QVSB/BetWkRDYcNVA4MEKloDacGWf5acGJ0srbGW6hDBrYJVqb+jqmWqCC/SC6jecoe WhGQ7sPY0woz9VINiXDTcm7PMtR0Be8= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=dIpcC3du; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of 3Bvj_Yg0KCBUvIz6CvD7FDDz819916z.x97638FI-775Gvx5.9C1@flex--axelrasmussen.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3Bvj_Yg0KCBUvIz6CvD7FDDz819916z.x97638FI-775Gvx5.9C1@flex--axelrasmussen.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660942342; 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=v8rDJzirWAIAR9fEa2BXw41MoQEyT3kdY2+CvIvT/lYlHnKSNS62dmPjsQjY5I+YNFhK4R EwJ7qD8wr16W1gB9EY63c8MN9UgvJ1zxdppEdERvtGWNoKWJZCVZa9HOtU1iG0kVIASOD7 ymz9pKDAKpQCE2iNYGTwW63/phWFGaI= X-Stat-Signature: onfyuxkunnkx86hirf3eibat7bpqgfah X-Rspamd-Queue-Id: DFA344000C X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=dIpcC3du; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of 3Bvj_Yg0KCBUvIz6CvD7FDDz819916z.x97638FI-775Gvx5.9C1@flex--axelrasmussen.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3Bvj_Yg0KCBUvIz6CvD7FDDz819916z.x97638FI-775Gvx5.9C1@flex--axelrasmussen.bounces.google.com X-Rspamd-Server: rspam11 X-HE-Tag: 1660942342-496922 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"