Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp586541lqo; Thu, 16 May 2024 15:33:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWf1A9x1FwaVJm1Mk6jDgiEws/F1aQpw3+9WzNsynqToNLkKj5huy/dqjS1rbQPGWJ3ieA7eBOFh892q2IAsKlT+wNkWE81rukcKgI1BA== X-Google-Smtp-Source: AGHT+IEnUvhDJ1Wib8gFTYKBDoaZeeZmVodd6+BkuqK0mlettHwZyqHpEbyzDb97FZx5rlz2ufld X-Received: by 2002:aa7:88d1:0:b0:6ea:c43c:a650 with SMTP id d2e1a72fcca58-6f4e03a164dmr23450664b3a.32.1715898830772; Thu, 16 May 2024 15:33:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715898830; cv=pass; d=google.com; s=arc-20160816; b=LNWQQtgfeSozLhawz6vTfzTnKC8pHXvoiWdbm0B4Shsr0ctMZ7+ij143ECcrErPZF2 LkHUNdPw9i+SJaQ+naY7XVuhLowK0rXxmXV+EEp/n/wEJJUU9rQ+zRMAdK0iuMNxCooI pcm539WTGIYE8Ib2crkGeHmepdehaeJu0bRn8aq2RHZ3TK1TQCcLnq5YtT+/u1Kw4qfO Ftr7kvFAw8uS8iF3PDHt7/WKuxU2an7l9XAFCno+tLfdOqO5E1prT82783TvbMoaRoHE nw5/9GaYpiYJgvQo7pTUjTdT3mVRJ+2WdLteQbeDT91WNngNd2TD2IXxL1Ozx0XhAV9S 3GEA== 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:dkim-signature; bh=C7zqviLbdOjOGJL88RqFKwH6zz/tNpKjFtsZOZ4YR5s=; fh=fVqsGmWab9tib98Fev6Kg9JGME++9Eyl8Z0bktTRvoM=; b=toMd/zTxiZNwBoyTOIMUpH6nzduhmwbZRXT6X7Cfn41HG2uue9Y5EXuvRuiHmL0DGA EMTBk/dvZqRouKfkBYm8O3Kx19rBPJvG2BUlZdus+zE7lDIv3f0bh/qt8wsZAAzyhTk8 1amvJAFcBAkIvUW1x7rPeZBnPifGhRrMD5vfEZo51lc+KdgFvu4fO+rtAIUQLgQ/CGrq bOsrpIlJmd6CeO4iwj4YbLplAKchnrvIzTy7Hs4DtPM1xDv76VO7OQB7aruQZlknraNc 4J8qrlHAVTop5t1Ot1Z+OwEn4zBqGlIrt3r3JTUmhdIh3FBjFPeT1h3FJVlv+5XcY+yZ r0XA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cAJw7pGS; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-181611-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181611-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-65832844a83si2965141a12.657.2024.05.16.15.33.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 15:33:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181611-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cAJw7pGS; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-181611-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181611-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3945028376E for ; Thu, 16 May 2024 22:33:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 526B11EB2B; Thu, 16 May 2024 22:33:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="cAJw7pGS" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E04051799B for ; Thu, 16 May 2024 22:33:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715898824; cv=none; b=BiUWC5xGswpQ0rV5HO1fYPcHT3aDgC40L51lcrYKTR+izU9u1N9tWIorG9F95q+HekQC91hToOgMl7AoTQX/+4J9UpFbsCgUcjCR53/9V+RvUXBG9tgziDy4O/kzQybj37S75eLp0a1d1+igYdShADXSiMkEO/BQ0KttZ/MBEEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715898824; c=relaxed/simple; bh=fEbX+7ylWqAIZwkFyJWk3fwrpqNblL72bxWRqduXUxE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZwxE1B7erqm9WjKmonMP61VIk9+NwRm1MOFu2OJFxJCVezI4rBqgokmbH3A25WOyicICdVLwaDCAdQHJkGMNtvdU0OLb6Q6oMNNz/NnecwRJZP1bCnhCCYwy0mP8ROW9X1DVGhrRpxygzA9EhiV/TGijUzGeF0cp1ptYGbsRw9U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=cAJw7pGS; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1715898821; bh=fEbX+7ylWqAIZwkFyJWk3fwrpqNblL72bxWRqduXUxE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cAJw7pGS7pPdPtQ50YTVb2xcfEYvPH0HyhvbVrebtFFvf/w0Fr09nLNoqO8IXQMmt b2fKlNn2efiah8db6Cum4qrnugXup+HiOspxIFEG8sT8WPjzlOR72rN7n24M0SNC43 /VeyhULkNtguIsx5ABXOIpmPeTZQRLxW2347+dO0xmSVd43NtOydfMJCkudFXKyc3l iSth3ioiebD0lP3zVbVItwi5aj65F3s8F0SZZdBD0+baPxwj710PABw39IzNvlHanp qTDCONsNpIoh0vJBrN8JlAoi3j9DrcbykWA0FIedN8UETTWK1Edbo5blucsXfaM1N5 uowUlW4DhiDmw== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: alarumbe) by madrid.collaboradmins.com (Postfix) with ESMTPSA id BD8183782190; Thu, 16 May 2024 22:33:40 +0000 (UTC) Date: Thu, 16 May 2024 23:33:40 +0100 From: =?utf-8?Q?Adri=C3=A1n?= Larumbe To: Liviu Dudau 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: On 24.04.2024 18:34, Liviu Dudau wrote: > 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? I think I wrote this as a throw-back to the time when we handled RSS calculations for Panfrost objects, because heap BO's would be mapped on demand at every page fault. I understand that without mention of this the remark seems out of context, so depending on your taste I can either expand the message to underline this, or perhaps drop it altogether. I think I'd rather go for the latter, since the fact that panthor_gem_funcs includes no binding for drm_gem_object_funcs::rss() should be enough of a hint at this. > > > > 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 > > Adrian Larumbe