From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2052.outbound.protection.outlook.com [40.107.244.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7230267B81; Thu, 13 Mar 2025 14:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.52 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741875052; cv=fail; b=oBGCWUULlGsx0JiD9JDAYpP+nASmoanijMjZiG4PBZs4SRNzNEF8hBNYYXIBoSletZtj+YRUmKFzW8ReGaDnxbx7+DQCLEWopGmXwVJh+z90ndpBr7srvX9ghAUn9PMVq+/HNSR/pVpVXscEN/L7+TJLXyuHGAG//6//3LLXp1s= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741875052; c=relaxed/simple; bh=xDzn0upzTDBigjBCxRftJWKoVKOtF94TMsJ5lu6RFu0=; h=From:To:CC:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=sVVQqlYbfCBnJshJcTYgbEqtf+zEoBQBGhEt/f1A0VVg3yuLmAMewmYGHQMmQYLTsVfVw5NYYFWjh5FIuYy9yT2AbpWJX1oZWuyTnH9rhT0HSskq+wf2iZkWkLxH7nvzWcF4CJeB1G+skVxp8RpX6MY9BvEx5X+hEWZjoBteRIU= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=uDHtueXP; arc=fail smtp.client-ip=40.107.244.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="uDHtueXP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q9Xxc1jvxfwxARhJvAlLZiiSt8NWqHEHT8usVZ8fJEUPYaUU9s6bSZLvwsCNmkS7uTSDo0EOkLf/NEpl4OskSq3NMKJY6BXrHhFvAAlG+biPRkj6BdD4yZHa7RWlwhnM6c3favu5vZc7lNYW4jp97rielbnBu6gOv/E/BZoqiYOwTRslMvAqNNbG32Yw/82Ef+wAMB8SdA3xZG9pUqUS7m++YMhfNTyuEGI/IZ3qyNC8LKji1NgwGWsU/eRLOFCOncSNlrW86PY5iHH5hS5HVR6+uaBeG5kHrgAXKYywTdDBR8DSEnhMRcoIDSC7I43+uKvWpS5a+TSrSkHkBEyRhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=xDzn0upzTDBigjBCxRftJWKoVKOtF94TMsJ5lu6RFu0=; b=q4N3k02kPVDMigRmlfCmImG1ztWRc8SRo2bsFbt4NyY3e09U/Gr6L+D0qqtFN2l3blSUYHQjH2FMDlFm70/A7OtaCw3Auy7gAPb2X325zoEEiGmBDXenX162RgAO64MSRarNrGq79k41tZGaROa6yOhJ/eKEv3hKko92BvsXPgQwSvQCHk19v2tmbYMl5VdrPHoo5Njz9gJiinkR1jx89X19awwxyXBjiLr8PdnahmUuMv2LdyQNS+bE4SrM3nAkbFvRP8DgBMHESMfC91SQ9m67Y8hxbelyy57HvNUE+V1+Iv9bG+aJDxRF9+1JavfZINsSPOXbPkLCd16J+u2M8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=temperror action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=xDzn0upzTDBigjBCxRftJWKoVKOtF94TMsJ5lu6RFu0=; b=uDHtueXPmvKlZuhB5j5MjpTFM1IFx5fIvjNQ9QH7nopKdmOiicu+i6UpdawdXdolk9BUW8a66bdTSPhQxWHrqdj+LHQMrG76inZVyqBjAOzXbXu6lCtaa3BXOHgBzDQDPfoO8sGXfYW/aVmiCBmtmfsnbaC7rmRqb+zYPBAS4Zk= Received: from MN0P222CA0003.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:531::13) by LV2PR12MB5944.namprd12.prod.outlook.com (2603:10b6:408:14f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8511.27; Thu, 13 Mar 2025 14:10:46 +0000 Received: from BL02EPF0001A0FF.namprd03.prod.outlook.com (2603:10b6:208:531:cafe::ea) by MN0P222CA0003.outlook.office365.com (2603:10b6:208:531::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8534.21 via Frontend Transport; Thu, 13 Mar 2025 14:10:46 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=amd.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of amd.com: DNS Timeout) Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0001A0FF.mail.protection.outlook.com (10.167.242.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8534.20 via Frontend Transport; Thu, 13 Mar 2025 14:10:45 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 13 Mar 2025 09:10:44 -0500 From: Nathan Lynch To: Vinicius Costa Gomes , Vinod Koul , , CC: , , kernel test robot Subject: Re: [PATCH v1] dmaengine: dmatest: Fix dmatest waiting less when interrupted In-Reply-To: <87senhoq1k.fsf@intel.com> References: <20250305230007.590178-1-vinicius.gomes@intel.com> <878qpa13fe.fsf@AUSNATLYNCH.amd.com> <87senhoq1k.fsf@intel.com> Date: Thu, 13 Mar 2025 09:10:42 -0500 Message-ID: <874izx10nx.fsf@AUSNATLYNCH.amd.com> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FF:EE_|LV2PR12MB5944:EE_ X-MS-Office365-Filtering-Correlation-Id: 03c4289c-aeff-4aec-2672-08dd6238d8c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013|7053199007|13003099007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Gh+tYNrP1QdNWEiCR/oPZA0lNdJ4mcshFxLiHngFHcRF6XSeVyENuli0qdIZ?= =?us-ascii?Q?mhVfMQvlxg3ePXFLjqMBqtVNdIdWZHD6mXQC9B45zYsMK8w48Y25IVsSHnGj?= =?us-ascii?Q?TRhkuyjqRg0CBo/F6zhLf/sR3jxUJgFXX/FbW6gXcHbWxu58Fm2PscVzDgsP?= =?us-ascii?Q?s7x3g+89VO0zCM51A7HH6EsyJH7VOxkdhcf3OEG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?ir6N7uF4DFv/4+glmau0HWcO8xq/h+Fe/A7WPsJXblGyTOStGF/IKsM1aFAl?= =?us-ascii?Q?2u03UM+2uGhXMUbCNFu5BDFs2jUAeLpl3RgLiponS62R3gLMzF7T+TcU7D0d?= =?us-ascii?Q?hL5EwBQgDXYOlbE7zm3GTwFmIFfzyavMnq3HATD7GGTVvp3jQqzSFqFrP/2t?= =?us-ascii?Q?N7CNqMmy+Bea6QyiGpNZBUOl0rkS0n//rU22vNaEeEFie3h7MyMHUdWqMDr1?= =?us-ascii?Q?6M9hJC1nc05MG/UKH1LNtmOlHMOPhUbQjcaP4kFmEZNPowOtrezP3N1QeNW4?= =?us-ascii?Q?QfRGUoaX6gLqBzTC5Q9aTEc5PxI78uyJ9o9c61k80NKihT8pY6JHAz847Poo?= =?us-ascii?Q?P96rlMwQJIoubM9zZLH2Be0jVgjnxD7xpMlRHQxE3Cim+SknUYiOlDe5f4JD?= =?us-ascii?Q?IPHPaIxbMmSR0/w=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013)(7053199007)(13003099007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2025 14:10:45.0786 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03c4289c-aeff-4aec-2672-08dd6238d8c7 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A0FF.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5944 Hi Vinicius, Vinicius Costa Gomes writes: > Nathan Lynch writes: >> Vinicius Costa Gomes writes: >>> Change the "wait for operation finish" logic to take interrupts into >>> account. >>> >>> When using dmatest with idxd DMA engine, it's possible that during >>> longer tests, the interrupt notifying the finish of an operation >>> happens during wait_event_freezable_timeout(), which causes dmatest to >>> cleanup all the resources, some of which might still be in use. >>> >>> This fix ensures that the wait logic correctly handles interrupts, >>> preventing premature cleanup of resources. >>> >>> Reported-by: kernel test robot >>> Closes: https://lore.kernel.org/oe-lkp/202502171134.8c403348-lkp@intel.com >> >> Given the report at the URL above I'm struggling to follow the rationale >> for this change. It looks like a use-after-free in idxd while >> resetting/unbinding the device, and I can't see how changing whether >> dmatest threads perform freezeable waits would change this. >> > > I think that the short version is that the reproducition script triggers > different problems on different platforms/configurations. > > The solution I proposed fixes a problem I was seeing on a SPR system, on > a GNR system (that I was only able to get later) I see something more similar > to this particular splat (currently working on the fix). > > Seeing this question, I realize that I should have added a note to the > commit detailing this. > > So I am planning on proposing two (this and another) fixes for the same > report, hoping that it's not that confusing/unusual. I'm still confused... why is wait_event_freezable_timeout() the wrong API for dmatest to use, and how could changing it to wait_event_timeout() cause it to "take interrupts into account" that it didn't before? AFAIK the only change made here is that dmatest threads effectively become unfreezeable, which is contrary to prior authors' intentions: commit 981ed70d8e4f ("dmatest: make dmatest threads freezable") commit adfa543e7314 ("dmatest: don't use set_freezable_with_signal()")