Message ID | 20221019173254.3361334-16-tvrtko.ursulin@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp452787wrs; Wed, 19 Oct 2022 10:39:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4wYnbIwPqUCvqGPUIgmjvyxOeUcJj+dQ51fEDT9lHp/Ltx2BcjAQYMqErTThybj4RNHF8J X-Received: by 2002:a05:6402:51d0:b0:45d:5ba4:c3d2 with SMTP id r16-20020a05640251d000b0045d5ba4c3d2mr8613335edd.132.1666201191843; Wed, 19 Oct 2022 10:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666201191; cv=none; d=google.com; s=arc-20160816; b=STYlht8HuVqASIjuYpl8ne6dGOTJlXC13SDZdWH6FddyfBeLegEPDb+7bRIuNlyRdj SD9p7XNVZcVCEX/M97jEaRt9JrUJD5GxSudjOY/6/tq0foIiLD4KyiHHKi0wQsT4SCBq yZ0DGMyC+Ln3D21XKCD+yA0vcCIlx+LHUbc7wo9aBQVEk8R7UP+2FWITvt0PZ2X92F6Z rz3x9aRTPBbedmToY6kBAXH2wgfyfFgPaCDYq8YOOBeF29+uBuaPFVDHSMPhWJvG0Eef mhA0jqBp16yCXFPmckQij6YdiJAJ1hAoY9yHcrZwsFgOoJ43ahLY11dphEsWg1rmF3Cl MJdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kbfACSa5mB7jyETfg2PTHiogEqnNj2Y9dHr5Ki3RBHA=; b=svP+NcPWyLdgCL2TdpP2gel7p4sN9wpsbmGxQuo7LYWYj3Z4b0IZ7koyzpkaLxDO6a NlNQ+YJ7t1aM8uwN9ScooadukTLn1DvGnLqGf02ADhnKl4J2k8kK5b9mMxvggCDDLiuN P5APzCnX+QuMQvNwzdWmqlsRbz62CCqW9fTUpTnil1ehQX7zFfAPzcLpnazXdLXIpgUj Wjsxor8/9ppRMpjOtiQO9f10MfoXqp1ibI6dzEi0m+tM9Hxr/+nPRTNACNupMvHXuSBC L3OFBSAREErqjDhzOkIW7o+k1Sn8X1A+iaMqeoCUOSelnuqgeRXta1yzlYkg/BobKjr5 JTXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cF7UvkPo; 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 hg7-20020a1709072cc700b0078e1216fb07si2625563ejc.558.2022.10.19.10.39.26; Wed, 19 Oct 2022 10:39:51 -0700 (PDT) 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=cF7UvkPo; 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 S229649AbiJSRfN (ORCPT <rfc822;samuel.l.nystrom@gmail.com> + 99 others); Wed, 19 Oct 2022 13:35:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231526AbiJSReS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Oct 2022 13:34:18 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B43F1C7107; Wed, 19 Oct 2022 10:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666200857; x=1697736857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=U7LArZuNthshDvVK5CBxK7+jHExXUGsLdkjMMWrwBEw=; b=cF7UvkPoaPZs1sLj5+Z8tOqRHRkel9ouohTALHiU9QFb7AfUk3Trfd2K LPx276iMsuVEzA3HiOWz8ox2iSd8Gx4/tnh2u+JQKpL8q3Bit1ntKxibz b2rNz9seQ8ji1VVO9B1anafszowRZeciXIXUxA/czHj7xT2yM9wP4UFbj 6n2gAosJ+GAFzVf8t/hy/5LZV1YbzHBh8M+ZDU9fdR3jP+UP69Pq/hIeH ulKAQDHdou9ToBWFrXrlVgaVReQR+1CrRK627MiIZWcJDaDUb+Dmov7Qn rKxjhD9eeq2t2N1XN0WetSrYEINJSczM9wlyoQdChqAab8dSkpOiBRcom g==; X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="306474591" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="306474591" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 10:34:10 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="607204910" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="607204910" Received: from mjmcener-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.213.233.40]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 10:34:07 -0700 From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> To: Intel-gfx@lists.freedesktop.org Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>, Zefan Li <lizefan.x@bytedance.com>, Dave Airlie <airlied@redhat.com>, Daniel Vetter <daniel.vetter@ffwll.ch>, Rob Clark <robdclark@chromium.org>, =?utf-8?q?St=C3=A9phane_Marchesin?= <marcheu@chromium.org>, "T . J . Mercier" <tjmercier@google.com>, Kenny.Ho@amd.com, =?utf-8?q?Chris?= =?utf-8?q?tian_K=C3=B6nig?= <christian.koenig@amd.com>, Brian Welty <brian.welty@intel.com>, Tvrtko Ursulin <tvrtko.ursulin@intel.com> Subject: [RFC 15/17] drm/i915: Migrate client to new owner on context create Date: Wed, 19 Oct 2022 18:32:52 +0100 Message-Id: <20221019173254.3361334-16-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019173254.3361334-1-tvrtko.ursulin@linux.intel.com> References: <20221019173254.3361334-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HK_RANDOM_ENVFROM,HK_RANDOM_FROM, RCVD_IN_DNSWL_HI,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747138581012972281?= X-GMAIL-MSGID: =?utf-8?q?1747138581012972281?= |
Series |
DRM scheduling cgroup controller
|
|
Commit Message
Tvrtko Ursulin
Oct. 19, 2022, 5:32 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Some usage models pass a drm file descriptor from a creating process to the client which will actually use it. Use the core drm helper on GEM context create to account for this and ensure client's resource usage is tracked in the correct cgroup. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c index 1e29b1e6d186..5f6af306e147 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -69,6 +69,7 @@ #include <linux/nospec.h> #include <drm/drm_cache.h> +#include <drm/drm_clients.h> #include <drm/drm_syncobj.h> #include "gt/gen6_ppgtt.h" @@ -2300,6 +2301,8 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, args->ctx_id = id; drm_dbg(&i915->drm, "HW context %d created\n", args->ctx_id); + drm_clients_migrate(file); + return 0; err_pc: