Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp598798lqd; Wed, 24 Apr 2024 11:03:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV5bVSaXhppAWmZWv18dBMRNgqFleKoB5lTX0L4BLuLXeSjm60Qkk7hFJpYPEgbQXKdUMiL0N5/kQylQ4dOMTaDl6QtQ3ffM3taPD6Aug== X-Google-Smtp-Source: AGHT+IGc06+2Oo3b0KKoQK4DrOVmHdU0z2nU94G9Uwu0qOtXZePOKMiudxvCkml/eYmyokH6OaqZ X-Received: by 2002:a17:90a:f484:b0:2ab:926b:7401 with SMTP id bx4-20020a17090af48400b002ab926b7401mr3654529pjb.34.1713981807389; Wed, 24 Apr 2024 11:03:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713981807; cv=pass; d=google.com; s=arc-20160816; b=GrNqhcX2yotcd9AJ0jPCYpnuNvPPRk2U+a5dyJeERE3IBiLzZfBqtCrcRVgdj8b+GI GBaItcMLRvh+8+vjsNq17sRSqjJBfLaa9NVyzZinws+bzP8rKd4ZJJjlO67wrjZzpCyC aTvtolMT0sy1RXbwkHNI+YfhuBzsoELbI/KlkrGG09LhJx8f0pUjFCxBm2leJmV2QnVe oLRFaKW3TwcOFKcaU+P6XjXawytZ7o+tiEFIUBQrhgy0brmQhX0YiCQIWa6HDDWIKpSt 8SKQZobv2gu/zqgTHWaMQz8ojTN8rKDuf6OsGW7zKGYRfedBUY2WYxgR5Up/BLamVHUE ayBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=2l8Y8fUiZcyh4aWmOCcImgpZScg/uC1dLWnSnVLqPHw=; fh=hu4Yj9VFWF7jB3NU7v/EXwctdnjNUPiYVojOg4++4T0=; b=0x9cLSJpzD8258wrY9LjdGIKSinoW+8gTC4mRhGvryvx1x7pThVFuZ5/Ln5caz48T5 /eGQqySt4WFN7Z7pZXUey6qbrTneXnbkgY4stM3jHonz6VUMyb8WYNHiCspeXydTHzGs rXB6N9QWWY8Q5zaERWSb20PIA2daXCEafnVQdUkuBBxLxIGQbiIJWiLbKMF4+SDVq5Z8 wjQCB8QMgvoOHGQh7EqVyEbhcxCcDyHj3jbNaD/2lqEaDboZT3gqIJZbZlJYsjQvzUQ6 u3psIXJtAXsB4Z0Mgn1mAc+utOmlRNk9o8sP2TN0j5mGVBW39I4gOF4tdNe/8S1Ki9Z3 feEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-157404-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t9-20020a17090a448900b002a4ca589e67si13193543pjg.53.2024.04.24.11.03.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 11:03:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157404-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-157404-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 64EA4B22983 for ; Wed, 24 Apr 2024 17:34:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1E3916D4C3; Wed, 24 Apr 2024 17:34:46 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B88A16D30C for ; Wed, 24 Apr 2024 17:34:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713980086; cv=none; b=aUTxKHVqk8rYwML86m4wyjEDT2Vs6xeUB7Z8OSa7T6GenRX62hzBwtIsPTqv5w0N5yuRvpbiqxTKRK3UUSyCn2Nb166G2vazdntu3n+Q21wPDqJ+ynanOJxTEGLuZQOHO+q3/w4L0ozA4I9yEEaCnW8asrrD86nvkn4fwrJRjTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713980086; c=relaxed/simple; bh=0t5zBAwB0yYcTvfpv4eEYbhAtBD/SDq4k781nwZcxtw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ywb0hK35Iu1bVFHmMFCTmxkwZoLTC98JHHsf+u+dClB2LFWbE/5+/mMFNJpHzQHOp9l7yC+BeOnI6wOprF8y5jXdL/nAeFB/HetflOA2aqV137ksEYXrrrKb2gEseSrKJKmfFHkAfAkfgTAEbAVUjUbHhENCVT2Wazk3CfDXLuc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F22A3113E for ; Wed, 24 Apr 2024 10:35:10 -0700 (PDT) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 003C13F7BD for ; Wed, 24 Apr 2024 10:34:42 -0700 (PDT) Date: Wed, 24 Apr 2024 18:34:32 +0100 From: Liviu Dudau To: =?utf-8?Q?Adri=C3=A1n?= Larumbe Cc: Boris Brezillon , Steven Price , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] drm/panthor: Enable fdinfo for memory stats Message-ID: References: <20240423213240.91412-1-adrian.larumbe@collabora.com> <20240423213240.91412-4-adrian.larumbe@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240423213240.91412-4-adrian.larumbe@collabora.com> Hello, On Tue, Apr 23, 2024 at 10:32:36PM +0100, Adrián Larumbe wrote: > When vm-binding an already-created BO, the entirety of its virtual size is > then backed by system memory, so its RSS is always the same as its virtual > size. How is that relevant to this patch? Or to put it differently: how are your words describing your code change here? > > Also, we consider a PRIME imported BO to be resident if its matching > dma_buf has an open attachment, which means its backing storage had already > been allocated. Reviewed-by: Liviu Dudau Best regards, Liviu > > Signed-off-by: Adrián Larumbe > --- > drivers/gpu/drm/panthor/panthor_gem.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c > index d6483266d0c2..386c0dfeeb5f 100644 > --- a/drivers/gpu/drm/panthor/panthor_gem.c > +++ b/drivers/gpu/drm/panthor/panthor_gem.c > @@ -143,6 +143,17 @@ panthor_gem_prime_export(struct drm_gem_object *obj, int flags) > return drm_gem_prime_export(obj, flags); > } > > +static enum drm_gem_object_status panthor_gem_status(struct drm_gem_object *obj) > +{ > + struct panthor_gem_object *bo = to_panthor_bo(obj); > + enum drm_gem_object_status res = 0; > + > + if (bo->base.base.import_attach || bo->base.pages) > + res |= DRM_GEM_OBJECT_RESIDENT; > + > + return res; > +} > + > static const struct drm_gem_object_funcs panthor_gem_funcs = { > .free = panthor_gem_free_object, > .print_info = drm_gem_shmem_object_print_info, > @@ -152,6 +163,7 @@ static const struct drm_gem_object_funcs panthor_gem_funcs = { > .vmap = drm_gem_shmem_object_vmap, > .vunmap = drm_gem_shmem_object_vunmap, > .mmap = panthor_gem_mmap, > + .status = panthor_gem_status, > .export = panthor_gem_prime_export, > .vm_ops = &drm_gem_shmem_vm_ops, > }; > -- > 2.44.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯