From patchwork Fri Dec 4 03:17:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luben Tuikov X-Patchwork-Id: 11950581 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2D3BC433FE for ; Fri, 4 Dec 2020 03:18:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 65A7722513 for ; Fri, 4 Dec 2020 03:18:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65A7722513 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 450646E13C; Fri, 4 Dec 2020 03:17:45 +0000 (UTC) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2082.outbound.protection.outlook.com [40.107.100.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id EA0DB6E11E; Fri, 4 Dec 2020 03:17:39 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nBSNoToOcihqccHj+9HW/vZC8pZ5CXgLsx4AGRzso4Qq9Om9Fm6LNRKbT0zIyintkiXQXgHe51g5GgIjM1vPdrfWoQwH2UejHcTt76t42D7ZAFJkpHouYSvHJ9ldjzPJPJKP6YAS2fy7X9xMbqIGn/KH5Y7fwq/RLnpgRVBP2Wvp69ww/N6iStlsJAf+O0OMJxFCWMDO21eg1ajKQ3rvAyHcKEpgbwKHh4RAqEHQB6u+Octa/8c3DeGmyURxh6iPi+X45GsD1bnFB2d9gM/eSlifeDq+tZprtclUtzrbr+XXg05yMLx1MNxO9LLjEexZHB4qs/Pm2EwE7cGYhDKONg== 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-SenderADCheck; bh=ppAQKMcsLOS80Go0S+lNgD6fQjcf2iDHMLKzQOeFxJ0=; b=iyPEWTN11LtRJJhYJd2InfLSBoMiiVOl0YAUGlQikEp6yhxZRLW4T03vi8fRy3a+hUl/v1GovY7FBDx2+39WKMPY8AhUfpuLUT/xfdMzdo5Suuwbk9GXHov8xTQ3ktGIOWK64Y82IIswk5y/5WPmKD32rPG45aA6f3lcQYnPmyXytgv6u7kDhYEVh2sgY35m1LPU9ujJUW76D8Ck5EdtapcMFrvk6jmdFPlYmo7wRo5tgGrEkwBpkx9qC/v0e4QbwJBbHOZtYalkhfAj+W1ubhAWfZlvZVPY+jPC1b+vKZ6Cng6ed6r+czwKVrzR00v23RD84ETkTxq43fspHUHkPw== 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=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ppAQKMcsLOS80Go0S+lNgD6fQjcf2iDHMLKzQOeFxJ0=; b=t9ItXb2kNwX5x445rXVivRmQBwpB7n2szpoMuDtogkHrqSKLUmFQSBXMn6GYA1wqJXid+/iscoLkixVqSdouqQuLhJF/e/TuU6Zwy3Eg98VjrT4RhIF9xoJCED8Ajk1YvKKDn7ym7HJ5Mm+3U2ZjGmPn4vgZ8hgyA9slQs4OeKc= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB3962.namprd12.prod.outlook.com (2603:10b6:5:1ce::21) by DM6PR12MB4043.namprd12.prod.outlook.com (2603:10b6:5:216::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Fri, 4 Dec 2020 03:17:37 +0000 Received: from DM6PR12MB3962.namprd12.prod.outlook.com ([fe80::d055:19dc:5b0f:ed56]) by DM6PR12MB3962.namprd12.prod.outlook.com ([fe80::d055:19dc:5b0f:ed56%6]) with mapi id 15.20.3632.021; Fri, 4 Dec 2020 03:17:36 +0000 From: Luben Tuikov To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 0/5] Allow to extend the timeout without jobs disappearing (v2) Date: Thu, 3 Dec 2020 22:17:17 -0500 Message-Id: <20201204031722.24040-1-luben.tuikov@amd.com> X-Mailer: git-send-email 2.29.2.404.ge67fbf927d X-Originating-IP: [165.204.55.250] X-ClientProxiedBy: CH2PR02CA0026.namprd02.prod.outlook.com (2603:10b6:610:4e::36) To DM6PR12MB3962.namprd12.prod.outlook.com (2603:10b6:5:1ce::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain.amd.com (165.204.55.250) by CH2PR02CA0026.namprd02.prod.outlook.com (2603:10b6:610:4e::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17 via Frontend Transport; Fri, 4 Dec 2020 03:17:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 394715a4-9dc8-44db-be99-08d898032645 X-MS-TrafficTypeDiagnostic: DM6PR12MB4043: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gzMcNBBUXbA3e5oxKdql08w+EsQd2yr9RGNtkchBXgGBNuRnfh/KfjmZCc74CNKMQn8Yd5slixgYSVv/a/ODAixZjdRYqSuZLnv7R96RJVNya0hSpjeOq4Tiu4Z9xK7GcOb9QPr0pJti0pRVd5+J/ZIcqRSDElgO8xwC5WTfBylpq/9hag4Yny21O3xLjfTshAGY7MzAOeMNYrudNbS22SKYz71qdHSNb11NEf4r1ToBS53wi8nowDA9gXc9EAE7+KRaINDtC7+vpzIiuZPhX14l/+T36Ujny/tJU/xACkSc1PyqOI1CmtKyw+++4CEI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3962.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(39860400002)(366004)(346002)(136003)(396003)(16526019)(5660300002)(66946007)(956004)(1076003)(6486002)(2906002)(66556008)(66476007)(4326008)(6666004)(2616005)(83380400001)(186003)(36756003)(8676002)(86362001)(8936002)(26005)(44832011)(54906003)(7696005)(66574015)(52116002)(478600001)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?pCkr+wuk8+Wv9kbZsD/94/oAOBgslg?= =?utf-8?q?MN8CnY/R2OC0Kv7MS39Ryki8B2p1w4e+bKxhV4MmR7bUjLHI/bi5cehrnO4CTyoQ3?= =?utf-8?q?yr6M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PC0whUcP5FpT5Ep3k?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 394715a4-9dc8-44db-be99-08d898032645 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3962.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2020 03:17:36.8893 (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: 6VfvkBLKV6oET7I72jYN7yot/B60HjciSkvnzIEcGI2RGuMVnHzt5RHZw9mv+aUJ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4043 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Deucher , Luben Tuikov , =?utf-8?q?Christian_K=C3=B6nig?= , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi guys, This series of patches implements a pending list for jobs which are in the hardware, and a done list for tasks which are done and need to be freed. As tasks complete and call their DRM callback, their fences are signalled and tasks are added to the done list and the main scheduler thread woken up. The main scheduler thread then frees them up. When a task times out, the timeout function prototype now returns a value back to DRM. The reason for this is that the GPU driver has intimate knowledge of the hardware and can pass back information to DRM on what to do. Whether to attempt to abort the task (by say calling a driver abort function, etc., as the implementation dictates), or whether the task needs more time. Note that the task is not moved away from the pending list, unless it is no longer in the GPU. (The pending list holds tasks which are pending from DRM's point of view, i.e. the GPU has control over them--that could be things like DMA is active, CU's are active, for the task, etc.) The idea really is that what DRM wants to know is whether the task is in the GPU or not. So now drm_sched_backend_ops::timedout_job() returns DRM_TASK_STATUS_COMPLETE if the task is no longer with the GPU, or DRM_TASK_STATUS_ALIVE if the task needs more time. This series applies to drm-misc-next at 0a260e731d6c. Tested and works, but I get a lot of WARN_ON(bo->pin_count)) from ttm_bo_release() for the VCN ring of amdgpu. Cc: Alexander Deucher Cc: Andrey Grodzovsky Cc: Christian König Cc: Daniel Vetter Luben Tuikov (5): drm/scheduler: "node" --> "list" gpu/drm: ring_mirror_list --> pending_list drm/scheduler: Essentialize the job done callback drm/scheduler: Job timeout handler returns status (v2) drm/sched: Make use of a "done" list (v2) drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 8 +- drivers/gpu/drm/etnaviv/etnaviv_sched.c | 10 +- drivers/gpu/drm/lima/lima_sched.c | 4 +- drivers/gpu/drm/panfrost/panfrost_job.c | 9 +- drivers/gpu/drm/scheduler/sched_main.c | 345 +++++++++++--------- drivers/gpu/drm/v3d/v3d_sched.c | 32 +- include/drm/gpu_scheduler.h | 38 ++- 9 files changed, 255 insertions(+), 201 deletions(-)