From patchwork Thu Mar 30 16:07:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13194492 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 C9FBAC77B60 for ; Thu, 30 Mar 2023 16:07:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B5D976B0087; Thu, 30 Mar 2023 12:07:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B0E02900002; Thu, 30 Mar 2023 12:07:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AF3E6B0089; Thu, 30 Mar 2023 12:07:23 -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 89D676B0087 for ; Thu, 30 Mar 2023 12:07:23 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 17AEE120AD3 for ; Thu, 30 Mar 2023 16:07:23 +0000 (UTC) X-FDA: 80626044366.04.8938B67 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf29.hostedemail.com (Postfix) with ESMTP id DA25712002C for ; Thu, 30 Mar 2023 16:07:20 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UkOXf8Yd; spf=pass (imf29.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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680192441; 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=ASfRfnQJTCdEglytu7DR/J7BYjWDsPlfNboYF8myg6I=; b=Zy+GChEbWohiGl2of8HuLdl3QMtFx0tW84F0nd8LoZofzXVRMsh80ykGQj0cTRL66nkKFa ZbNX1cFrkZkRKkFmep048OlOER0crXCwhA1iuV6NptqDoN0aLhsDvYjlRpwFWFOtBrTgh5 ObfZPUd9NWENQVqDt3SGTWIIPt1PRcw= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UkOXf8Yd; spf=pass (imf29.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=1680192441; a=rsa-sha256; cv=none; b=Prmcfp8sbRcsHzmcaXHSbENLfbBQlSB6SOJJVFqGKydRO6eyHpkaO+TcsRvFmOzFroNnkG O0qB6q58LIFs5pre91XONsUEc+XRi/KuHQEOjSdlMO0ssusS9WhikduVwRdlMHQg0brCMf fifhApio2IkPXPaKIVMPTWuuK2YMgWw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680192440; 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=ASfRfnQJTCdEglytu7DR/J7BYjWDsPlfNboYF8myg6I=; b=UkOXf8YdVdUDd4fsNqq1lIBKq+SUuzddFN5g1ueevJLfliIRJUXju9Hx7tjHqIhLezQq1P pwwlXg003fijOFz0+W41RNlgFhVI3w0EV7EdVt4uAcrkbA4VSv8sslp9SEfeiWg3ukdd1o Z4dRIkFbue7d5q1jjYx2o3bME4MlaQo= 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_256_GCM_SHA384) id us-mta-7-uT6DloeUNriD93q-nyrBmQ-1; Thu, 30 Mar 2023 12:07:19 -0400 X-MC-Unique: uT6DloeUNriD93q-nyrBmQ-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-74678af9349so60311385a.0 for ; Thu, 30 Mar 2023 09:07:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680192437; 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:message-id:reply-to; bh=ASfRfnQJTCdEglytu7DR/J7BYjWDsPlfNboYF8myg6I=; b=Wv9oa7c72Gs9U5rZ/KvtFzmLoxZPYnAmhwMsTsngAGYQR7896M53hgsFHD4fP8TQ4X B8Q/dpWsReuS0i3c2Rrzpo8MDnr1n8u/gvNkMCLX0qPjpVLmDvEMPjQIWaWmEbwQnKEp HZ5YdCdfi67gHl4uexFII/uw2BhB/hZZ9h/sKNuvl9PeMrxPBzuHPilqIlxuDVDdDrS3 klKxuexcDDiM2qn1Lg5M+Rba5kcTmc2R9eMfNBF+XLRD/au5T2DNQaQwyStBAMYutEfH ljXKbu5CdlYapARAjLG3v9syp50n++Ya7tVmbCkMJEE3W/9yd05Cx0BeKu4J5yoUB7iQ YrnQ== X-Gm-Message-State: AAQBX9d7H4g9/zJit7B5MmFONtsZax4EYMGmSXewt8QEKwEV0FWnwAYQ 9Sgg+PlCpGaNRoEB24WJTR3ij3cU3+qfXCauC9AipFBLNaDHARFuSskdhLjm0tPnymfFOwBuTjf bY5blW6iZEGBR7rnSst1l8MgPsit6enmc4Z8Zf+63dVLxwC+aN/FhE7wFt5zUc+yAd+MZ X-Received: by 2002:a05:622a:1802:b0:3e2:4280:bc58 with SMTP id t2-20020a05622a180200b003e24280bc58mr4246305qtc.3.1680192437153; Thu, 30 Mar 2023 09:07:17 -0700 (PDT) X-Google-Smtp-Source: AKy350a/m9csPZTjry35+9guJnM30T3PDQjzdsPf9pXQljVsY4zoOcdyzpO3PTr9qXcknHqkrIxBoQ== X-Received: by 2002:a05:622a:1802:b0:3e2:4280:bc58 with SMTP id t2-20020a05622a180200b003e24280bc58mr4246240qtc.3.1680192436773; Thu, 30 Mar 2023 09:07:16 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-40-70-52-229-124.dsl.bell.ca. [70.52.229.124]) by smtp.gmail.com with ESMTPSA id s80-20020a37a953000000b00741a984943fsm11749352qke.40.2023.03.30.09.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 09:07:15 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: David Hildenbrand , Andrew Morton , Andrea Arcangeli , peterx@redhat.com, Axel Rasmussen , Mike Kravetz , Leonardo Bras Soares Passos , Mike Rapoport , Nadav Amit Subject: [PATCH 10/29] selftests/mm: Test UFFDIO_ZEROPAGE only when !hugetlb Date: Thu, 30 Mar 2023 12:07:14 -0400 Message-Id: <20230330160714.3106999-1-peterx@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230330155707.3106228-1-peterx@redhat.com> References: <20230330155707.3106228-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Queue-Id: DA25712002C X-Stat-Signature: 475yj1mdefftcqidrptf3tx1nuoti31s X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1680192440-674893 X-HE-Meta: U2FsdGVkX18tk8tFPgLQ5EAskd4MsqFtksvSzJG7MNRj9kdGAsT6BIgyZMUOgjbCFmU+JTF75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uHWAiDxwXz9D0TLM+zCj57FuY5+IjFmxzXtKDay6fSc79WxIXQuTgjrf9U+GQ3BrZIltLfHYR42LrdT17W8qqYYIvsLel6qJplgy9Ijag2HqZfbxXWndgwO+M7kuuCikPTlgq6O1dJ5AIpQeNiJ2xeGlOGbKgYQqM7SGo1lHHpQoAWE2aC1Z28oMePy4gFUkyY0xykpP4V6pzT4p21YsL/QPXWghswvJH+BSmBl5CjpneR84ZiJDexRSoHieAbvAbfRHMUsZlNFr8rD5QXqgYfeFRsHSNoZ227NLcvMxy7cZayWgNJZmmFf7oj/KufdnuQeXzoAOAARr3OqPkjNO/iz/gB/iZ+Bt7QORekq/XaDt55MylWpPCfdvpUUYw2Hg/6Kr7Y6aJzAh8w8Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Make the check as simple as "test_type == TEST_HUGETLB" because that's the only mem that doesn't support ZEROPAGE. Signed-off-by: Peter Xu --- tools/testing/selftests/mm/userfaultfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/userfaultfd.c b/tools/testing/selftests/mm/userfaultfd.c index 795fbc4d84f8..d724f1c78847 100644 --- a/tools/testing/selftests/mm/userfaultfd.c +++ b/tools/testing/selftests/mm/userfaultfd.c @@ -1118,7 +1118,7 @@ static int __uffdio_zeropage(int ufd, unsigned long offset, bool retry) { struct uffdio_zeropage uffdio_zeropage; int ret; - bool has_zeropage = get_expected_ioctls(0) & (1 << _UFFDIO_ZEROPAGE); + bool has_zeropage = !(test_type == TEST_HUGETLB); __s64 res; if (offset >= nr_pages * page_size)