From patchwork Wed Apr 3 20:03:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13616622 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 D7E81CD1288 for ; Wed, 3 Apr 2024 20:03:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EAB536B0085; Wed, 3 Apr 2024 16:03:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5AEE6B0088; Wed, 3 Apr 2024 16:03:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D21C86B0089; Wed, 3 Apr 2024 16:03:32 -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 B48346B0085 for ; Wed, 3 Apr 2024 16:03:32 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 350891201D0 for ; Wed, 3 Apr 2024 20:03:32 +0000 (UTC) X-FDA: 81969295464.11.743FA41 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 2089340014 for ; Wed, 3 Apr 2024 20:03:29 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YFe16jBX; spf=pass (imf17.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=1712174610; a=rsa-sha256; cv=none; b=8fjHXAumzNXX4RVUodOxTxURgknmHx6blaGZC558PMphoHgrpKLMTYYOjMUwQmb/OhtQpi 6jtG1J4psgUZsphGDIDVHZDpBXVoAZ2PArLL2HzcjFUQNySsN+YxRNpAOxg7nVfRNHJo1g sPa5XqrkLH5/Kro3pFza0tkE8vKtAXw= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YFe16jBX; spf=pass (imf17.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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712174610; 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: references:dkim-signature; bh=NQHNmovAOx9ZSifvDIgA24zi3CQm15Ag6TxzIliiHo0=; b=R1gB75kMuYVdOn6HDnB3v89pU7KTtn4NIN5zjftKeAv9qHC8J5I26RnVPpRiezbmWKmW5a gCgbibZAFc+17uF9CWOfoaxlCTk5WsODER8wfS7du6yoNe924vUD2OuuQFoY9iW+LGCZxz PyFXJjyubSkEJqvygaaHfrf+1+XQ2Ic= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712174609; 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; bh=NQHNmovAOx9ZSifvDIgA24zi3CQm15Ag6TxzIliiHo0=; b=YFe16jBXJmc7E86wiyrwMYChESRMgH+PW+bCWNC12ji/T8Fx334QnyZ4Y0Sz7Cri1Un+p9 lyzzSiH0R29YnGB2ic+y5LuCEH+M+bnxLP9/A0kKN2jOR9RFkmC9tN5It/vjsw+7cfHEFV 2f7RfhWOVjdg+1NRRqQLTgSaAjLCiZw= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-TMBtOgFROb2NRKqi19EYdA-1; Wed, 03 Apr 2024 16:03:28 -0400 X-MC-Unique: TMBtOgFROb2NRKqi19EYdA-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-78d3a5c3935so3491185a.1 for ; Wed, 03 Apr 2024 13:03:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712174607; x=1712779407; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NQHNmovAOx9ZSifvDIgA24zi3CQm15Ag6TxzIliiHo0=; b=aisNvZp1rh+nPfDS3dqJBzi4FvBTH2+Ll8ZeLSAt6hvvERY7/M3h/c5q//TcZ5HQ16 QaHplxpyzfuTKFQY+Fm0Bnd971jTSv/zui62oAgbzz7+FmKi25m9sp8Lucv+NmluG3Y1 o3VuxwETRHxPVkFC7LzxY+VCM/bzohbU4sNmkm5f6wmmBOt+WTNB0/2ZaH2OoD50Jjhi 2JXLAjK5n/HY+xUTFeuQbLWw1mxzEioIGNltPB+zfBuoir5KIsE8Z9w6wKSZIIJyXS09 5Td6iMzrEMKzg8VfyPaueJXRPWGFSyPPjS1LQKuiYe8wP2vsUs1DcUNpw8WPty5JjVFb 2ibg== X-Gm-Message-State: AOJu0YxtmnFbT9aWcnwjbUzdhnrdFHRfuWQ3e3RLkCYN8wifENabaeM2 eWAern21Ual6F9p7AdTZN4FMmLin9el/b4pzhi6uqn+PlN06P9K5a2bZ8T+4LGWwfAc6UZoTfyE iceVnpIOteldn2w01PqRo3yGJeNNVcQTdHDp6jUz4Uc7dSGfcx6koamkxPZpmk7vchhLhiuHOBY fqY7zZJaGGHofekjPwUugpz5heMAxkHg== X-Received: by 2002:a05:620a:1087:b0:78c:858b:e30a with SMTP id g7-20020a05620a108700b0078c858be30amr381082qkk.6.1712174607119; Wed, 03 Apr 2024 13:03:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsfkSVeNk/2mrnWcz86/GjcnNn671LJqtU7F+xI8QdLvlfJaXwTro1Uwml2W0IVKJBGait+Q== X-Received: by 2002:a05:620a:1087:b0:78c:858b:e30a with SMTP id g7-20020a05620a108700b0078c858be30amr381044qkk.6.1712174606450; Wed, 03 Apr 2024 13:03:26 -0700 (PDT) Received: from x1n.redhat.com ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id u14-20020a05620a084e00b0078a48172335sm5329727qku.24.2024.04.03.13.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 13:03:26 -0700 (PDT) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , peterx@redhat.com, Muhammad Usama Anjum , David Hildenbrand , Muchun Song , Ryan Roberts Subject: [PATCH] fixup! selftests/mm: run_vmtests.sh: fix hugetlb mem size calculation Date: Wed, 3 Apr 2024 16:03:24 -0400 Message-ID: <20240403200324.1603493-1-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2089340014 X-Stat-Signature: ia1g79bnwc9j6ydwtufteyh9gxrgdt6s X-Rspam-User: X-HE-Tag: 1712174609-225902 X-HE-Meta: U2FsdGVkX19Gl0yjRFqyPvyvVjeqph9MQ3tfvzQ9yPzUgMRyzjzyILjk6glxOFateITnGnvz0L/OdEx6JwSnKZFnIwQQV5ZSNQb8Wb5o6KOhJIeFg01D0CUVtqMFo7cG4mXHeW8YNUAUvqTa7ry4FLTyUMX7MS+nkhGYN2Hr9CaiN9HGfaFE1ozC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As6fkaQqPngrfE9rWNHfSEI5NoaLOyBFiRoyrwfl0cwPEm4VBrL+X+v7G6WDQ1ZGWJjFGl1LIwihZbwZPlgBckDtSRoMSDbvu4GvTkCy/LMo3GvvSF8z6qLC7kWaIVNQnREtFUHEZDRb/IDk5TqSSr6uAGLUTZ8sCCTQc1aAJhM1pjdNwzoC0ybhvcjQLCKCrJQsHDgl2QNRDy5KURAtb2+3AgLJ0NArZEzeqmuMU4B7Q3B5r751fv7fQijEO234y7LFVX2XlbG8U+o7hyhyHIrtBlD8iOPhqQq+C9l2+R14kNTEjXoulh5Qmf8Ql7WoKy8pf7wiGoQCqUjEDXxcM4hJ8tImOulU6EM6XuuqwLbrKdP0HHKS4hX2lykGu/vOlXrfVa5dBA== 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: List-Subscribe: List-Unsubscribe: From: Peter Xu Fix up a breakage on uffd hugetlb test due to removal of a temp variable, as reported by Ryan [1]. Instead of using the previous calculation, use the largest we can have (which is put in freepgs) and cut it into half for userfault tests. [1] https://lore.kernel.org/r/1c20b717-c5b5-4bdf-8fcd-d46db135b7fa@arm.com Cc: Muhammad Usama Anjum Cc: David Hildenbrand Cc: Muchun Song Reported-by: Ryan Roberts Signed-off-by: Peter Xu Tested-by: Ryan Roberts --- tools/testing/selftests/mm/run_vmtests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index b1b78e45d613..223c2304f885 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -298,7 +298,8 @@ CATEGORY="userfaultfd" run_test ./uffd-unit-tests uffd_stress_bin=./uffd-stress CATEGORY="userfaultfd" run_test ${uffd_stress_bin} 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*. +# the size of the free pages we have, which is used for *each*. +half_ufd_size_MB=$((freepgs / 2)) CATEGORY="userfaultfd" run_test ${uffd_stress_bin} hugetlb "$half_ufd_size_MB" 32 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} hugetlb-private "$half_ufd_size_MB" 32 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} shmem 20 16