From patchwork Thu Oct 13 16:54:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13006243 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 8E35FC433FE for ; Thu, 13 Oct 2022 16:54:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C97116B0071; Thu, 13 Oct 2022 12:54:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C1F186B0073; Thu, 13 Oct 2022 12:54:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A71C28E0001; Thu, 13 Oct 2022 12:54:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8AF796B0071 for ; Thu, 13 Oct 2022 12:54:27 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 584381A0660 for ; Thu, 13 Oct 2022 16:54:27 +0000 (UTC) X-FDA: 80016524574.30.8478291 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf12.hostedemail.com (Postfix) with ESMTP id 984C240029 for ; Thu, 13 Oct 2022 16:54:26 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1696933B6A; Thu, 13 Oct 2022 16:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1665680065; h=from:from:reply-to: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=Q49ixtbos9k+FZBLMo7Ms7yhm9TFWumzjq7BMLl42xY=; b=B6mhAFcKTN7PibeXpKwS2aFV4xAognjs8WQ7P7ADGUujK1j2REZFdLwLI4O6QkE8Jefa4j r0pniyc+HjakuvK90Pds6rxdOE0ONhRtdNg91+UwyxgnZZBrBxYYgL2kHu6X1aUSn59btQ Op0WACWnRi37x8i68yUK8GTRlR+7Ld8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1665680065; h=from:from:reply-to: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=Q49ixtbos9k+FZBLMo7Ms7yhm9TFWumzjq7BMLl42xY=; b=FZGyXis2t3f0VMxDAfiWIMWGW3G4t/gR+Ch1MnPE0tWC3l2NvSYvpT3kwzi8BKak1WwYpC ezcfcztR2kJOaUDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C5D5C139F3; Thu, 13 Oct 2022 16:54:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id aL57L8BCSGMINgAAMHmgww (envelope-from ); Thu, 13 Oct 2022 16:54:24 +0000 Message-ID: <26017fe3-5ad7-6946-57db-e5ec48063ceb@suse.cz> Date: Thu, 13 Oct 2022 18:54:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Content-Language: en-US To: Alex Sierra , Alistair Popple Cc: Jason Gunthorpe , Ralph Campbell , Ralph Campbell , Felix Kuehling , Christoph Hellwig , Jerome Glisse , "linux-mm@kvack.org" , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan , David Hildenbrand From: Vlastimil Babka Subject: hmm_test issues with latest mainline ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=B6mhAFcK; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=FZGyXis2; spf=pass (imf12.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665680067; a=rsa-sha256; cv=none; b=i9pMiYJ9cQdHADxdnA7zDhGAuqaQk/Xn4UoJXOzF84Iryyf5QGMJvd1oxmBm4RJKcpYX0v zP1lh4kNrYukcYOCyBPdOS6cWgGUK6G5KCA4jcRSzTev00H4QSISNq6nGAVfKxqfVJLxdb NLDrs+/pxFE3kQ24RfyT5FpxKAgnOEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665680067; 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=Q49ixtbos9k+FZBLMo7Ms7yhm9TFWumzjq7BMLl42xY=; b=NqWKd3XLe15rQk9gHcq6t55SEXVT1/I1WsrFuGLwEWNfSEmV8PN6aob3rwDTxiA7k+sTDR e0cin/BUumqfdeNc+5oU7Q0L4zQ/mlEi3gNLdFcJVffRXK8WYw+6+0jGJCRhfwvqFI4jla dfbkqxpfC/Cdbe77Cb98OZ9lL32l/es= X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=B6mhAFcK; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=FZGyXis2; spf=pass (imf12.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 984C240029 X-Stat-Signature: ywzxmnf3z98xziy5ikoji1aoxsck4stx X-HE-Tag: 1665680066-477266 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: 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: 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 I'll try to check more closely but maybe if you can reproduce it too, you'll have more idea what's going on. The next thing is more of a question/documentation suggestion. Tons of tests fail like this: ok 24 hmm.hmm_device_private.hmm_cow_in_device # RUN hmm.hmm_device_coherent.open_close ... could not open hmm dmirror driver (/dev/hmm_dmirror2) # SKIP DEVICE_COHERENT not available # OK hmm.hmm_device_coherent.open_close I assume this is because I run "test_hmm.sh smoke" without the SPM parameters. The help message doesn't say much about what to specify there for . Do these tests need a particular hardware? (unlike the rest?) Maybe it could be clarified. Last thing, I noticed all these DEVICE_COHERENT tests ultimately count as OK, not SKIPPED, which would probably be more appropriate? # FAILED: 51 / 54 tests passed. # Totals: pass:50 fail:3 xfail:0 xpass:0 skip:1 error:0 (the skip:1 is due to test 9 "# SKIP Huge page could not be allocated" which is probably a misconfiguration on my part so I don't report that as an issue) Thanks, Vlastimil --- 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; }