From mboxrd@z Thu Jan 1 00:00:00 1970 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 CC43FC4332F for ; Fri, 14 Oct 2022 03:24:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62C106B0075; Thu, 13 Oct 2022 23:24:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DA8F6B0078; Thu, 13 Oct 2022 23:24:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 407296B007B; Thu, 13 Oct 2022 23:24:38 -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 2C7806B0075 for ; Thu, 13 Oct 2022 23:24:38 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id EA41140767 for ; Fri, 14 Oct 2022 03:24:37 +0000 (UTC) X-FDA: 80018112594.22.AEF398C Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2075.outbound.protection.outlook.com [40.107.92.75]) by imf03.hostedemail.com (Postfix) with ESMTP id 4704D2001D for ; Fri, 14 Oct 2022 03:24:36 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=awk3dIHqRQeFeljrZY23PfGZ/aPDpxBOrhic9lbhc42MSsTTPDYp2jIdk77OTySFDNVF8kvQZNYMcSEACzYhrPPNyrE6vntlkWO86DgxxtvFigS5GU6glNGmxlQA9wrVNdD/uoV0n3BosUIy9cnAmLP45+/1ZqxYqscahvt0kh7Ic0fvKJjxqL/5vF+FzYPoj4lfM9edBRVtyK1cQJotgymw/D45eLUxlr8KsPuFdGyzdbNiDnTBYUQVuf3eSPbyCn4Rs1EiBQ2SUmZiTt+vFHiF5x660+6EkDWnHW67d3yGPcBMTNm5Gw4TvkW1Tkk83U/mLcHBWO3oX4HQPFXs6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4NnTKHTxn4XcR099d+0pnFulDUANkdqTQvt8kcWf4lE=; b=eLaDXEEykwLpr3/sxwjt1dmOTQqHjCAaTgyD777mJW/OUe7cStb5p3LC4nnvXROqx1nEbwPwElJBDfV83lxYehFV8NB36dY/PrFbtNRl6E8mqm70ARf7iakAjx7ZgFeUkGA6uZA4FX6DlXuUn4jUgPS82jHjp6TB5lnKRvGAKYo5AQOpF4LCENVMISh96Mrnf8ey+CVIz5kSqDEN4d2CmCPK9pt1apinmFyHDbBpmgZr8ay4CIdrw7cPEfW7D7MwPup+Ko+Cpr1H/uyE8JzIxxM5flKlphyDFQaGaht9Edd7wWLywVVTbf4soVDiCSd50ugHUDsxrxupeGJ/ksSXuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4NnTKHTxn4XcR099d+0pnFulDUANkdqTQvt8kcWf4lE=; b=HndbJys3MAryA8fo4ZkP0Fx9rrSW+rDWKOSGOqMD8SGge2GkP/E0Gzm7YnLAX2XgiGcM0pjNGA58gwwICWZyd97JZljqcb5a/hE4dqQmZhJGrmwGwteHFuGUdeAg4gt/dW8Bl0mthtQm9/UpwjDQZ/SApNBHg85+CqCP50NQdjTpsElFlK5Wb82qEWN3cUOh0GCqAHyvBXoJo+uKAtypzMelWvFvNLjY/+t3WrPg48YmNN6kka3xIywljhJVOXV9WhW9K/iVmc22EA25PfNjP/OitdfiWiURFm3nUi9cE7wPEYn+47/m9e4EKYMoCL0MD16M339aI2SpXVxDYI9UEA== Received: from BYAPR12MB3176.namprd12.prod.outlook.com (2603:10b6:a03:134::26) by BY5PR12MB4998.namprd12.prod.outlook.com (2603:10b6:a03:1d4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Fri, 14 Oct 2022 03:24:33 +0000 Received: from BYAPR12MB3176.namprd12.prod.outlook.com ([fe80::4064:6c13:72e5:a936]) by BYAPR12MB3176.namprd12.prod.outlook.com ([fe80::4064:6c13:72e5:a936%5]) with mapi id 15.20.5723.026; Fri, 14 Oct 2022 03:24:33 +0000 References: <26017fe3-5ad7-6946-57db-e5ec48063ceb@suse.cz> <7e2e6679-3205-3540-f522-9eaed2940559@redhat.com> <44fcecda-31a4-7288-1848-63003dfe0a7d@linuxfoundation.org> <04114304-7b35-d42f-0155-087e3b6237c6@suse.cz> <0e02ace6-2fad-47d2-03b9-d8a46f256097@suse.cz> <2d4b8d64-f17f-90ad-7328-b5ca7537d08a@suse.cz> <87fsfrjgq6.fsf@nvidia.com> User-agent: mu4e 1.8.10; emacs 28.2 From: Alistair Popple To: Vlastimil Babka Cc: Shuah Khan , David Hildenbrand , Alex Sierra , Jason Gunthorpe , Ralph Campbell , Felix Kuehling , Christoph Hellwig , Jerome Glisse , "linux-mm@kvack.org" , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan Subject: Re: hmm_test issues with latest mainline Date: Fri, 14 Oct 2022 14:21:57 +1100 In-reply-to: <87fsfrjgq6.fsf@nvidia.com> Message-ID: <87bkqfjdec.fsf@nvidia.com> Content-Type: text/plain X-ClientProxiedBy: SY0PR01CA0016.ausprd01.prod.outlook.com (2603:10c6:10:1bb::19) To BYAPR12MB3176.namprd12.prod.outlook.com (2603:10b6:a03:134::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB3176:EE_|BY5PR12MB4998:EE_ X-MS-Office365-Filtering-Correlation-Id: f02b7887-8a42-42fd-88e3-08daad939cec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dFE5l1i36WSCC2oQSeh8to/HE/B9UcWqcPhAo2JdA2G/q8n7Xp/NKrlj76YJZ2lkZXX4cCgx5MBqzDpwV+CtUdjWbQdY7biFggQ3AP7oPkBjpXv+/DRWseDgdXuziSwQSJwuYzIG630Ca/t5gLgrQt8dk3/cIADyvxVHuPYpPOIBvkzSO0H1VcxFVqFQtrVjNLzsf23+rtLGH9ubmM6o1o2DVHZtjcnBwHNdltIyhlDkRiIsUpyKs8TVp6AgFa33E/Zg8extgUsuEP3FwBR4RopsgxJRYUIjKo9E6RIYQXCoGz6Al5UQsZf8u8h0NOrTxisXgjKPfr/wM6DNnOuBUfCzednucn99jqjYYh7iheHzIUv3WefjAGfMQkb+CM0PWJEa5Lgg3FUPGM81zoBnnLyftzCuQnHjZSoUqfjhbivFeFJIOyaEqkpgnj6iMU6xR4bNgDZ2dn8bp1vXMwpF/9EGHstCfALe3f5IQBPdW77CUn022hWmDPBy3gw+lDA06X0+bf/bkcY6+0qU7+duWlAI40u45eme95KklrMrNj/o+wa2PdhG+4oDcEt0S4VZxM0QeGvDniVtZIRpV1whP2q4uq2IJs2hnG6XyN3GOrkDeBUdewVSoj2Rs84RAvqe/xtE5D79muYk+L1i9dhQG+FEUrYQYYKOzqXlMHfYsVdgLVqs1Kn/Dmre+BztpxqWFuZeq3YpqefTg4zUyw/ZUg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3176.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199015)(83380400001)(2906002)(66476007)(316002)(66556008)(186003)(66946007)(4326008)(8936002)(54906003)(6916009)(86362001)(8676002)(36756003)(2616005)(41300700001)(26005)(6512007)(6486002)(53546011)(38100700002)(6666004)(7416002)(5660300002)(6506007)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?AIt6gOL4oCxEf8E773VNGo9ithEktFImM1HLJ7Got/cAeCaPzF731kqWW3l0?= =?us-ascii?Q?b8a/hroVMjIsCWG14t8n3d6nA3LOmff+C2AvpSEFEG2X9Jr3inSVmz/A22Ey?= =?us-ascii?Q?z5P43XfzMQ5yn/Jd784S7HZkSREQ8PnePxsHVz5W0FWacz1eJJScu+MbuWev?= =?us-ascii?Q?qXyxM7l2+Vw09iDP6pg3zfJLv0op0rzdJJ+vHngI13cWeLnqiGSQBZZdmWf+?= =?us-ascii?Q?Sln2uNSYTNpXT+Rdj+BU1UsY9fiKdECX+DvfJ2bjgebbaIJMtE3Q/E9rr0L8?= =?us-ascii?Q?GpyqsU6w458frg6TNVqWKE3XQIWeWxOrNrj+t4uYhyevzTGI+EqeQILXWPcF?= =?us-ascii?Q?BZB6dItXuk8HqAm2qD5ngRhFYWe17fyJQ+Nk3lBmyyv7tYNDsuGLGe2/mNRS?= =?us-ascii?Q?UaCIszWQkX2HIgcGW59LKu2QjPKAA5CVrElv6QjgQb4nYX84LqlErPJlSMca?= =?us-ascii?Q?p0q6P7vF5U59JVEVXoDy5+pl6aP2HOIBkY90jTUcoOqFpYJwQE8XFCtQCfOE?= =?us-ascii?Q?mY62TTzl+tCcIwLq3Fos3TJyu7UchC2Crt1Cbft4g/3XwLC+nn1yeS2Zoegw?= =?us-ascii?Q?F6lms4r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a+/PAZ?= =?us-ascii?Q?OLEmzWm0/ieMEFRJD3f5Xpz57cr0ub+C60StpxtRTaPFzr7tKoQ1lUrs3RzD?= =?us-ascii?Q?55BA9jza/BAHUM4INmlMW3RctN31A90QcyIrkbLG?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f02b7887-8a42-42fd-88e3-08daad939cec X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3176.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2022 03:24:33.1828 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +okVsh7FlESwTvZcVcjrFkC50wFraPsurO5ZW7bulbh7EPbt9WPWp9E6/bHRhhdAuaVPuyZi29LjOOVtFHaC2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4998 ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665717876; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4NnTKHTxn4XcR099d+0pnFulDUANkdqTQvt8kcWf4lE=; b=alIuzDdOhIISjs5BARr/5Tl9E3SKTq98Xh9h8dZfuNibUpPqh7P4q2UOKNYpzhhjN6ty1I oPfHkV/Rp7F2cWmUMFLdhbbWeBiq82cCx1uhoxdFEKvitFS8pNt+T7AXGWruhNTyi/AsHr 5615D1V2BLML62lrNZyevJUH5YMh+xU= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=HndbJys3; spf=pass (imf03.hostedemail.com: domain of apopple@nvidia.com designates 40.107.92.75 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1665717876; a=rsa-sha256; cv=pass; b=52mXxrE6d3UzwTomFHNE1z37DVlHzdv5eR3eUG+2Ya7kORzHjgt9wFkpV6GGBlLh5shRAZ zDr54EIw3aXv6yJjAb3niUy6vKvtMHmC2Bk1nCM+Dybnkga4pvVbzhmhCrbcLGxOkZWcZQ MbDRSB1oyCi78mlJNYdM3ktKylPmoB8= X-Stat-Signature: 5i7z7m6h6fi3698eiwfmrgyy9u638ryh X-Rspamd-Queue-Id: 4704D2001D Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=HndbJys3; spf=pass (imf03.hostedemail.com: domain of apopple@nvidia.com designates 40.107.92.75 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1665717876-232235 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: Seems like this would fix both the SKIP in FIXTURE_SETUP and ASSERT in FIXTURE_TEARDOWN issues: --- diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index 25f4d54067c0..1998fe888f8f 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -387,12 +387,12 @@ if (setjmp(_metadata->env) == 0) { \ fixture_name##_setup(_metadata, &self, variant->data); \ /* Let setup failure terminate early. */ \ - if (!_metadata->passed) \ + if (!_metadata->passed || _metadata->skip) \ return; \ _metadata->setup_completed = true; \ fixture_name##_##test_name(_metadata, &self, variant->data); \ } \ - if (_metadata->setup_completed) \ + if (_metadata->setup_completed && setjmp(_metadata->env) == 0) \ fixture_name##_teardown(_metadata, &self, variant->data); \ __test_check_assert(_metadata); \ } \ Alistair Popple writes: > Vlastimil Babka writes: > >> On 10/13/2022 9:38 PM, Shuah Khan wrote: >>> On 10/13/22 12:00, David Hildenbrand wrote: >>>>>>>> When did that test start failing? Was it still ok for 6.0? >>>>>> >>>>>> Didn't test yet, will try, in case it's my system/config specific thing. >>>>> >>>>> So it's actually all the same with v6.0 for me. The infinite loops, the test >>>>> failures, the misreported SKIPs. >>>>> >>> >>> I am not seeing infinite loops and seeing 25 failures which could >>> be skips. >>> >>>> >>>> Is the kernel compiled with support. I have the feeling that we might simply miss kernel support and it's not handled gracefully ... >>>> >>> >>> Here is my config >>> CONFIG_HMM_MIRROR=y >>> # CONFIG_TEST_HMM is not set >>> >>> Okay here is what is going on - hmm_tests are supposed to be run >>> from test_hmm.sh script. When I run this I see a message that tells >>> me what to do. >>> >>> sudo ./test_hmm.sh >>> ./test_hmm.sh: You must have the following enabled in your kernel: >>> CONFIG_TEST_HMM=m >>> >>> Running ./hmm_tests gives me all the failures. So it appears running >>> hmm_tests executable won't work. This is expected as test_hmm.sh does >>> the right setup before running the test. We have several tests that do >>> that. >>> >>> Vlastimil, can you try this and let me know what you see. I will compile >>> with CONFIG_TEST_HMM=m and let you know what I see on my system. >> >> Right, I didn't mention it, sorry. I did have CONFIG_TEST_HMM=m and was running >> "test_hmm.sh smoke" > > FWIW I tend not to use that script on my development machine, mainly > because I either have the module built in or otherwise don't have > modules installed in a place modprobe knows about. > > Anyway I am not seeing test failures running hmm-tests directly. However > I do observe both the issue of SKIP in FIXTURE_SETUP() being reported as > a pass in the summary, and the infinite loop on ASSERT failure in > FIXTURE_TEARDOWN. > > There does seem to be some framework issues here which are causing this > behaviour. Consider the following representitive snippet: > > #include "../kselftest_harness.h" > > #include > > FIXTURE(test) {}; > > FIXTURE_SETUP(test) > { > SKIP(return, "skip"); > } > > FIXTURE_TEARDOWN(test) > { > ASSERT_TRUE(0); > } > > TEST_F(test, test) > { > printf("Running test\n"); > } > > TEST_HARNESS_MAIN > > In this case the test will still be run even though SKIP() was called in > FIXTURE_SETUP. The ASSERT_TRUE() during FIXTURE_TEARDOWN results in the > infinite loop. So it looks to me like calling SKIP from FIXTURE_SETUP > isn't supported, and calling ASSERT_*() in FIXTURE_TEARDOWN is also not > allowed/supported by the kselftest framework. > > Unlike hmm-tests though the above snippet reports correct pass/skip > statistics with the teardown assertion removed. This is because there is > also a bug in hmm-tests. Currently we have: > > SKIP(exit(0), "DEVICE_COHERENT not available"); > > Which should really be: > > SKIP(return, "DEVICE_COHERENT not available"); > > Of course that results in an infinite loop due to the associated > assertion failure during teardown which is still called despite the SKIP > in setup. Not sure if this is why it was originally coded this way. > > - Alistair > >>> thanks, >>> -- Shuah >>> >>> >>>