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 CD85CC433FE for ; Tue, 22 Nov 2022 15:53:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 32C288E0001; Tue, 22 Nov 2022 10:53:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2DB936B0075; Tue, 22 Nov 2022 10:53:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A37F8E0001; Tue, 22 Nov 2022 10:53:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0A8826B0074 for ; Tue, 22 Nov 2022 10:53:04 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CFF9C81022 for ; Tue, 22 Nov 2022 15:53:03 +0000 (UTC) X-FDA: 80161521846.17.F4FB50F Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by imf23.hostedemail.com (Postfix) with ESMTP id 1779D14000E for ; Tue, 22 Nov 2022 15:53:02 +0000 (UTC) Received: from [192.168.10.9] (unknown [39.45.241.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id B79876602ADB; Tue, 22 Nov 2022 15:53:00 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1669132381; bh=/MLFPXf3wzObt0352P84BNKFndsD7TakAW5Q9Gvu4jk=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=JGRLcjGQPCQc3B1wO7R8ZNY7mfTOf6YdUMtYigUMCqsNA70QZ+lhw1vi5rgt9vX4A xtA2Z3g28y+EyR0P+rwB20spDrUg8Ha2C6now4a6DCFKXXRunyAid7yc2O73YTRevf iate10gF4gcn1SWhaE9VJxB++dchJfl3uj/ES6W4rJyouFUBGAQ7vvuzngAN7xt3jZ Q7y/G2zaOwRoQyLzCoMUWO2+XumuXKExM8WC/La+d+DT4GSgIaVddFAH9Umuekw8To mQDZjhq2yuDucQ4VmjZKexmiVXJM+3rn22h34VrxgBcn/V2aIyoQ/OvSC4Esi8kfFU OcKNXwOfemFLA== Message-ID: <048fe35b-4de1-cd60-5bd2-017885fbf66b@collabora.com> Date: Tue, 22 Nov 2022 20:52:56 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Cc: Muhammad Usama Anjum , "open list : MEMORY MANAGEMENT" Subject: Re: soft-dirty kselftest is crashing on next-20221122 Content-Language: en-US To: David Hildenbrand , Peter Xu References: <12677bb0-198a-6ac2-2b01-ada23f43c45f@collabora.com> <04031393-75b4-b4f3-d727-cf9db9cb509c@redhat.com> <183e88fb-a2f3-20f9-d16e-3dcc29f109ea@collabora.com> <21917884-f372-cd89-1c66-267f610390ab@redhat.com> From: Muhammad Usama Anjum In-Reply-To: <21917884-f372-cd89-1c66-267f610390ab@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669132383; a=rsa-sha256; cv=none; b=7gtrGalJWxqErpQauYhBo36a+q9tSRSdQnJ7eAvU4NhyDY804l+eWhqnJlV26Skn+H8ehH hn3RmZwqpwa3K2IAEQdlWEznvVq2sudavDpr7UOhYNtt32CiAkDH9lXBUcB45uqiYpXCyS FVsosG6EXB7aWM4L2KV8gEzgGpC1Y8c= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=JGRLcjGQ; spf=pass (imf23.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.172 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669132383; 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=me7uJvHIn5dwJ2/cJtDw6xj6YEJXIgkgcRYt4Hnc9kQ=; b=xTXxrVmKGdpz3/1rkyZypTRy3t6RXEx2BOkEUqeRxKJ/tIIz5jQzCSBhFkXXYYTrWve/wp TUIpohzj3sPWgBRUk2L1RUWAUZtRHVBZWlODDLIE5JCJG2nbKiv098yawVMrAcWc7DpOny 1zOHZbcBtFO5a4ubZTJIq7gF6Y3Noi4= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1779D14000E Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=JGRLcjGQ; spf=pass (imf23.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.172 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com X-Rspam-User: X-Stat-Signature: 53uyu5gnwxfk7o97ip3zjp6pjq7uazaj X-HE-Tag: 1669132382-366290 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 11/22/22 8:42 PM, David Hildenbrand wrote: > On 22.11.22 16:05, Muhammad Usama Anjum wrote: >> On 11/22/22 7:49 PM, David Hildenbrand wrote: >>> On 22.11.22 15:00, Muhammad Usama Anjum wrote: >>>> Hello, >>>> >>>> I'm getting segmentation fault when mprotect file sub-tests in soft-dirty >>>> kselftest are run on top next-20221122 and on v6.0. These sub-tests were >>>> added by Peter recently. Has someone noticed this already? >>> >>> On 6.0.7-200.fc36.x86_64, all tests pass. >>> >>> # ./soft-dirty >>> TAP version 13 >>> 1..15 >>> ok 1 Test test_simple >>> ok 2 Test test_vma_reuse dirty bit of allocated page >>> ok 3 Test test_vma_reuse dirty bit of reused address page >>> ok 4 Test test_hugepage huge page allocation >>> ok 5 Test test_hugepage huge page dirty bit >>> ok 6 Test test_mprotect-anon dirty bit of new written page >>> ok 7 Test test_mprotect-anon soft-dirty clear after clear_refs >>> ok 8 Test test_mprotect-anon soft-dirty clear after marking RO >>> ok 9 Test test_mprotect-anon soft-dirty clear after marking RW >>> ok 10 Test test_mprotect-anon soft-dirty after rewritten >>> ok 11 Test test_mprotect-file dirty bit of new written page >>> ok 12 Test test_mprotect-file soft-dirty clear after clear_refs >>> ok 13 Test test_mprotect-file soft-dirty clear after marking RO >>> ok 14 Test test_mprotect-file soft-dirty clear after marking RW >>> ok 15 Test test_mprotect-file soft-dirty after rewritten >>> # Totals: pass:15 fail:0 xfail:0 xpass:0 skip:0 error:0 >>> >>> >>> Same on a kernel close to mm-unstable on top of 6.1.0-rc4: >>> >>> >>> # ./soft-dirty >>> TAP version 13 >>> 1..15 >>> ok 1 Test test_simple >>> ok 2 Test test_vma_reuse dirty bit of allocated page >>> ok 3 Test test_vma_reuse dirty bit of reused address page >>> ok 4 Test test_hugepage huge page allocation >>> ok 5 Test test_hugepage huge page dirty bit >>> ok 6 Test test_mprotect-anon dirty bit of new written page >>> ok 7 Test test_mprotect-anon soft-dirty clear after clear_refs >>> ok 8 Test test_mprotect-anon soft-dirty clear after marking RO >>> ok 9 Test test_mprotect-anon soft-dirty clear after marking RW >>> ok 10 Test test_mprotect-anon soft-dirty after rewritten >>> ok 11 Test test_mprotect-file dirty bit of new written page >>> ok 12 Test test_mprotect-file soft-dirty clear after clear_refs >>> ok 13 Test test_mprotect-file soft-dirty clear after marking RO >>> ok 14 Test test_mprotect-file soft-dirty clear after marking RW >>> ok 15 Test test_mprotect-file soft-dirty after rewritten >>> # Totals: pass:15 fail:0 xfail:0 xpass:0 skip:0 error:0 >>> >>> >>> Different architecture? Maybe recompile the tests?I get the segmentation >>> on "Linux (none) 6.1.0-rc6-next-20221122 #36 SMP >> PREEMPT_DYNAMIC Tue Nov 22 20:02:02 PKT 2022 x86_64": >> >> soft-dirty[237]: segfault at ffffffffffffffff ip 0000000000401dff sp >> 00007ffc4ae08ee0 error 7 in soft-dirty[401000+2000] likely on CPU 0 (core >> 0, socket 0) >> [  348.579595] Code: bf 00 00 00 00 e8 e1 f2 ff ff 48 89 45 f0 48 83 7d f0 >> 00 75 11 48 8d 3d 5f 14 00 00 b8 00 00 00 00 e8 75 f9 ff ff 48 8b 45 f0 >> 00 01 48 8b 55 f0 8b 45 cc 48 89 d6 89 c7 e8 50 05 00 00 >> 8root@(none):/home/usama/repos/kernel/linux_mainline/tools/testing/selftests/vm# >> [  353.015360] soft-dirty[238]: segfault at ffffffffffffffff ip >> 0000000000401dff sp 00007ffc8ec97f80 error 7 in soft-dirty[401000+2000] >> likely on CPU 0 (core 0, socket 0) >> [  353.016456] Code: bf 00 00 00 00 e8 e1 f2 ff ff 48 89 45 f0 48 83 7d f0 >> 00 75 11 48 8d 3d 5f 14 00 00 b8 00 00 00 00 e8 75 f9 ff ff 48 8b 45 f0 >> 00 01 48 8b 55 f0 8b 45 cc 48 89 d6 89 c7 e8 50 05 00 00 84 c0 >> >> The config is attached. This is a minimal config. The kernel is run inside >> a qemu instance with help of virtme scripts. >> > > 99.9% your config (+BTRFS, -debug symbols) > > [root@vm-0 vm]# uname -a > Linux vm-0 6.1.0-rc6-next-20221122 #4 SMP PREEMPT_DYNAMIC Tue Nov 22 > 15:37:42 UTC 2022 x86_64 x86_64 x8x > [root@vm-0 vm]# ./soft-dirty > TAP version 13 > 1..15 > ok 1 Test test_simple > ok 2 Test test_vma_reuse dirty bit of allocated page > ok 3 Test test_vma_reuse dirty bit of reused address page > ok 4 Test test_hugepage huge page allocation > ok 5 Test test_hugepage huge page dirty bit > ok 6 Test test_mprotect-anon dirty bit of new written page > ok 7 Test test_mprotect-anon soft-dirty clear after clear_refs > ok 8 Test test_mprotect-anon soft-dirty clear after marking RO > ok 9 Test test_mprotect-anon soft-dirty clear after marking RW > ok 10 Test test_mprotect-anon soft-dirty after rewritten > ok 11 Test test_mprotect-file dirty bit of new written page > ok 12 Test test_mprotect-file soft-dirty clear after clear_refs > ok 13 Test test_mprotect-file soft-dirty clear after marking RO > ok 14 Test test_mprotect-file soft-dirty clear after marking RW > ok 15 Test test_mprotect-file soft-dirty after rewritten > # Totals: pass:15 fail:0 xfail:0 xpass:0 skip:0 error:0 > > > Are you maybe compiling the tests on the host or the guest does not have > sufficient vCPU features (e.g., "-cpu host" on the kernel cmdline)? Thank you for testing it out. Sorry for the noise. I'm compiling tests natively and running the them in qemu instances which also has "-cpu host" option. I'll try to debug. -- BR, Muhammad Usama Anjum