From patchwork Fri Feb 24 16:25:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 5840 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1010988wrd; Fri, 24 Feb 2023 08:35:44 -0800 (PST) X-Google-Smtp-Source: AK7set/pDE6OzbS/y7niaX/sP1A8P/txxfJlSvTIlvrV3CRrMQMIRkFAPR5d8XfjqqzD3mun3JjQ X-Received: by 2002:a05:6402:8d4:b0:4ad:a70c:e001 with SMTP id d20-20020a05640208d400b004ada70ce001mr15194638edz.21.1677256544217; Fri, 24 Feb 2023 08:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677256544; cv=none; d=google.com; s=arc-20160816; b=Lda2oomiozMm69Yb+g7QXROccKz/r6CMgCcvjYyAi1CtJ576JfdIL5P3xMuCxtJb22 8e9qriRQnhSTrHgBlys1G7W59YKVz2yn3DEk8yjQDoItk8DNr62f2GoJHds2WIya6Fya Sa6eGq5WNI1FVEoiSI6G96Bxy1Jp3pL9PLIJgh3A6+TfFaBoNkdSpWhgYh8XSPUmDrJR 2kW6kZFDjHeyb+YtjGhfMoESfmvoIyGRzGoGkSj30+0HOFMGUog7WZpJtddlIPkUeZGc VJr2QieFnzyPoEMBxtWjBEkWoI0hsoZ+rIrGv/9axjulc1lwmEOVQlmiQhpaPH+QnS8B YqPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=QguJkZec/H5iiT6hdqs1+eHgxQgQi8nKdru/Am3CC9g=; b=Xrv4mb9OoEoWSVvRK8/aNM94sPrkogJ1SUDmuEEoUnpR3+frdPSTe/cwXHPz7pfdXL wXWr0eyxlAlw4GZ4t7O3LMQR9s7ayHBxl5DRms4xIJ/JA5w8pRaf72xJScW374I8zmei LnRHm9qlVEHjPUnsh6/PRLOJ7bVcJHUgDM2J8bd4rH2QtBRfVrBeqcNx4QWxVT76RSAw S7u1ZXepxYGwRdDOVQy9RxLAS0Q8vHd22nO4rxl3EeCuw37OXiZMgjqY7lyChln+SsdW mCgu8G97tqioJy7NlCSK45OmEo7mWAm2xsxhlkviFH2uJXkoL0JIl23ghMbUD7IU66kV H/7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bRXpkdUk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fd9-20020a1709072a0900b008e97f723e53si6428807ejc.782.2023.02.24.08.35.20; Fri, 24 Feb 2023 08:35:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bRXpkdUk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229581AbjBXQ0e (ORCPT + 99 others); Fri, 24 Feb 2023 11:26:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjBXQ0c (ORCPT ); Fri, 24 Feb 2023 11:26:32 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7409D6A7A8 for ; Fri, 24 Feb 2023 08:26:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677255991; x=1708791991; h=from:subject:date:message-id:mime-version: content-transfer-encoding:to:cc; bh=xE62hZCuuriQEbQ2FFx4gL0VaTOn7ilKQuUhaqb1uOM=; b=bRXpkdUklCZG6Crc9EuMkbEcEzGzeDRkNtHPYMnnCsFlM605t9ebRCCU IGM96cq8io+c1xr/xYNHKWROyatoZQJ9U3pLwp8jycQhruBnjMXQrZ2VI gqjDVpv36U4uOUaBnWrd8nDXflYREVZVP0vZJMJPTJ/4F8HV+8cT2Cr0L ieufJpAi430y9NiBXS5hRc8sBECVhAaN9CDEXRBFBUC2qP4TLJb065ffa taoQOXem80oZfg/rSqbFDY21XC5qM+AS+chISa/RDezqJ/C0ZZsyUjzyE W1tD5Lu2jAaWPeZfC3D6UztlzuVxFscjyAx5hyAzI73+fyR3cGGC+Ec3Y w==; X-IronPort-AV: E=McAfee;i="6500,9779,10631"; a="317273320" X-IronPort-AV: E=Sophos;i="5.97,325,1669104000"; d="scan'208";a="317273320" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2023 08:26:15 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10631"; a="705321695" X-IronPort-AV: E=Sophos;i="5.97,325,1669104000"; d="scan'208";a="705321695" Received: from lab-ah.igk.intel.com ([10.102.42.211]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2023 08:26:12 -0800 From: Andrzej Hajda Subject: [PATCH 0/3] drm/i915: track gt->wakerefs Date: Fri, 24 Feb 2023 17:25:40 +0100 Message-Id: <20230224-track_gt-v1-0-0222096fcdc6@intel.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAATl+GMC/x2NUQqAIBAFrxL7nVAWFF0lIlbddAks1oggunvW5 /BmeDckEqYEQ3GD0MmJt5ihLguwAaMnxS4z6Eo3ldatOgTtOvtD1aZx2BuH1nWQdYOJlBGMNnyB 0DL/Lsm37pn5+o/G6XleeKs/TXgAAAA= To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Chris Wilson , Andrzej Hajda , Chris Wilson X-Mailer: b4 0.11.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758730957811636883?= X-GMAIL-MSGID: =?utf-8?q?1758730957811636883?= This patchset extracts i915 rpm wakeref tracking to separate files (patch 1) and then uses it to track GT wakerefs (patch 2). Next step is to use external library lib/ref_track, but this requires some adjustements to the library and will be performed in separate patchset. The patches are taken from internal branch. To: Jani Nikula To: Joonas Lahtinen To: Rodrigo Vivi To: Tvrtko Ursulin To: David Airlie To: Daniel Vetter Cc: linux-kernel@vger.kernel.org Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: Chris Wilson Signed-off-by: Andrzej Hajda --- Andrzej Hajda (1): drm/i915: Correct type of wakeref variable Chris Wilson (2): drm/i915: Separate wakeref tracking drm/i915: Track leaked gt->wakerefs drivers/gpu/drm/i915/Kconfig.debug | 24 ++ drivers/gpu/drm/i915/Makefile | 4 + drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 7 +- .../drm/i915/gem/selftests/i915_gem_coherency.c | 10 +- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 14 +- drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 13 +- drivers/gpu/drm/i915/gt/intel_breadcrumbs_types.h | 3 +- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 4 +- drivers/gpu/drm/i915/gt/intel_engine_types.h | 2 + .../gpu/drm/i915/gt/intel_execlists_submission.c | 2 +- drivers/gpu/drm/i915/gt/intel_gt_pm.c | 10 +- drivers/gpu/drm/i915/gt/intel_gt_pm.h | 38 +++- drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c | 4 +- drivers/gpu/drm/i915/gt/selftest_engine_cs.c | 20 +- drivers/gpu/drm/i915/gt/selftest_gt_pm.c | 5 +- drivers/gpu/drm/i915/gt/selftest_reset.c | 10 +- drivers/gpu/drm/i915/gt/selftest_rps.c | 17 +- drivers/gpu/drm/i915/gt/selftest_slpc.c | 5 +- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 11 +- drivers/gpu/drm/i915/i915_pmu.c | 16 +- drivers/gpu/drm/i915/intel_runtime_pm.c | 244 +++------------------ drivers/gpu/drm/i915/intel_runtime_pm.h | 10 +- drivers/gpu/drm/i915/intel_wakeref.c | 4 + drivers/gpu/drm/i915/intel_wakeref.h | 48 +++- drivers/gpu/drm/i915/intel_wakeref_tracker.c | 234 ++++++++++++++++++++ drivers/gpu/drm/i915/intel_wakeref_tracker.h | 76 +++++++ 26 files changed, 536 insertions(+), 299 deletions(-) --- base-commit: 1ddc2effff762c6a109af52f3c39534c7115aebe change-id: 20230224-track_gt-1b3da8bdacd7 Best regards,