From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.200.32 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796150117; b=SaYvWRkMcLhym3V6jb2ku2Wwswm8XqmGbcMN1glH8xxS0zxSfEuflBZKjJ+FEA1+MKyP wxT/KNH4YbnQPgVcTN8cTnSsXFi0t650ozvtrAOevBUpZK34e4xGV2E8AF7LSz+wyb8GZ Y/gW6WauMcehHAw/WjAJXIk81g7pfAm+ZkHknpm9yVsDLJ+kPjxAAf9X7KYSBY0h8aBf0 bqUMXwXea1szeFSv2ARz5I2cjnTCj9+AU7/OS2ZiIDIHg8yi5VNdI347JLe6/tgcikLi+ OLeMm70MJs4RBLz9HYq3S60jS5XnSoIJPjzou5MP1OM0Bf1iGX8A97i2+8OiMHsesbA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796150117; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To:CC: References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=xmhtkV2KAykukHgnYmbkyQNxydlxwbHgM4WnfQeJ2Ms=; b=KSs5Vo4vhtUxX4qFTUu9Xc3YAAEMJUW1bqKEMcWPH6NsHOIfeda5iu8b+HQjaISvOF6r w0XNUrD+flVm4DgAyQhwOte8j2rN/H1ddiZQIeUJdEp8HGgCd7pL4damnQWvtO6uetTng 2FF+k0IQgwL4hJnrSGWwkBPJNW7rDcCtbBcTnw22vxSb8MYisblpOooFxXdwEKcEa0v+C unRvcovMwE6GggAmo5H38tQ8ZQ9G+fURWKd9vh3v9T/ZEa4rd7kZuACZJu7z81fHGEi1D 6kjtqTqkjhNGGD8N5BPnvlcImPtt1h8eaZZLczS/a8P9o50pUcTwNQ44WTlojiCUTTg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=XWwzRJvM; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.200.32 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11012032.outbound.protection.outlook.com [40.107.200.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30C25606A31A for ; Tue, 1 Dec 2026 18:35:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 30C25606A31A 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, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=XWwzRJvM ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vgIIjS9GrJYZ4jtMCHhyh17rCS/HIgjVD8bWuAoI6X5M0LBd2mxZBmIBNhATOk77L8mr6/w6gw+KZhL87ymfYbjeSBrIm5mdGDMHVigzTQ4pmyt7cWgG+tkZGq/2F1NDncY9+qz1mHP7zGDelbFuAI/JbPJgSbGUaDGD67zKUSfLUHt/BAWx49hLrQoMw/XwU09pMjABBbmDqgSAiZ0vxJnb8N+J9MkxthARAQY27h53ZRiPsIVY33nTNqAUo/uAh26m+80o2GimIVFA4fZ+DUdeaFU3YouZCszQSbrgjJURLSJiflKo02Z7okmIL0fLLEvKvQHeYho512ooqVYSMw== 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=xmhtkV2KAykukHgnYmbkyQNxydlxwbHgM4WnfQeJ2Ms=; b=kjUY+tW/FBGyM1AJlnj3WhtX16Ngk0LL7ACyYZF7V3NnvuyBQHrGtEfwWM3tRl3+Bc1f6G16yGloRxulMi9vlWEvgrZwI1xvxlGuutiqGrkDa0nc6Jg8xX36G9cj99rOx2f0pgFACjwkXcEqjHMTmS7I5lGWAu7tQ9cmr9rw/7qvbXXcwku9gXf7EW5myTVeW/Mi+iPZkuf5uqbBUbhllh+IpQJ5sj55fCBo8KBUoX06ibry4hI5uHnoPJl0VaL2Uj8rNwJBO8jImiNXoH+acTv4/9x1Lh53QkuigPhPQy4kKkITeIRMyd8Pg+/bzpTZXtSW+YrDglw/bX6iEMmAXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) 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=xmhtkV2KAykukHgnYmbkyQNxydlxwbHgM4WnfQeJ2Ms=; b=XWwzRJvMTnn7t39ASq5l3bP2/NgY+j6zURwo0jSJRa0JIg+UAZafkmAZdndcMn9Oka9N0h6ndgHIUEFzmE3K5HMNWnz44STDQ0cQ9XfpK5LhQDEYAVB8F+8HZ01CN0+IaJhz9iYetinu5X45WS0pJ/jxdwGs+fAMSya2uFs34Ig= Received: from CH2PR08CA0006.namprd08.prod.outlook.com (2603:10b6:610:5a::16) by BY5PR12MB4036.namprd12.prod.outlook.com (2603:10b6:a03:210::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Tue, 1 Dec 2026 18:35:10 +0000 Received: from CH2PEPF00000147.namprd02.prod.outlook.com (2603:10b6:610:5a:cafe::35) by CH2PR08CA0006.outlook.office365.com (2603:10b6:610:5a::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.9 via Frontend Transport; Tue, 1 Dec 2026 18:35:09 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by CH2PEPF00000147.mail.protection.outlook.com (10.167.244.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 18:35:09 +0000 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 12:35:06 -0600 Received: from [172.19.70.249] (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.57 via Frontend Transport; Tue, 1 Dec 2026 12:35:05 -0600 Message-ID: Date: Tue, 1 Dec 2026 10:35:00 -0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V1] accel/amdxdna: Use mmput_async() in the job run error path To: Lizhi Hou , , , , , CC: , References: <20261201182059.3046774-1-lizhi.hou@amd.com> Content-Language: en-US From: Max Zhen In-Reply-To: <20261201182059.3046774-1-lizhi.hou@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00000147:EE_|BY5PR12MB4036:EE_ X-MS-Office365-Filtering-Correlation-Id: ad6be393-9695-4a98-ed6c-08df4fd9d43a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700016|23010399003|82310400026|22082099003|10067099003|56012099006|261028144727099003|261021121427099003|261026121527099003|261102123227099003|261021123027099003|261022105027099003|261022075727099003|261026140227099003|261009223027099003|5023799004|11063799006|18002099003|6133799003; X-Microsoft-Antispam-Message-Info: +P5807rliGaq32zfi0Sb3YUw8Lggn3EnkxMPZyFIreHh/pNipyZcxdie2GYnfqxR3zwg6m5bRZDdvGDT3JcF081CjnF2Kww5YfqjoDTNPYqr3KarC/60VoO3hUTPkklvYyPTFEkggHFt/G363jfGNP3ND/fdsssDDs/qKzlq+6oHxXsvzao1moIBZojqXAHNfmZSna5g6I5uxX9orWrbFXKs7QELbhmtwOy1qfqUVLv2pscu0mDYkcZ8rd76TLRHfvog9kyBphE0LVAC/Nf93IAGVxXeS8FA+PJzSYYfxMBdvCzXzhF/5I7b0AEolvY/HtLTX1Z4Qr98aoPKHlpn9U/G6DjRPs+kkhciACYReZBgLfe94PvjzPebDSOr5m88VdOweQvPRvoiWxdL0+KzAjXhv6ttnpogoUX0MSXtlfi1T4KaTEHR3LuGrVhdIyW2hQ1kdMBHvGt5bEvzWZ2kXf/2oZIu/u7mpF9mFBTuu0EFztoFl8m42hDdJibm6trb0XzOZS328dYNKjK1nstLVuP8tTcT/HHlujKpzvhfAfHzKzYqXTbLqawy3xbUowRN+f3YHedho1h1JRhYLDgzqQvlHOybxP2sQ0wdv0Vat2HvciKn53DWTyk+yna2iixabNqw2Y+kp5Km/qaOTpVPtym/vbSUPPtTd1tlyltOaV9qo6lMwPxnKVwYgY5yRO0DRyW0dDSfYdXYy7P2He12lg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700016)(23010399003)(82310400026)(22082099003)(10067099003)(56012099006)(261028144727099003)(261021121427099003)(261026121527099003)(261102123227099003)(261021123027099003)(261022105027099003)(261022075727099003)(261026140227099003)(261009223027099003)(5023799004)(11063799006)(18002099003)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F7g+BrXcEowx3CpDaBv4UhOWqFaM6GWyIK/VVfzVckaIyK6G5nQ2qmsamEfYXkba/5nAJr31BKHjgRRQbapRP4VrhpxU99jpJ4df0WDXBMYfKclgOaz4EmWhmbWnUT0yuOLCbh2lFivd2Kq6tOSXcY0rwabPgihYmAybTKkzG7TrN25L7E3DCBrjpb1oGmdnSbhJQOOSVFd6RJZbY27aVddyURJ7ltU+7bu/70BZQKbuDFMHnLmLbElUZlXbUSxdKbVxHP/uIFn+YOzIK1RREEkkses19OMnnE1M59G7PbYDZWDpcpvLQ820SePeBA1kyMTKDhU24+tTrwXUgDxkoUIzNi02qBk27HihCzaQtrSP90TVSu9MxnTPA35KxLt5VCAosSmlrBLo3D4TxtiP2By7/ugJzr6B0oGYZDKLTJrgOuC0aQoTrbxWNts4vATB X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 18:35:09.6497 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ad6be393-9695-4a98-ed6c-08df4fd9d43a 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=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF00000147.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4036 On 12/1/2026 Tue 10:20, Lizhi Hou wrote: > aie2_sched_job_run() runs from the DRM scheduler worker, not from the > submitting process, and the job only holds an mmgrab() reference to the > address space. If the process exits after the mmget_not_zero() at the > top of the function, the mmput() in the error path drops the last > mm_users reference and calls __mmput() -> exit_mmap() -> > mmu_notifier_release(), which invokes amdxdna_hmm_invalidate(). > > That handler waits with MAX_SCHEDULE_TIMEOUT for the fences of the BO. > The fence attached to the BO reservation object is the finished fence of > this very job, which the scheduler only signals once run_job() has > returned. The scheduler worker therefore blocks forever waiting for a > fence that only it can cause to be signalled, and stalls every other > context sharing the scheduler work queue. > > Use mmput_async() so that the address space teardown is deferred and > run_job() can return. > > Calling mmput_async() after aie2_job_put() is safe today because the > submit reference is still held until aie2_sched_job_free(). Swapping > the two lines makes it easier to read. > > Fixes: aac243092b70 ("accel/amdxdna: Add command execution") > Signed-off-by: Lizhi Hou Reviewed-by: Max Zhen > --- > drivers/accel/amdxdna/aie2_ctx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c > index 582e171b5fd7..0a6be8ba8e3c 100644 > --- a/drivers/accel/amdxdna/aie2_ctx.c > +++ b/drivers/accel/amdxdna/aie2_ctx.c > @@ -453,8 +453,8 @@ aie2_sched_job_run(struct drm_sched_job *sched_job) > if (ret) { > amdxdna_io_stats_job_done(job->hwctx->client); > dma_fence_put(job->fence); > + mmput_async(job->mm); > aie2_job_put(job); > - mmput(job->mm); > fence = ERR_PTR(ret); > } else { > /*