Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38240601rwd; Wed, 12 Jul 2023 05:14:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlGhbg8zIQN9HRiu9LQieOSGmVFqpBUzXw/6A06ohKsEOMOVxpcqJgck7yjptWYAavOSl6IM X-Received: by 2002:a05:6a20:7d84:b0:11f:4707:7365 with SMTP id v4-20020a056a207d8400b0011f47077365mr19388392pzj.38.1689164068298; Wed, 12 Jul 2023 05:14:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689164068; cv=none; d=google.com; s=arc-20160816; b=rhKruAAG7mIptbeQjXY18snwqgPsO/aeDdS9VX8I0cAM7pcrFyTzS9KD5OLWBOtqb+ J15OdfCsIU2uRwA7Hy9sMxxx6n/OEmazA+mJOWzerNxkT+rQaI8xdXpL0DG/+kxDBj0a wrZzlLxhXC2ONapM/gQNKSvtyfP9GN9xCEExiI1b6u+O8QN1kJOKEubbiVBE8QDG7YQL z23CsRoZd33GZqUQ/JqK9VAEkHIYzfbiLS1f/6G7HS9K2CuLY/AZFoypqLshAOws1cuR mr99IO7qbQ4Z/itiwvkPcHw4AQRRC1aH6beOc4Gt18xniRVtkF/NOF9eVAxLCNMGpl0W ozyQ== 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=QBFOyXw9f2q7gMcGy8V2TmJQ9/sXiGDfe3C13IUrr8s=; fh=UsT/IYsmrHK8Tj61E3lO7dmEfkPySLWlJpEUULEmP7s=; b=ke5s3FUcqx+t9Y1e0Ppaqn9D3rFbqG+/PXo7JCW/RDkN++LkJRG/abAcTv1RWQAvuU EPkE5hKYNY7oIKbbaE+ZbSnTP9dldhkIrHKZ/NUo0kRdrK8xyRs6cUyoSohdGc3HzdVu CbYrqrnAXpzXGFJZCof/ECkQYcIOOxT6FgMw5H6mRujlUyMKXx6J6KINCJ34ZFgDFsIA 1IllDbLOIntZEw2ZdlfIzFb4ER8NB/gMPm9+L6fAcC93b673wC9TQgci/vBVIrhlfF+E meJQlW75NNNWIcj+GU7PcLz/5icDy6ZSHSfDJjh+BVghiYcvDGMZmdxG/mZE1V08YHta n6jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GaexiT5K; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a17090311c900b001b89b64c0a4si3304001plh.148.2023.07.12.05.14.15; Wed, 12 Jul 2023 05:14:28 -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=GaexiT5K; 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 S233322AbjGLLtP (ORCPT + 99 others); Wed, 12 Jul 2023 07:49:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233341AbjGLLsb (ORCPT ); Wed, 12 Jul 2023 07:48:31 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CE121BCF; Wed, 12 Jul 2023 04:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689162485; x=1720698485; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=75FdISXFIBIdArdQdqTeYKagFkSfhuce1VMLySmuSgc=; b=GaexiT5K53vjhvp4AxIMftCnCf1nQVSmCRxnn5us5VsJvrj0rSr/ZsXZ aAj1ocWxtyKCWAo4D9lv8IIrbzT9QoPD1CyHUZVrEBVQ0Qf/jSCJpIhVZ IKuOKr9+fEVOnqEEaqzq3FBepgakDhV7GgdOUeI5arUqifD9D6/RC9Z8v k5UWNZuqli0H5hsK1OW1QUOwmyM4eQOHmM6XWHeOFIOR16WFUQpbRcaAt BqHmbCPEATLZZADwZLVaSrzAwqTPLvLqQHTVTVN8jxogxaPDI3mg1Drbk wWPkT/ZRPrDNUmUktfd/0inMYQmDPZcKLvXrMZR4wD3RsSn/kvgqYFgqK A==; X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="344469096" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="344469096" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 04:46:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="866094042" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="866094042" Received: from eamonnob-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.213.237.202]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 04:46:24 -0700 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Tejun Heo , Johannes Weiner , Zefan Li , Dave Airlie , Daniel Vetter , Rob Clark , =?UTF-8?q?St=C3=A9phane=20Marchesin?= , "T . J . Mercier" , Kenny.Ho@amd.com, =?UTF-8?q?Christian=20K=C3=B6nig?= , Brian Welty , Tvrtko Ursulin , Aravind Iddamsetty Subject: [PATCH 03/17] drm/i915: Track page table backing store usage Date: Wed, 12 Jul 2023 12:45:51 +0100 Message-Id: <20230712114605.519432-4-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712114605.519432-1-tvrtko.ursulin@linux.intel.com> References: <20230712114605.519432-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 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_BLOCKED,SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 From: Tvrtko Ursulin Account page table backing store against the owning client memory usage stats. Signed-off-by: Tvrtko Ursulin Reviewed-by: Aravind Iddamsetty --- drivers/gpu/drm/i915/gt/intel_gtt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c b/drivers/gpu/drm/i915/gt/intel_gtt.c index 731d9f2bbc56..065099362a98 100644 --- a/drivers/gpu/drm/i915/gt/intel_gtt.c +++ b/drivers/gpu/drm/i915/gt/intel_gtt.c @@ -58,6 +58,9 @@ struct drm_i915_gem_object *alloc_pt_lmem(struct i915_address_space *vm, int sz) if (!IS_ERR(obj)) { obj->base.resv = i915_vm_resv_get(vm); obj->shares_resv_from = vm; + + if (vm->fpriv) + i915_drm_client_add_object(vm->fpriv->client, obj); } return obj; @@ -79,6 +82,9 @@ struct drm_i915_gem_object *alloc_pt_dma(struct i915_address_space *vm, int sz) if (!IS_ERR(obj)) { obj->base.resv = i915_vm_resv_get(vm); obj->shares_resv_from = vm; + + if (vm->fpriv) + i915_drm_client_add_object(vm->fpriv->client, obj); } return obj; -- 2.39.2