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 60A29C48BC3 for ; Wed, 21 Feb 2024 14:41:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE82E6B0072; Wed, 21 Feb 2024 09:41:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C98046B0075; Wed, 21 Feb 2024 09:41:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B39296B007B; Wed, 21 Feb 2024 09:41:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A3EBC6B0072 for ; Wed, 21 Feb 2024 09:41:58 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 771B5160AB9 for ; Wed, 21 Feb 2024 14:41:58 +0000 (UTC) X-FDA: 81816075516.29.5E83E80 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf26.hostedemail.com (Postfix) with ESMTP id 4E17D14001E for ; Wed, 21 Feb 2024 14:41:55 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=e8+RZbwo; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf26.hostedemail.com: domain of mripard@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=mripard@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708526517; 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=EQF9KL1RT2lVZ7Xc3+VDawL+ZjdCN9kZA1uWFox451E=; b=niU4bxz0+RsrFM2yUh1tR+pCqOYMjvrC2GSSmc90TiUmsPmJePkAn6Hq3wgZbPtrot0WCa 7Nwci5AsTjiFFNytty+SIu5T/B5z+xw100bKpc2VBJPf1ULnzKSUJ1MFNbcoxDeKph2LMs zjML+gNbYKopK1b1K1uhZ05Orqj6qYI= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=e8+RZbwo; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf26.hostedemail.com: domain of mripard@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=mripard@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708526517; a=rsa-sha256; cv=none; b=BYcOdXyvGKP/827a36ZvUgp3etnjsSp/GwhNIsVYZWoasSsTkhChYdVtzy7TMeged3yEhP rrOmzPBIaHlnXBPh9kKj0ih5DTz9NsoUtI098eTEk60uqDcBMHvpzpbucU670b1ZY6ElRI 4qDDRw0Idni8ePs9ygr4Efm4aPl2EWw= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C6F6FCE1DF3; Wed, 21 Feb 2024 14:41:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8C7BC433F1; Wed, 21 Feb 2024 14:41:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708526512; bh=EQF9KL1RT2lVZ7Xc3+VDawL+ZjdCN9kZA1uWFox451E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e8+RZbwoP4Gmf1Fbtkw60VHjWvXsG0ifLyAM2J+S0e7vmCPRk9y5sCyHy4p12Rb9E cMVnoPIVPirHjku5qiYdhSPL5zu+SjA8jtz0L3xSEUKkkefFVItIs/hOZTvpCULHi6 wx3i47h8pwWbn7any3FjPK+E2iAzqVQmo7uQslQmDJ2Eg1A7ZzXEt7apYuPs3IHt8I RLKaEGmprNupovU/75faSMd55zokPKnzOblfoy+fPJNaIcqfufnyn0JmDFyBdo9e06 ughyEFdoXQ0VAyuUeBTnu6rhpO2bn6uOWOIN3TF2VU6vAdDGCvLy62RPy75pi4RH+O g4CnldFCnleQg== Date: Wed, 21 Feb 2024 15:41:49 +0100 From: Maxime Ripard To: Christian =?utf-8?B?S8O2bmln?= Cc: Bagas Sanjaya , Erhard Furtner , Linux DRI Development , Huang Rui , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Karolina Stolarek , "Kirill A. Shutemov" , Andrew Morton , Zi Yan , Linux Kernel Mailing List , Linux Memory Management List , Brendan Higgins , David Gow , Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Subject: Re: Running ttm_device_test leads to list_add corruption. prev->next should be next (ffffffffc05cd428), but was 6b6b6b6b6b6b6b6b. (prev=ffffa0b1a5c034f0) (kernel 6.7.5) Message-ID: References: <20240219230116.77b8ad68@yea> <9cdf0baa-f544-4fa8-bee3-568b790527cc@amd.com> <4xggxtkk44m3xcfucbougtuhr66s2pc7tilpnju7xnyw45facb@odsrpqp57kiz> <535f9089-b988-45ac-b3f3-a7d593861723@amd.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="54nvwbweshimitzn" Content-Disposition: inline In-Reply-To: <535f9089-b988-45ac-b3f3-a7d593861723@amd.com> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 4E17D14001E X-Stat-Signature: ntooa4it61yb3gwtqwxrek4pscsy4bmq X-Rspam-User: X-HE-Tag: 1708526515-445297 X-HE-Meta: U2FsdGVkX18V8Yl42UHqW3nxmd8Wb+qfnY9UVxB8VyA3nfHzM/1Ik4HpBQkUVxZV3IlRjA3mvrBXBGMAXn9MWBlkUUoapbgAzcXB+6abFmft08gIX0VI+GzxWNYwZBe6Dg/7O/bWGrhIQiMeaNV1ANi6BBCcVNIgu1tt58i4Qr1Z3RjRFySb66Nh+8T6xvNcyvkfDXBGIXLyCHDEPpmhgtknZxCdXu1qaG3ScI1obyIbugHEDUUk+k/RpZ9ro6A8jx/TD+4Q5ZiE/HfhliC4g41fBSr6k0odHBK/vpSdjdvMnDuEVMGcJwDPWsOWLo7UNmjUVzLpmx0unibp37tCZ+Eozhmb4ECFxzhbYSMMwDE2WxpyM+CAgMp8Ea/XIMe+jSANVTUcIemQs/zcPlU5orGeemOKW5Zj5MQtmiP4lBlFaxv8sHXT18c0Aq+LfUrq9oXu4Z4o91hSqI75q3rVHFxpNhIXSnVKApOBLhwgFDEH3j0hIbyFYUigNL7YBRBq5EqK/7khKhgOIdWFyDtT6zwZ+BOnqoBXdm5PXcVk8kS8J28Y3T+2lPA1K64Uvsw7rA+PRR5IGzX43Gv8EVM1o/yxB6PX0iJAr9+wvZxyZQYWJBOGGuZ1SliuSsHdqp/DQ7oEeg6xiy1FLT/n5nPcI16OOOv5tQViHGEbuJSJKaV/9YYvnD2Djz6xMluJbx2OaDZJujeux/Nc8R8LDIDRw/BybxnV09G7G8aDSWZfpUh1VOOHXu/cIP8hACzbOWJ84DJYcKwIr69jWXhyGhvhUjw1cIffwcyRO/rfcSxBQWq2RRJB3rFS149SLcDG8NbUNXN89u4zDoceqN+eZnRHepopOl6j5Vc2xQgA5TiDJbe2Kl15kgiW4QM7R5B/dJlgJfDwzUxSaVDn0KFF2JCMPZ2JwGo6PJkzVzOLKGyxrR4NFFROHCh2bnG9e1GloveTayxKjxIgvawTesvpLsA /oddsVmY YAweYdL1DTgf4xFHasuTRCE/4JA== 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: List-Subscribe: List-Unsubscribe: --54nvwbweshimitzn Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Christian, On Tue, Feb 20, 2024 at 04:03:57PM +0100, Christian K=F6nig wrote: > Am 20.02.24 um 15:56 schrieb Maxime Ripard: > > On Tue, Feb 20, 2024 at 02:28:53PM +0100, Christian K=F6nig wrote: > > > [SNIP] > > > This kunit test is not meant to be run on real hardware, but rather j= ust as > > > stand a long kunit tests within user mode linux. I was assuming that = it > > > doesn't even compiles on bare metal. > > >=20 > > > We should probably either double check the kconfig options to prevent > > > compiling it or modify the test so that it can run on real hardware a= s well. > > I think any cross-compiled kunit run will be impossible to differentiate > > from running on real hardware. We should just make it work there. >=20 > The problem is what the unit test basically does is registering and > destroying a dummy device to see if initializing and tear down of the glo= bal > pools work correctly. >=20 > If you run on real hardware and have a real device I assume you mean a real DRM device backed by TTM here, right? > additionally to the dummy device the reference count of the global > pool never goes down to zero and so it is never torn down. >=20 > So running this test just doesn't make any sense in that environment. > Any idea how to work around that? I've added David, Brendan and Rae in Cc. To sum up the problem, your tests are relying on the mock device created to run a kunit test to be the sole DRM device in the system. But if you compile a kernel with the kunit tests enabled and boot that on a real hardware, then that assumption might not be true anymore and things break apart. Is that a fair description? If so, maybe we could detect if it's running under qemu or UML (if that's something we can do in the first place), and then extend kunit_attributes to only run that test if it's in a simulated environment. Maxime --54nvwbweshimitzn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZdYLrAAKCRDj7w1vZxhR xdN5AP0a2qM2svXKCp42Du8M5ceOwqA0Ro4VNIqTjfP71wm84wEAqBc0BtfBVIUp WX9cTT9QW23f/XVrxJCgQkZF0UJvlg8= =cUKm -----END PGP SIGNATURE----- --54nvwbweshimitzn--