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 A60D9C48BC3 for ; Wed, 21 Feb 2024 14:54:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 241166B007B; Wed, 21 Feb 2024 09:54:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CB4E6B007E; Wed, 21 Feb 2024 09:54:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01D2E6B0080; Wed, 21 Feb 2024 09:54:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E3DCD6B007B for ; Wed, 21 Feb 2024 09:54:42 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AEA521C0B98 for ; Wed, 21 Feb 2024 14:54:38 +0000 (UTC) X-FDA: 81816107436.08.3B331D8 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2079.outbound.protection.outlook.com [40.107.94.79]) by imf12.hostedemail.com (Postfix) with ESMTP id D170840012 for ; Wed, 21 Feb 2024 14:54:34 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=UuSvLxkC; spf=pass (imf12.hostedemail.com: domain of Christian.Koenig@amd.com designates 40.107.94.79 as permitted sender) smtp.mailfrom=Christian.Koenig@amd.com; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708527275; 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=fJDGNrRij9yWoPyp8wfnRs/Wv9vR5YR8tnk4frqYh0Y=; b=k9yzoUkmG9thbXgBSwfSbgpnjM9+0XzaJtJ87Q7mbQiNef7Mgt/vtJEruVxlBTMfVxEEXh d/Y9jKDpOUbwSCb2OAz1j2JroXyutb+wEBPnp2NV17+RERizqPo9DPCgOl04cz4lIGUyQg YYLq2nliB1DbcJDyNmtUyNLSn24+VhU= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1708527275; a=rsa-sha256; cv=pass; b=Sr1zl3lw03V/sEg/t+sGdu0FJNoD1QRA81j+4x+/XdkzQ8GXcEDGH2T8Gg81rKQJzaOh1b WdIoJSid6RlpJeHxR0sGXQ+wd8f5XlU74kVsscr+gJgMgewqfiyWjmyQ6Gg9cKicYYseqj ccg5xncw8H2iAb3qY9lRES/uqpA6QHg= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=UuSvLxkC; spf=pass (imf12.hostedemail.com: domain of Christian.Koenig@amd.com designates 40.107.94.79 as permitted sender) smtp.mailfrom=Christian.Koenig@amd.com; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QAgXknwkU2902gn4c+opXraArpy1P4kpOAyu+peB1xIphjI5yXCxrDQF98XM9MBaEFAdc4hhq0UJ3ZxHk8fYo+6+XxYvppDXuFpewVC9wZ9hH1sBvsqkKTFD9U+1Zpb7oD7A+PewT40uoiUMXD/Pmxr/qLyF5pfsb+3etQJcA3HCp1rSXRIEqzoWBJIjxVrtaq337kwpa29aRm4OjYFY15X19WaBXkVwxmXtfn2E3KqT+G5T5Sz0nUEzYj2zv4sgDh2VtlG4/mPDOoV87NAG2L1eWGXpc0CQ7Db5uZxoSSVYtF9y+lA3hBNwsbvkqR5y76J0PKzF07jZGE6YCd4h6w== 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=fJDGNrRij9yWoPyp8wfnRs/Wv9vR5YR8tnk4frqYh0Y=; b=aUAoP71AEB08b9PsE3/6yDNjlRm80bsuiROjGO6ZEXagnXMCSbNl6JrAe41FklkThxjFLNvx2Q72W3/iNkxLHxQd4qBKqPDBN5dgEUaPVBiVA6tTOVjEWLcn9TthqKR1Erl57cge5aO3J0L/hLN05g4kTGmxtaX8h8nm6TGCaip8Zek+DLm/FHKW1usz9BkDw5DSLnRPmdtlvu22Zcri8iZk/lKyfHHDmBeGc8QWBB3fcVC+hxirtF8Dd4SSaxM1HWN0HGyToch2ydjHlO/UDkaivg1nzMqLcH/HJ5PsTcAmZfs7FEEhYl/uogXCesgkgMe1B1oCE+ociUf96/Q+Vw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fJDGNrRij9yWoPyp8wfnRs/Wv9vR5YR8tnk4frqYh0Y=; b=UuSvLxkCcNweJmpeORKIFA2m46pFedpCYgdlzqA87NAEMsFxlMWYG+I/zp6dPMXp3EBhFtrAnbxhRK6mn/f49xKqTlTHWzG/a08Yl2RQgvJo+AX+r2ib1H79fYBW7rNwRSAlTR+QApF6aMvcwFTIGzkp6stAj2wyhTijOoYLhx8= Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by PH7PR12MB6611.namprd12.prod.outlook.com (2603:10b6:510:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.20; Wed, 21 Feb 2024 14:54:31 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::e1fb:4123:48b1:653]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::e1fb:4123:48b1:653%4]) with mapi id 15.20.7316.018; Wed, 21 Feb 2024 14:54:31 +0000 Content-Type: multipart/alternative; boundary="------------poAxNQYz9z0vG4YS08OmwdU0" Message-ID: Date: Wed, 21 Feb 2024 15:54:23 +0100 User-Agent: Mozilla Thunderbird 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) Content-Language: en-US To: Maxime Ripard 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 References: <20240219230116.77b8ad68@yea> <9cdf0baa-f544-4fa8-bee3-568b790527cc@amd.com> <4xggxtkk44m3xcfucbougtuhr66s2pc7tilpnju7xnyw45facb@odsrpqp57kiz> <535f9089-b988-45ac-b3f3-a7d593861723@amd.com> From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: X-ClientProxiedBy: FR3P281CA0062.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4b::11) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_|PH7PR12MB6611:EE_ X-MS-Office365-Filtering-Correlation-Id: 01aaa1ab-347f-4acd-9e39-08dc32ed02a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AC5tPyjXCanrSNHJMH528fYqqPIjBoyWBcdQgWJlAdOhygYkBk4epuIquyfCFRiNoJVxk6rCpq2P5aT6rOyse0+cBIu8LMC1w0EJ2zG0VZNzDcuwN7+zDVPTVtAasKCvQ+zK6bQ25JC1Ig7FBSaZnq4xxsgl5NzxbWy1X5aiBRF2auIxsRK8DCf7TeFqf5ipUdSfeNXT3aRxKbQOJaLvmHk0WOwQXLCuC0ys7n/20hQZRKRSkp5kOlaAcDfxpev0Zz//FIbbks1NH7og7AMualKITTLbbDhCp7jR3rSbLnrcdNu/+83GFjHtcO023Fjul2750pMxXkXTTJmv5YB5x4dY/9QL3dSaHB1k5zMdgwbrbP9T70Y7YfLX/r1O0m4x+/8TeFhYc9Zy5RrJ16Y1g0VrFGOMn45wHUyT2XGjGTEfCE1eMz2zVuad1SQ/qD7iqkIqX6SVhbrKbnMFZ7lAteSWwUsn3EsVs15sMuNfeR+IJVivNkay7rWoSyWVAnMZVPWGR8q/zkd9SMJI+Bl073v7rB3yS5i7bOlAvM8GXIk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB5685.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S3dWY3IvT1BnRTl3Z3d4c1l1dUhvT0IxcGR1R2VkWE53NlVzZXlJNjlLSnky?= =?utf-8?B?T0dJeklid3F0WkZyQVE1c3ROM2hHamI0c2JPWkVuNkZCR2lCbmpxcW5VNVlP?= =?utf-8?B?SjgvdkVDU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lBGTnh4emV5Q1lM?= =?utf-8?B?c1lSMm1DUkRab0dJK285YVYvNVRKK1dUb0VyUUQrL1NrV3JTNUhja09vMmdr?= =?utf-8?B?blhpOFV5cDFDNFJ3MEx6WkMvcFg1cW1qemw3MGlkY1lST0w3M1ptVDZMVElh?= =?utf-8?B?eVM4QmVxb0l0UnZEV0RrbXNBSktVVUhHd2k1Q09XY0pYYU91VldFVytlZ0hi?= =?utf-8?Q?4FnxhjNWSr75knu+VKJSq7boS?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01aaa1ab-347f-4acd-9e39-08dc32ed02a4 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2024 14:54:31.4009 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GvJI9Af6wWmevtU9sL43UBk+ffZhT7GkW3HMNoSTWkkdvoZW2rDxGcSJPWfh/sjt X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6611 X-Rspamd-Queue-Id: D170840012 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 4m7i9nijqj7ypwok5mp6pndb1acg35wq X-HE-Tag: 1708527274-109286 X-HE-Meta: U2FsdGVkX1/0xzzT4MB52QnStKamiI/mzfQBbB7sTQ+oFoQ60lRtE8Eqa03nkVX7/OLgclXkFkmwrxhNMcqjNYBjBs2CjB8Y4g0J5UN/5bxgZWrGgQsk+DQvhzJtCvpLBOctOFtp+u/IUbPrl42Kpk6mYOC0ntErCCb5BqI9I2ojkQHagSYQO2KSEwY0rxdXudjcWNdOVQhanBUVZzlZg9ARUQMYPIP3B3lQ7aVPCmVy2YLr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6Xue5PQYXaEVfxC+K2Njg8AgFLTbkscN57NR82TuKL2PSOIkEKRcL5naEVZAWkGmJC6fgkIHfZ0CiRJVQnL0eVLxwlJnPj77c4jD9tvRroNu9KMxFvjWPqzKfgLnUHMp 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: --------------poAxNQYz9z0vG4YS08OmwdU0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Maxime, Am 21.02.24 um 15:41 schrieb Maxime Ripard: > Hi Christian, > > On Tue, Feb 20, 2024 at 04:03:57PM +0100, Christian König wrote: >> Am 20.02.24 um 15:56 schrieb Maxime Ripard: >>> On Tue, Feb 20, 2024 at 02:28:53PM +0100, Christian König wrote: >>>> [SNIP] >>>> This kunit test is not meant to be run on real hardware, but rather just as >>>> stand a long kunit tests within user mode linux. I was assuming that it >>>> doesn't even compiles on bare metal. >>>> >>>> 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 as 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. >> 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 global >> pools work correctly. >> >> If you run on real hardware and have a real device > I assume you mean a real DRM device backed by TTM here, right? 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. >> >> 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? Yes, exactly that. > > 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. Yeah, as I said AMDs CI is running those tests with UML only and I strongly assume Intel is doing the same. In my reply to the reporter of the bug I provided a patch which limits the tests to (UML || COMPILE_TEST) and as far as I can see is the easiest option for now. We could detect that we are not in UML and skip the device test, but that's also rather pointless. Better not to provide the option in the first place. Regards, Christian. > > Maxime --------------poAxNQYz9z0vG4YS08OmwdU0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Maxime,

Am 21.02.24 um 15:41 schrieb Maxime Ripard:
Hi Christian,

On Tue, Feb 20, 2024 at 04:03:57PM +0100, Christian König wrote:
Am 20.02.24 um 15:56 schrieb Maxime Ripard:
On Tue, Feb 20, 2024 at 02:28:53PM +0100, Christian König wrote:
[SNIP]
This kunit test is not meant to be run on real hardware, but rather just as
stand a long kunit tests within user mode linux. I was assuming that it
doesn't even compiles on bare metal.

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 as 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.
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 global
pools work correctly.

If you run on real hardware and have a real device
I assume you mean a real DRM device backed by TTM here, right?

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.

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?

Yes, exactly that.


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.

Yeah, as I said AMDs CI is running those tests with UML only and I strongly assume Intel is doing the same.

In my reply to the reporter of the bug I provided a patch which limits the tests to (UML || COMPILE_TEST) and as far as I can see is the easiest option for now.

We could detect that we are not in UML and skip the device test, but that's also rather pointless. Better not to provide the option in the first place.

Regards,
Christian.


Maxime

--------------poAxNQYz9z0vG4YS08OmwdU0--