From patchwork Fri Nov 3 17:33:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 740866 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29793C4332F for ; Fri, 3 Nov 2023 17:34:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229619AbjKCRel (ORCPT ); Fri, 3 Nov 2023 13:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235097AbjKCReT (ORCPT ); Fri, 3 Nov 2023 13:34:19 -0400 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0506136 for ; Fri, 3 Nov 2023 10:34:16 -0700 (PDT) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-9becde9ea7bso682066466b.0 for ; Fri, 03 Nov 2023 10:34:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699032855; x=1699637655; 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=DOsVzD5dPrBo4Rj12h5O/1Y3xsH9YzmJIcDBJLguEZw=; b=At7TUG4GDiBCzDdHUY3TMoJmAVUUyA14S3tpKm+qBs92p7Fp59iG/QFTnpTKUwDeLo 3I8Y6c2oGug/KbjNXsoq6JoKP8AnJodfuzioUutSU0oZSULntJzxxkSgQQKnmy0EJjV4 TwgHl4DK5FWOb8BevOzv4R9Uq4JrqBMs7vZXx4ILO8qSchWkDvmsPBGpT46G9fLF3YGm DmflNcDOB2MQGcJomYKmXgh942ojsDdIP/zHdCbLy8iWwHNzX5zIPG4lx8mSJLkgXpeg MfYKDLH/RwZ1u7ssB+LO3unvfa2rhk7FPIE4BRcCDJ+uGGwHwBnHrtcFAqfDlWCjmsRV poXQ== X-Gm-Message-State: AOJu0YwEl23cqE2yNdqHAEcWvwnv91vWZcQCQQhqqGjA4s8oNEKFU0sF vvyvVIjgBzyYbR7ocGYuFXKNLZET1/E= X-Google-Smtp-Source: AGHT+IHHPkQYqzAEsDCwOratzEap8eorWUATEJ6RjhGLcAazrn0o4umOSPCMJdDGBclfNs4nJoaWaw== X-Received: by 2002:a17:907:8690:b0:9b2:b15b:383d with SMTP id qa16-20020a170907869000b009b2b15b383dmr3593576ejc.11.1699032854978; Fri, 03 Nov 2023 10:34:14 -0700 (PDT) Received: from localhost (fwdproxy-cln-018.fbsv.net. [2a03:2880:31ff:12::face:b00c]) by smtp.gmail.com with ESMTPSA id w8-20020a1709067c8800b009dbe08bc793sm1137288ejo.18.2023.11.03.10.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 10:34:14 -0700 (PDT) From: Breno Leitao To: ryan.roberts@arm.com, akpm@linux-foundation.org, linux-kselftest@vger.kernel.org Cc: linux-mm@kvack.org Subject: [PATCH 1/2] selftests/mm: restore number of hugepages Date: Fri, 3 Nov 2023 10:33:59 -0700 Message-Id: <20231103173400.1608403-1-leitao@debian.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The test mm `hugetlb_fault_after_madv` selftest needs one and only one huge page to run, thus it sets `/proc/sys/vm/nr_hugepages` to 1. The problem is that further tests require the previous number of hugepages allocated in order to succeed. Save the number of huge pages before changing it, and restore it once the test finishes, so, further tests could run successfully. Fixes: 116d57303a05 ("selftests/mm: add a new test for madv and hugetlb") Reported-by: Ryan Roberts Closes: https://lore.kernel.org/all/662df57e-47f1-4c15-9b84-f2f2d587fc5c@arm.com/ Signed-off-by: Breno Leitao --- tools/testing/selftests/mm/run_vmtests.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index cc16f6ca8533..00757445278e 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -223,9 +223,12 @@ CATEGORY="hugetlb" run_test ./hugepage-mremap CATEGORY="hugetlb" run_test ./hugepage-vmemmap CATEGORY="hugetlb" run_test ./hugetlb-madvise +nr_hugepages_tmp=$(cat /proc/sys/vm/nr_hugepages) # For this test, we need one and just one huge page echo 1 > /proc/sys/vm/nr_hugepages CATEGORY="hugetlb" run_test ./hugetlb_fault_after_madv +# Restore the previous number of huge pages, since further tests rely on it +echo "$nr_hugepages_tmp" > /proc/sys/vm/nr_hugepages if test_selected "hugetlb"; then echo "NOTE: These hugetlb tests provide minimal coverage. Use" From patchwork Fri Nov 3 17:34:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 740982 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69FE7C4167B for ; Fri, 3 Nov 2023 17:34:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229600AbjKCRem (ORCPT ); Fri, 3 Nov 2023 13:34:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235155AbjKCReX (ORCPT ); Fri, 3 Nov 2023 13:34:23 -0400 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E97E9136 for ; Fri, 3 Nov 2023 10:34:20 -0700 (PDT) Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-9d2e6c8b542so343269066b.0 for ; Fri, 03 Nov 2023 10:34:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699032859; x=1699637659; 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=4hFjtTwWiYmJQZ40RLPL4/H8vlzOG8WtCtwjnuFM5zw=; b=grsO/0pjuDmurJPXfS16WGiMj6pj+QefPcK8yq+ABEysrIaQxSfnq/9EV1sNzHalGb GZENLueYjtvWkQUHt2ab6WxEfdQFCX/nClOQN+5UN8sc+PipvBw9tLpB51DXJYAzt/6n vCySHhO0rcwt2xCNUgFbeFJ90qK2JHy3P8QkGaRadAMt6FGGyjsRseQHVOcXhB3YyxqC JKQmcZC9SqpTHY5Z+cTaDIRe/s39EElkPdoArBb7GQAMTbyTmW5wlBdkWKCu2AKNEEEJ XI56I6rFz7/46tKrVoBo4F3cS9mVC02M0cFHrtRHe88Me0kQUP6v2XChUMfUA3T8fY4q Qfmw== X-Gm-Message-State: AOJu0Yw6dQz68LSi8mvoYEzDh9Haokw/xscip91l+wWuHR9o1TI+XVuB IzjeznAg9+6zD9C4SO/ir+A= X-Google-Smtp-Source: AGHT+IFTBhL5MrYj5hSjrY8jTtAlqzE4ZUFyWYa7xs2BYKdLWbFtpGYLZ8CQnfvF98tLv7CEEqWJTA== X-Received: by 2002:a17:907:7291:b0:9c7:fd91:4309 with SMTP id dt17-20020a170907729100b009c7fd914309mr7351813ejc.0.1699032859214; Fri, 03 Nov 2023 10:34:19 -0700 (PDT) Received: from localhost (fwdproxy-cln-006.fbsv.net. [2a03:2880:31ff:6::face:b00c]) by smtp.gmail.com with ESMTPSA id lt10-20020a170906fa8a00b009ce03057c4dsm1127955ejb.2.2023.11.03.10.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 10:34:18 -0700 (PDT) From: Breno Leitao To: ryan.roberts@arm.com, akpm@linux-foundation.org, linux-kselftest@vger.kernel.org Cc: linux-mm@kvack.org Subject: [PATCH 2/2] selftests/mm: Add hugetlb_fault_after_madv to .gitignore Date: Fri, 3 Nov 2023 10:34:00 -0700 Message-Id: <20231103173400.1608403-2-leitao@debian.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231103173400.1608403-1-leitao@debian.org> References: <20231103173400.1608403-1-leitao@debian.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org commit 116d57303a05 ("selftests/mm: add a new test for madv and hugetlb") added a new test case, but, it didn't add the binary name in tools/testing/selftests/mm/.gitignore. Add hugetlb_fault_after_madv to tools/testing/selftests/mm/.gitignore. Fixes: 116d57303a05 ("selftests/mm: add a new test for madv and hugetlb") Reported-by: Ryan Roberts Closes: https://lore.kernel.org/all/662df57e-47f1-4c15-9b84-f2f2d587fc5c@arm.com/ Signed-off-by: Breno Leitao --- tools/testing/selftests/mm/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/mm/.gitignore b/tools/testing/selftests/mm/.gitignore index cc920c79ff1c..4ff10ea61461 100644 --- a/tools/testing/selftests/mm/.gitignore +++ b/tools/testing/selftests/mm/.gitignore @@ -45,3 +45,4 @@ mdwe_test gup_longterm mkdirty va_high_addr_switch +hugetlb_fault_after_madv