From patchwork Wed Apr 12 16:42:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13209346 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 B2C15C77B6F for ; Wed, 12 Apr 2023 16:42:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 52508280005; Wed, 12 Apr 2023 12:42:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D468280001; Wed, 12 Apr 2023 12:42:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 327C5280005; Wed, 12 Apr 2023 12:42:43 -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 2422E280001 for ; Wed, 12 Apr 2023 12:42:43 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E5AAFC01B5 for ; Wed, 12 Apr 2023 16:42:42 +0000 (UTC) X-FDA: 80673307764.22.84ED826 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id D77E51A0028 for ; Wed, 12 Apr 2023 16:42:40 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VCcS3nYD; spf=pass (imf19.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=1681317760; a=rsa-sha256; cv=none; b=o77ugXq2s1kYjy+BNw5d4YZRCTBnQ9ee2dXRru0nl5ZMZkna8oYSWI9HIhhmbp7/vGm/TU 5aQD2aOIlLZy1BW3B9i02GU93szJG173ZVLcV5tx/CVNpjidNRWybvT5j04JkPVieHjndv soOqrzSBZXcEPIp89GrkMggywx6neaY= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VCcS3nYD; spf=pass (imf19.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=1681317760; 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=tI7rcaC4eNMLZ1GEtZTSqdtCm9dCIXlIql8oKSufpVOvbpZ0tOR0UVkC2bhdmjZzrbTw7A rRu2YJTXEhcipkXd/6sXy9DeDUFciGy//rmmzKkJK7JLnfh7lHmMWtpYG+XRuAINcztshO sstZpD9D+AZWXBpIBnfWSEf74epJEAc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681317760; 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=VCcS3nYDR9nmsZgRmzBl+Gwvu4KYnrjHIhGCa9duetgvxpaamht35p/uplnaVNUmjnHN3C qqGiPu7Vw6usS8o7fYKyByZZPdJXCi/AwL6RslR29P6yNhRT+hp9mIf8QCL3W7w0w5pRSe DEFysHBvjC5qOOtnbtZNpI92GENXFW0= 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_256_GCM_SHA384) id us-mta-501-n7c1JeUHMQquATxHDTOZJA-1; Wed, 12 Apr 2023 12:42:39 -0400 X-MC-Unique: n7c1JeUHMQquATxHDTOZJA-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-3e699011c0eso995241cf.0 for ; Wed, 12 Apr 2023 09:42:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681317758; x=1683909758; 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=DPj7+Lk77TDU5OIDH6Km/ToSj1OP24PW5IOiOJKTkqf5lgMkDp1G5QEJWnoFKv1nqh iWUNc1Jojqcbp3T1c1w0bzQ0r9wXsdmZKvPUYByhNebCeysPxEmjEDD7jdgqCcpOqRsh qkuomCAKyLv5p1qZa2lQeDpTxkmFz//lv13sJMjnoWgqClxA0IpUjKg2txgq7O9gKyLf tKncXSqx3vgjnTajlzZMKFlo6duo1o3vI+59xqhvQiDnJYregqCOIaMrS14S/oa8xti0 BPF36f/2mDCCjIvs1/TKFI3DGyVQHEiUbMIlhe+elxr1kC9Qav5HyjE5g1t8EvKM4s1x /xUw== X-Gm-Message-State: AAQBX9fXZBDOcssmCtGTIlsyWVIva4S1/7hvJGGavTI/3ARlD77/wDkr wLnuD4OEaVN4OmlUincmM7nchRrSFdppM3v/dscu8WXgNyH8mkHWYIdnYvHIxvWWMsYNvKN5Hwc 7wqj5X/t2V2o= X-Received: by 2002:a05:622a:1a16:b0:3e6:30c4:656f with SMTP id f22-20020a05622a1a1600b003e630c4656fmr31834191qtb.3.1681317758464; Wed, 12 Apr 2023 09:42:38 -0700 (PDT) X-Google-Smtp-Source: AKy350Y20Rk7NxXI1ENaDroyw/86rbNj0zbsfBVSdikymF4/GfJyJsnmj2oK5V1sNnQfT5FqPQ8k/w== X-Received: by 2002:a05:622a:1a16:b0:3e6:30c4:656f with SMTP id f22-20020a05622a1a1600b003e630c4656fmr31834180qtb.3.1681317758231; Wed, 12 Apr 2023 09:42:38 -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 g26-20020ac8481a000000b003e38c9a2a22sm4334704qtq.92.2023.04.12.09.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 09:42:37 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , Andrea Arcangeli , Mike Kravetz , Nadav Amit , David Hildenbrand , Mike Rapoport , Axel Rasmussen , Leonardo Bras Soares Passos , peterx@redhat.com Subject: [PATCH v2 10/31] selftests/mm: Test UFFDIO_ZEROPAGE only when !hugetlb Date: Wed, 12 Apr 2023 12:42:34 -0400 Message-Id: <20230412164234.328168-1-peterx@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230412163922.327282-1-peterx@redhat.com> References: <20230412163922.327282-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspam-User: X-Rspamd-Queue-Id: D77E51A0028 X-Rspamd-Server: rspam01 X-Stat-Signature: 8w69efidkhwsjdd6soap8cu5jrcgky9j X-HE-Tag: 1681317760-730870 X-HE-Meta: U2FsdGVkX1/yS3b+o7WUapN2yQ1qPgIwWXFZvShHZnL9FsAI6ZpgrZ4ny3nyUrqPyNbHu3PwXx0WVuQyH++95DgrmlvrpgJ2xc3qCALEmVPpshn1N7u+a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+XvWEag8FIk6y84ZFmqy9vnJZ96dkJItiPdt3Ztol0eecuBRcTrw06pb9ofjlqDPtsojh4HBWiwfScKLkrWFxNRd/q4cKFk+yqR2abuJk3IV3IaiM9d5HTk9bJ6MhPZqa84IvraRqs6sTPhaJmhjgT4ZyGkEpX1Oam5Qoq7HzwNrB6ZVkZColitMIcs402VkFDOWOXzVVBWXRZH1fKrBOBfAQ5AdWtPpPoIeMqinZrQ9Jc4GSMtkwru0uE0emAvY2Bx7E11flUOYbXCMpOb/kmAgr3P751ckXslyn+gH5jXUzoMJyVx5ZTliYxkGorVqA0VIIEIPkTvecXO+pc5Pzw/uZa17R0QBxgVQy6mQA== 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: 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 Reviewed-by: Axel Rasmussen --- 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)