From patchwork Wed Oct 2 13:16:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthew Brost X-Patchwork-Id: 13819813 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3C2BBCF6D26 for ; Wed, 2 Oct 2024 13:15:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 78A1710E721; Wed, 2 Oct 2024 13:15:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="EhdBKZA6"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3423D10E150; Wed, 2 Oct 2024 13:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727874933; x=1759410933; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7806N7TTHrLydaatWindQwB91JH28YQtm2VGJ+VTbzI=; b=EhdBKZA6Mtzl3cbnVkSawXtQK+stFeCP5hHxJ8RzPf+05ilsibniqZl5 aPSxeLQABGbJN12Pu/PxMUMHh0cdwOsWoQJLkQ5Uh8KbkhiF5nHfxWzW+ M2aDxXdS8P7iOHcxDc305mUvHH1M/3QLqJ2PQoq658pYbqBzn6JtyoxuL DvH3mVK4QH0acs/eEgrOPd5uQT1wIpxmyITly+WM3pyMnMxNCyrZBQk0J 7stKSf2nQTZDOqi+i+uOOZbQZ7HOcZKQmH1PNw+YlZ/XoIdCygbkPbofU abVFGdKfPgsAInzcWeqyb3m78qHJ/B0hBFewXusWE3BYFRiPZXHF85nU9 w==; X-CSE-ConnectionGUID: JqDghPBkR/mJ6g7B8avOVQ== X-CSE-MsgGUID: ad2wEml9Tla3k0LMzfm1AQ== X-IronPort-AV: E=McAfee;i="6700,10204,11213"; a="26834959" X-IronPort-AV: E=Sophos;i="6.11,171,1725346800"; d="scan'208";a="26834959" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2024 06:15:32 -0700 X-CSE-ConnectionGUID: 9hHGMcxXRlq1Ou78KiEliQ== X-CSE-MsgGUID: 8FUJ9YmQR9aDsRVQ8CJEog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,171,1725346800"; d="scan'208";a="111465246" Received: from lstrano-desk.jf.intel.com ([10.54.39.91]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2024 06:15:32 -0700 From: Matthew Brost To: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: dakr@kernel.org, pstanner@redhat.com, ltuikov89@gmail.com Subject: [PATCH v4 1/2] drm/sched: Use drm sched lockdep map for submit_wq Date: Wed, 2 Oct 2024 06:16:38 -0700 Message-Id: <20241002131639.3425022-2-matthew.brost@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241002131639.3425022-1-matthew.brost@intel.com> References: <20241002131639.3425022-1-matthew.brost@intel.com> MIME-Version: 1.0 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Avoid leaking a lockdep map on each drm sched creation and destruction by using a single lockdep map for all drm sched allocated submit_wq. v2: - Use alloc_ordered_workqueue_lockdep_map (Tejun) Cc: Luben Tuikov Cc: Christian König Signed-off-by: Matthew Brost Reviewed-by: Nirmoy Das Acked-by: Danilo Krummrich Reviewed-by: Himal Prasad Ghimiray --- drivers/gpu/drm/scheduler/sched_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 36db5c7736fc..e32b0f7d7e94 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -87,6 +87,12 @@ #define CREATE_TRACE_POINTS #include "gpu_scheduler_trace.h" +#ifdef CONFIG_LOCKDEP +static struct lockdep_map drm_sched_lockdep_map = { + .name = "drm_sched_lockdep_map" +}; +#endif + #define to_drm_sched_job(sched_job) \ container_of((sched_job), struct drm_sched_job, queue_node) @@ -1270,7 +1276,12 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, sched->submit_wq = submit_wq; sched->own_submit_wq = false; } else { +#ifdef CONFIG_LOCKDEP + sched->submit_wq = alloc_ordered_workqueue_lockdep_map(name, 0, + &drm_sched_lockdep_map); +#else sched->submit_wq = alloc_ordered_workqueue(name, 0); +#endif if (!sched->submit_wq) return -ENOMEM;