From patchwork Sat May 21 08:38:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: patrick wang X-Patchwork-Id: 12857741 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 3D423C433F5 for ; Sat, 21 May 2022 08:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349005AbiEUIiv (ORCPT ); Sat, 21 May 2022 04:38:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347413AbiEUIiu (ORCPT ); Sat, 21 May 2022 04:38:50 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCC92FD35B; Sat, 21 May 2022 01:38:49 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id n10so9850656pjh.5; Sat, 21 May 2022 01:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JifwYnD6JO0kOV61Ln5I93dJxrKHSoYK3bTtvWqPo9s=; b=IfwIadc/gfqz1l+D/XvQVz8sUI7LNyNig02LUX7Nx3A5oAwQEGtseWjwXl8Lz1UMom DTSx8BK/FYzL8VGeFiFiJp/YiaZNGzpBy6lReK2S1DachCgSJzGAw1hwdGWWUGpzK8gX gs2FaVMwoY2TjWX2YHomgmB4VSXIQ2b4SzbtumQcnPciIz6JA0pFaMpmC86Fefus8faX hJz0NTz7bIKCh4J6W78D2WGm4v4udFFEcuvGer39liOUHFAzIbmA2gWPiEOCiiAxVZ/Z wW9RrNse4ZjNDu91f9YmBg5Fb3uyXhFTDCD7kAdV85aaN2a2R+ektUEQbV91ekKCkYUy +8Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JifwYnD6JO0kOV61Ln5I93dJxrKHSoYK3bTtvWqPo9s=; b=lXULzuq5Lzc7n9Qow9H9bk1Sgkj4no4k/7OaDcWT9sJdCbzOsBCPOPpXBrhe3jwAev +P7mp1PvgeS4YmiOp+S0xbl/QRte9xHsUjIgbs3DL3evkkdCRs7uYm7BvH4qez5ALzdR 1K8lQ+W2VmmA0g5hSqRahtZsPCIfCNcJi2xnN3tDoPsXDTkCtMPIc5+M4OE6rv+4vDmo fKM10SmKBKW9ZSq9RP81y4ZeSjo1vgK32pz2N1QiG2uL899NJkDM9546/iF0v3wHgazr r3IWZSl1t21WMOAE8ZWqY2Z9UeJUaEQj8i5+qI22QlePpibPimO4/3EVprxne4W1OgR/ ldKA== X-Gm-Message-State: AOAM533fBCDqtmFQzFrbchkR25jKZ8RMQL6NLlFye+tiKUHwsyfbq2/M YMOnHLB6ZZM/KJAxk/Z/nnekDiOHOeyNZg== X-Google-Smtp-Source: ABdhPJyHSwmxq/BUcPtiGeaOIa9ApUD2tKNORjgg1PkOAZaXH5D5ZoCezl2qk2NGuxpmDgjR8LruuQ== X-Received: by 2002:a17:90a:4615:b0:1df:40e6:6474 with SMTP id w21-20020a17090a461500b001df40e66474mr15500678pjg.194.1653122329370; Sat, 21 May 2022 01:38:49 -0700 (PDT) Received: from localhost ([101.86.206.159]) by smtp.gmail.com with ESMTPSA id f7-20020a6547c7000000b003db8691008esm1022381pgs.12.2022.05.21.01.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 May 2022 01:38:49 -0700 (PDT) From: Patrick Wang To: akpm@linux-foundation.org, shuah@kernel.org Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, patrick.wang.shcn@gmail.com Subject: [PATCH 1/3] selftests: vm: check numa_available() before operating "merge_across_nodes" in ksm_tests Date: Sat, 21 May 2022 16:38:23 +0800 Message-Id: <20220521083825.319654-2-patrick.wang.shcn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220521083825.319654-1-patrick.wang.shcn@gmail.com> References: <20220521083825.319654-1-patrick.wang.shcn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Currently, ksm_tests operates "merge_across_nodes" with NUMA either enabled or disabled. In a system with NUMA disabled, these operations will fail and output a misleading report given "merge_across_nodes" does not exist in sysfs: ---------------------------- running ./ksm_tests -M -p 10 ---------------------------- f /sys/kernel/mm/ksm/merge_across_nodes fopen: No such file or directory Cannot save default tunables [FAIL] ---------------------- So check numa_available() before those operations to skip them if NUMA is disabled. Signed-off-by: Patrick Wang --- tools/testing/selftests/vm/ksm_tests.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/vm/ksm_tests.c b/tools/testing/selftests/vm/ksm_tests.c index fd85f15869d1..2fcf24312da8 100644 --- a/tools/testing/selftests/vm/ksm_tests.c +++ b/tools/testing/selftests/vm/ksm_tests.c @@ -221,7 +221,8 @@ static bool assert_ksm_pages_count(long dupl_page_count) static int ksm_save_def(struct ksm_sysfs *ksm_sysfs) { if (ksm_read_sysfs(KSM_FP("max_page_sharing"), &ksm_sysfs->max_page_sharing) || - ksm_read_sysfs(KSM_FP("merge_across_nodes"), &ksm_sysfs->merge_across_nodes) || + numa_available() ? 0 : + ksm_read_sysfs(KSM_FP("merge_across_nodes"), &ksm_sysfs->merge_across_nodes) || ksm_read_sysfs(KSM_FP("sleep_millisecs"), &ksm_sysfs->sleep_millisecs) || ksm_read_sysfs(KSM_FP("pages_to_scan"), &ksm_sysfs->pages_to_scan) || ksm_read_sysfs(KSM_FP("run"), &ksm_sysfs->run) || @@ -236,7 +237,8 @@ static int ksm_save_def(struct ksm_sysfs *ksm_sysfs) static int ksm_restore(struct ksm_sysfs *ksm_sysfs) { if (ksm_write_sysfs(KSM_FP("max_page_sharing"), ksm_sysfs->max_page_sharing) || - ksm_write_sysfs(KSM_FP("merge_across_nodes"), ksm_sysfs->merge_across_nodes) || + numa_available() ? 0 : + ksm_write_sysfs(KSM_FP("merge_across_nodes"), ksm_sysfs->merge_across_nodes) || ksm_write_sysfs(KSM_FP("pages_to_scan"), ksm_sysfs->pages_to_scan) || ksm_write_sysfs(KSM_FP("run"), ksm_sysfs->run) || ksm_write_sysfs(KSM_FP("sleep_millisecs"), ksm_sysfs->sleep_millisecs) || @@ -720,7 +722,8 @@ int main(int argc, char *argv[]) if (ksm_write_sysfs(KSM_FP("run"), 2) || ksm_write_sysfs(KSM_FP("sleep_millisecs"), 0) || - ksm_write_sysfs(KSM_FP("merge_across_nodes"), 1) || + numa_available() ? 0 : + ksm_write_sysfs(KSM_FP("merge_across_nodes"), 1) || ksm_write_sysfs(KSM_FP("pages_to_scan"), page_count)) return KSFT_FAIL; From patchwork Sat May 21 08:38:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: patrick wang X-Patchwork-Id: 12857742 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 8A149C433EF for ; Sat, 21 May 2022 08:39:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352810AbiEUIi7 (ORCPT ); Sat, 21 May 2022 04:38:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350269AbiEUIiz (ORCPT ); Sat, 21 May 2022 04:38:55 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA34A5BD19; Sat, 21 May 2022 01:38:54 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id c14so9558225pfn.2; Sat, 21 May 2022 01:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7HhP/+Tz7HqPlFeIBm2iprd3q70O4euGT7YcNpr3mWc=; b=hXMeES/xeQKEcJ1ukUWTmAZjW/Yn5h3NdUtnltYTBkiZXKmfFWoC7gAoDy7oVdncMR 29DRdkRNIyU6VWLVP73s28B20gf+P9k2yMe85iZQAQUN223ezp5fz7STGxtQK8zRkJAU 2Dwh2JxeLvAWvUbsOccpTvzHws4oEpsgq87hp++uPDpMNod496bkgX9pWTA/J5TiXZG0 O+BZ1aGqXKhMVhK3lyi4/WTziqlmuC5aqMTju2tEc4x+gQWDOGWEGMm0GnWUHpCv8qOP 6/wQfZ6BPfBJLuA6qTBn1ZtqCwz8vkrZLLZYVU5ewIUP/1CZT6hZl+LsRaVMEJhATP9a wpag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7HhP/+Tz7HqPlFeIBm2iprd3q70O4euGT7YcNpr3mWc=; b=1yZTFS+0uNm6hiqPsPo8nqQAW3ebVHd/gLda+1iCY/WDQyPscChOqDn1+TO/fLqEXE 7T6cMTs2Mp2Pfjo1+VS22lHyBVRGNcEAqi6QVBqXHXYY5eyWEYpctHNoYxvv2e1fhFil Q/NSmtoucPdFeM8PrncHcrEjTnp6wLqJ1rk/WQ/KIgAqkL2SJ4RhQ5AFxPBasZ2JwEWO QIB+QHO5AbTzOBCZdUFla8B/sqbjbzWUsDaxD1pvaiFxaFLLE7f+UAyy94vIBxpY1Exm VFBosI6dcU4Nsd1NeOa57Sf3g4poNa0HYu8Matep1dM8I2VUI5zhnpdjgvcIlQUhyI4h vzYA== X-Gm-Message-State: AOAM533aJ/qBmNFMHOl6RriOUSUjG9q78ZE3nx9aXB3AUtLA1mOblrBM GgyLd+9BgZ9ykJjSSXq9YlWwF5FjgjSUlA== X-Google-Smtp-Source: ABdhPJxmNzwbbOgrYwN/RywNuxBQ+XVH+IqftKjcwTFeAmYDx0XD7ictM0eR1P3h//ybjX72vvr7oQ== X-Received: by 2002:a65:6a15:0:b0:3f6:13ea:1cfb with SMTP id m21-20020a656a15000000b003f613ea1cfbmr12070450pgu.495.1653122334280; Sat, 21 May 2022 01:38:54 -0700 (PDT) Received: from localhost ([101.86.206.159]) by smtp.gmail.com with ESMTPSA id e5-20020a17090ada0500b001d81a30c437sm3104182pjv.50.2022.05.21.01.38.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 May 2022 01:38:53 -0700 (PDT) From: Patrick Wang To: akpm@linux-foundation.org, shuah@kernel.org Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, patrick.wang.shcn@gmail.com Subject: [PATCH 2/3] selftests: vm: add "test_hmm.sh" to TEST_FILES Date: Sat, 21 May 2022 16:38:24 +0800 Message-Id: <20220521083825.319654-3-patrick.wang.shcn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220521083825.319654-1-patrick.wang.shcn@gmail.com> References: <20220521083825.319654-1-patrick.wang.shcn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The "test_hmm.sh" file used by run_vmtests.sh dose not be installed into INSTALL_PATH. Thus run_vmtests.sh can not call it in INSTALL_PATH: --------------------------- running ./test_hmm.sh smoke --------------------------- ./run_vmtests.sh: line 74: ./test_hmm.sh: No such file or directory [FAIL] ----------------------- Add "test_hmm.sh" to TEST_FILES so that it will be installed. Signed-off-by: Patrick Wang --- tools/testing/selftests/vm/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 12897927311e..44f25acfbeca 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -92,6 +92,7 @@ endif TEST_PROGS := run_vmtests.sh TEST_FILES := test_vmalloc.sh +TEST_FILES += test_hmm.sh KSFT_KHDR_INSTALL := 1 include ../lib.mk From patchwork Sat May 21 08:38:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: patrick wang X-Patchwork-Id: 12857743 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 E6671C433FE for ; Sat, 21 May 2022 08:39:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351049AbiEUIjD (ORCPT ); Sat, 21 May 2022 04:39:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352926AbiEUIjB (ORCPT ); Sat, 21 May 2022 04:39:01 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F4A0F7480; Sat, 21 May 2022 01:39:01 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id z7-20020a17090abd8700b001df78c7c209so13327536pjr.1; Sat, 21 May 2022 01:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tKgtsXuVOi1QNn+QUr5+/f8fxa0uMqPOrJbyR3xVqo0=; b=PcvLX+AA42K/25xPIdhOA63RFpR1f19sOBPb+tpMTk/vYfdDylBmA3zvj1V8AfdyJM yH2L6Ycg8fzsqKZYGZy3W1WmmJyUvjUreM2B7YgteISXqtRn33ZkiYs7IAogmCJsZX68 vKn3m2gVPb81kEZi54ovkwYjYA1Dqfoy4GIOi8hlBGkcjvrsp7/djrqCsTMRmeXRV8ib k7DEreDnAjqZiZgG+sgYXs3Z/cbW+JA+85GdcAIIwpbCGbnPg7yE5tG336p8tBl2/4/T AP3S6juCJNIPRar4Ag5g7t1kKZUKUEciK8Lq6ffCOz0WzQm9ErbrYVdjrF2FnKLwhzMv YY+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tKgtsXuVOi1QNn+QUr5+/f8fxa0uMqPOrJbyR3xVqo0=; b=bWJMw33Qck46W5h+MJRgYFxHbwTeoOi0VQlRDZDy6a/rkIiUhfbRsmeZZz4RIrUNiE P2W7qb30OIOuPMOzix7V6n9fVveGT/b1z/Ly5as4VSBi3EDpwKSenaX93s1F0ioy6ymk GmMP3L/H6sQ39QfaM1XO+3E8dzcZkFJzrfkNMlgIQ5EZvoOQy6EX8NtHe7k64hLPhNQn jLJRon+BVsn4fFq5icuWaWWRaalMPHQb5pReFiTYf5SCwyk7S7scuDg7bVJiWhF7i2L8 peBChDg0tPE187xpzfbhudK15iRYSgkye235CnQB9rwvNDgJKqEQOQJwF0WkD705m+uU ZDSA== X-Gm-Message-State: AOAM531vy2n69tV5kPYMWFsCHxxRZJQyutr8Ty4icczIikgmrBnVNNH7 Wr5r/0Ma9czeCldv0nAOmAM= X-Google-Smtp-Source: ABdhPJzW5Zypglg3GnAusYqT8bGachbUQvrGnVuNFpQOSI9vw8LS83RB6jAV5DSZjw2EJNt+HsBD2Q== X-Received: by 2002:a17:90a:ec01:b0:1df:56aa:6b7b with SMTP id l1-20020a17090aec0100b001df56aa6b7bmr15213129pjy.230.1653122340763; Sat, 21 May 2022 01:39:00 -0700 (PDT) Received: from localhost ([101.86.206.159]) by smtp.gmail.com with ESMTPSA id j13-20020a170902da8d00b0015e8d4eb260sm1031755plx.170.2022.05.21.01.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 May 2022 01:39:00 -0700 (PDT) From: Patrick Wang To: akpm@linux-foundation.org, shuah@kernel.org Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, patrick.wang.shcn@gmail.com Subject: [PATCH 3/3] selftests: vm: add the "settings" file with timeout variable Date: Sat, 21 May 2022 16:38:25 +0800 Message-Id: <20220521083825.319654-4-patrick.wang.shcn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220521083825.319654-1-patrick.wang.shcn@gmail.com> References: <20220521083825.319654-1-patrick.wang.shcn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The default "timeout" for one kselftest is 45 seconds, while some cases in run_vmtests.sh require more time. This will cause testing timeout like: not ok 4 selftests: vm: run_vmtests.sh # TIMEOUT 45 seconds Therefore, add the "settings" file with timeout variable so users can set the "timeout" value. Signed-off-by: Patrick Wang --- tools/testing/selftests/vm/settings | 1 + 1 file changed, 1 insertion(+) create mode 100644 tools/testing/selftests/vm/settings diff --git a/tools/testing/selftests/vm/settings b/tools/testing/selftests/vm/settings new file mode 100644 index 000000000000..9abfc60e9e6f --- /dev/null +++ b/tools/testing/selftests/vm/settings @@ -0,0 +1 @@ +timeout=45