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 BA0D0C4332F for ; Thu, 13 Oct 2022 17:29:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BCDC6B0071; Thu, 13 Oct 2022 13:29:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 044986B0073; Thu, 13 Oct 2022 13:29:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD91C6B0074; Thu, 13 Oct 2022 13:29:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C3E626B0071 for ; Thu, 13 Oct 2022 13:29:48 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5C28E80B0D for ; Thu, 13 Oct 2022 17:29:48 +0000 (UTC) X-FDA: 80016613656.28.CF365D6 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by imf30.hostedemail.com (Postfix) with ESMTP id E7AA38002C for ; Thu, 13 Oct 2022 17:29:47 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id q196so1923807iod.8 for ; Thu, 13 Oct 2022 10:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fT64XeG+Xp7CtB2NYEREkqT6LH6syUwPmfpl29qc4G8=; b=Z3usybDGwg1eXknYWj7+HF8+VHl1hrW5HYau86mWSdpbd8C+2lOQscf7G3e/xtFPiw KPXWmUzR5o3TnW9iuQXm/mBPbQq2cvPC3+kKPhiitLCD0mfR1qj8eNng6fqMPn4oUEdz BccdEZ1mnQbk8yIHuL+o5J7hyZSNi/06CBhBU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fT64XeG+Xp7CtB2NYEREkqT6LH6syUwPmfpl29qc4G8=; b=6Yww1AHL/vxnkO7Z5dlgESJ6YIMlZBU7lF8MEx5nxaLnpDWm8YPkAS4gIfFNKNtMsA OGMdQ/alxkTgLYevTG7dyRTB6UUd+3pOhuFGbJni0iElXj/SG8UQo6niHZGWmF5+hv2P R9CYP7+nP3zSxjup8VLqG84YDaeZwaOk6FLu06VlzvX8pUGju4z3jj3anTyTxN2Au+70 i+MQf6Kj8rIFiqAHkFghFidqd+kJju6quytHogaDAEdkUOE37A7nq09tu6j9zLokUOy6 J2Q1rHW/heCCuy3ieMPBTVKxfrPRrLG+yp6++/HE1pR9ef9lyNhU7lYgEhHfyiXBAnOV 9Pmg== X-Gm-Message-State: ACrzQf2bkdi+bH5DomPgesMOpkFYgpK/02AY2injTlKhzOVCUYQ8OCjs gllqeJ2lts3kdD+3DseB4o7tFw== X-Google-Smtp-Source: AMsMyM6yVCSd/bZ1cMUJHp7lgg3Kj5H0R32jQYOjF8nuCbGAwYX1VfdvG9PDrRhWDnoLrXEa65OC+g== X-Received: by 2002:a6b:f117:0:b0:6bb:fa86:920d with SMTP id e23-20020a6bf117000000b006bbfa86920dmr476808iog.180.1665682187117; Thu, 13 Oct 2022 10:29:47 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id a10-20020a056602148a00b006aed243a244sm94442iow.54.2022.10.13.10.29.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Oct 2022 10:29:46 -0700 (PDT) Message-ID: <479aec54-fa65-2031-e891-332af275e067@linuxfoundation.org> Date: Thu, 13 Oct 2022 11:29:45 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: hmm_test issues with latest mainline Content-Language: en-US To: Vlastimil Babka , David Hildenbrand , Alex Sierra , Alistair Popple Cc: Jason Gunthorpe , Ralph Campbell , Felix Kuehling , Christoph Hellwig , Jerome Glisse , "linux-mm@kvack.org" , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan , Shuah Khan 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> From: Shuah Khan In-Reply-To: <04114304-7b35-d42f-0155-087e3b6237c6@suse.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665682188; a=rsa-sha256; cv=none; b=dccj+g3Vmb1cPPDHyKTIA97uPs93lom9WEB9qED95FHNOelJuW/DCHaCi2k/xlv0dypWXz jQl4dUzxqWH5UXGZPRceufpkVl4fxfha93SmC6ak6ymtKvQ01wgjdD6OUFReWsmQJJqIm4 LGgkmS6WKhCql6DG1TnLGPdsw4UulcU= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=Z3usybDG; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf30.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.166.46 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665682188; 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=fT64XeG+Xp7CtB2NYEREkqT6LH6syUwPmfpl29qc4G8=; b=flEmcipuK92hbD4NXAwtnXEUyvHjO0bd+nIZcJvNN/qr4fBTLdzUsK2cLHpdovcsYu0Tnb SnkbGlqjTLI6jQgGToxbAlZ51TfSJft37Kq2QcL/yYIai1gDHEdoTuflK3SzlZunZ4BW5L gPYdF2yXmkPNEixpANwcV/CVokZ0JB4= X-Stat-Signature: xrfqdwimfoq9iyuaauwdeq1cpjxpji54 X-Rspamd-Queue-Id: E7AA38002C Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=Z3usybDG; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf30.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.166.46 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-Rspam-User: X-Rspamd-Server: rspam03 X-HE-Tag: 1665682187-829713 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: On 10/13/22 11:12, Vlastimil Babka wrote: > On 10/13/22 19:10, Shuah Khan wrote: >> On 10/13/22 11:01, David Hildenbrand wrote: >>> On 13.10.22 18:54, Vlastimil Babka wrote: >>>> Hi, >>>> >>>> I've been trying the hmm_tests as of today's commit: >>>> >>>> a185a0995518 ("Merge tag 'linux-kselftest-kunit-6.1-rc1-2' ...) >>>> >>>> and run into several issues that seemed worth reporting. >>>> >>>> First, it seems the FIXTURE_TEARDOWN(hmm) in >>>> tools/testing/selftests/vm/hmm-tests.c >>>> using ASSERT_EQ(ret, 0); can run into an infinite loop of reporting the >>>> assertion failure. Dunno if it's a kselftests issue or it's a bug to >>>> use asserts in teardown. I hacked it up like this locally to proceed: >>>> >>>> --- a/tools/testing/selftests/vm/hmm-tests.c >>>> +++ b/tools/testing/selftests/vm/hmm-tests.c >>>> @@ -154,6 +154,11 @@ FIXTURE_TEARDOWN(hmm) >>>>   { >>>>       int ret = close(self->fd); >>>> +    if (ret != 0) { >>>> +        fprintf(stderr, "close returned (%d) fd is (%d)\n", ret,self->fd); >>>> +        exit(1); >>>> +    } >>>> + >>>>       ASSERT_EQ(ret, 0); >>>>       self->fd = -1; >>>>   } >>>> >>>> Next, there are some tests that fail (and thus also trigger the issue above) >>>> >>>> #  RUN           hmm.hmm_device_private.exclusive ... >>>> # hmm-tests.c:1702:exclusive:Expected ret (-16) == 0 (0) >>>> close returned (-1) fd is (3) >>>> # exclusive: Test failed at step #1 >>>> #          FAIL  hmm.hmm_device_private.exclusive >>>> not ok 20 hmm.hmm_device_private.exclusive >>>> #  RUN           hmm.hmm_device_private.exclusive_mprotect ... >>>> # hmm-tests.c:1756:exclusive_mprotect:Expected ret (-16) == 0 (0) >>>> close returned (-1) fd is (3) >>>> # exclusive_mprotect: Test failed at step #1 >>>> #          FAIL  hmm.hmm_device_private.exclusive_mprotect >>>> not ok 21 hmm.hmm_device_private.exclusive_mprotect >>>> #  RUN           hmm.hmm_device_private.exclusive_cow ... >>>> # hmm-tests.c:1809:exclusive_cow:Expected ret (-16) == 0 (0) >>>> close returned (-1) fd is (3) >>>> # exclusive_cow: Test failed at step #1 >>>> #          FAIL  hmm.hmm_device_private.exclusive_cow >>>> not ok 22 hmm.hmm_device_private.exclusive_cow >>>> >>>> >>> >>> 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. > >>> >> >> commit 4fe89d07dcc2804c8b562f6c7896a45643d34b2f (tag: v6.0, linux/master) >> >> # FAILED: 25 / 50 tests passed. >> # Totals: pass:25 fail:25 xfail:0 xpass:0 skip:0 error:0 >> >> Looks good to me. > > Hmm but there's 25 that failed? Or are those also misreported SKIPs? > Likely the case. Here is an observation. All of these FAILs are coming from line 141 which is FIXTURE_SETUP. See the result: # hmm-tests.c:141:open_close:Expected self->fd (-1) >= 0 (0) # open_close: Test terminated by assertion # FAIL hmm.hmm_device_private.open_close not ok 1 hmm.hmm_device_private.open_close However the code is: FIXTURE_SETUP(hmm) { self->page_size = sysconf(_SC_PAGE_SIZE); self->page_shift = ffs(self->page_size) - 1; self->fd = hmm_open(variant->device_number); if (self->fd < 0 && hmm_is_coherent_type(variant->device_number)) SKIP(exit(0), "DEVICE_COHERENT not available"); Note: It is SKIP(). It appears it will be reported as fail unless both of the above conditions are true. Perhaps this check should be either of these conditions is true, it is skip. ASSERT_GE(self->fd, 0); } Looks like this test could a review to see if all these conditions should be a FAIL or SKIP. This problem exists in 6.0. thanks, -- Shuah