From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DDE3191F7C for ; Fri, 3 Jan 2025 10:49:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735901389; cv=none; b=PL0iNynbUqYQIaJlCgK97j6pbKc6VHMXm6V+yzpf0PlgSA/3sT2dijWEMqNPi1H+OcwYvrz7xwAXe9Svr/DJ6OsB9pMHaqmBgE+nEdNSWa3lDUgE/0ZCGiExNRY6RHkX96aRp+rpMSv5tiXgJ1+DNbt/GYcTDXRII57oq/AiJ/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735901389; c=relaxed/simple; bh=s2ZreLfZhDsCIGWk3oy+y7qWmBAt0c1BzC9fzyTLAD8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FYcfYwjBes9n64OqrigM+HU4qNAdEyMEU+JwwTlfUJ5WUx7r9/2RiiP2LmCDadHN/4BRSCNqJjtIgEy0czFK/irf5HRIl09v/xJ2WEK0PtksrDgPfpJplB7LzGSFZGd6PJrjU6Sx1CA05T/tkGe4FiL5v1te5166D+WjwcpvM64= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ursulin.net; spf=none smtp.mailfrom=ursulin.net; dkim=pass (2048-bit key) header.d=ursulin-net.20230601.gappssmtp.com header.i=@ursulin-net.20230601.gappssmtp.com header.b=lyTjRloH; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ursulin.net Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ursulin.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ursulin-net.20230601.gappssmtp.com header.i=@ursulin-net.20230601.gappssmtp.com header.b="lyTjRloH" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-385de9f789cso9092351f8f.2 for ; Fri, 03 Jan 2025 02:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20230601.gappssmtp.com; s=20230601; t=1735901385; x=1736506185; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GNO7aKKRqXB9odYKaekoB8uFFpHAxVlhNSLA5z5NJrQ=; b=lyTjRloHkNtjoms85NQaRHZcXdkOIc6FEKaBvYLdK5VuF1+DlRF8bC8Ocpg5GpHjb3 jz8WPUJ7xgtykCN9AsexFfqX087YbTvvzGBZ5JUAcUoUAdfkeO+1pFwDQB38leUAIi+X C5mx8Rq4PIMsgSo6f1AZ7p8KOc2V6xDL5Q6CMEWsrxlYonwcpP3Qj9tiAqJo8DNcFu4f PlSESCh5XefVKfZpwEz1GjIzpJVyoeX183Pufzfg+L3tyVTNldD0RkG6BLJAJnrJbhgI G3C2FjKcjGKnGXoBPLG37iAfqYr5wcU6hEZUMVAQn4tHTEKGKjHOHFI7SHWVxeOG4F1H wzUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735901385; x=1736506185; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GNO7aKKRqXB9odYKaekoB8uFFpHAxVlhNSLA5z5NJrQ=; b=Gva0CHVY1hG2v1jQ+a4MZmFN+HUL2KaTWkONCF9k2VEzrK3LLmM06Wj4TQh2ZUiCHI i81jGTSqnF6+owVQdh/QQcFS+phGYHnW3/Yv7FN69xMhEk9gbrXly+TfImc2xUHqYLbr rpUALkRS6S1UBLVp98j2Kf/0OdhocEupRgDiRePo295Gg4AzIz3aPm9XdHwelfwbCIh+ 2LN1n5eTlzZShGjAC2HwTpp30zcs45I/5obkshzOuhHvKYk8txs6v5g4UzofWKIBEX3s SWlU8oqeQZltuC8EiSBQo7NBqUIRSh4EfBj8DYq3N5qFp+PyZunW/VeqGVL7X23dUdCx 3zzA== X-Forwarded-Encrypted: i=1; AJvYcCWLn04QOdkYJRimPWNKIBI8lQ966mDYQW5EgHD3BNYC564TIz/bnEGoBI64b1GxKuH37wfBv0HSIc04A7o=@vger.kernel.org X-Gm-Message-State: AOJu0YxHpbZJ1a4pQjQ3q8kYqJzZYEEd84AqzgNOFFNZ/Y4tiLsRNYv7 +ydvk+9kMC5lw4hvFFEBBh/LhST3eIQe4BuIT0Xk4uObtVrXO4tgGlOpnJWG4f4= X-Gm-Gg: ASbGnctQgeGj4Ekq0UyLmmXXnZokf49IQbED89S11iHdDBpmyUae+tIkjbrJwMyfx2y SYzeRKurEcpVRIeKx/kE/o8JM8HCv2Ivy+DNO2UrMfbwE2m6mhRTk14/Gd4kSsoY3Mf2zpGv5zL z96bSCe1IJGnABzyGBTHugBjjllefX6n9ceB9Xk5mBkRf0q2oqgqMQmQdnBq0aZSxyXvsI0YR6C hTflgs0l5f/Flt0D1G972Nx3f9Og6ubXjWPSeR5Cqet3oBavoPBjrH2ceS5cSC3eRIqFEzE X-Google-Smtp-Source: AGHT+IHDTyCOhNnU2/xtmn0I5eiTsC1dXR3CyZAFbua5HLlvBHPxD2jx2jZyDyZbNiLZZ5hPmWjYVA== X-Received: by 2002:a05:6000:1564:b0:38a:624b:e7fe with SMTP id ffacd0b85a97d-38a624bee1bmr7006777f8f.7.1735901384474; Fri, 03 Jan 2025 02:49:44 -0800 (PST) Received: from [192.168.0.101] ([90.241.98.187]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436611ea42esm487087135e9.9.2025.01.03.02.49.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Jan 2025 02:49:44 -0800 (PST) Message-ID: Date: Fri, 3 Jan 2025 10:49:43 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 2/2] Documentation/gpu: Add fdinfo meanings of drm-*-internal memory tags To: =?UTF-8?Q?Adri=C3=A1n_Mart=C3=ADnez_Larumbe?= Cc: Boris Brezillon , Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mihail Atanassov References: <20241218181844.886043-1-adrian.larumbe@collabora.com> <20241218181844.886043-3-adrian.larumbe@collabora.com> <1ef1d07b-bfa9-4e52-bfa0-20f569752701@ursulin.net> <2sb72aco2lc5hlvwn7hpc5k27naep7u2s64lc6qzk4ruy6jkhd@c2dfhvhe76yt> Content-Language: en-GB From: Tvrtko Ursulin In-Reply-To: <2sb72aco2lc5hlvwn7hpc5k27naep7u2s64lc6qzk4ruy6jkhd@c2dfhvhe76yt> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 02/01/2025 22:18, Adrián Martínez Larumbe wrote: > On 02.01.2025 21:59, Tvrtko Ursulin wrote: >> >> On 18/12/2024 18:18, Adrián Martínez Larumbe wrote: >>> From: Adrián Larumbe >>> >>> A previous commit enabled display of driver-internal kernel BO sizes >>> through the device file's fdinfo interface. >>> >>> Expand the description of the relevant driver-specific key:value pairs >>> with the definitions of the new drm-*-internal ones. >>> >>> Signed-off-by: Adrián Larumbe >>> Reviewed-by: Mihail Atanassov >>> --- >>> Documentation/gpu/panthor.rst | 14 ++++++++++++++ >>> 1 file changed, 14 insertions(+) >>> >>> diff --git a/Documentation/gpu/panthor.rst b/Documentation/gpu/panthor.rst >>> index 3f8979fa2b86..23aa3d67c9d2 100644 >>> --- a/Documentation/gpu/panthor.rst >>> +++ b/Documentation/gpu/panthor.rst >>> @@ -26,6 +26,10 @@ the currently possible format options: >>> drm-cycles-panthor: 94439687187 >>> drm-maxfreq-panthor: 1000000000 Hz >>> drm-curfreq-panthor: 1000000000 Hz >>> + drm-total-internal: 10396 KiB >>> + drm-shared-internal: 0 >>> + drm-active-internal: 10396 KiB >>> + drm-resident-internal: 10396 KiB >>> drm-total-memory: 16480 KiB >>> drm-shared-memory: 0 >>> drm-active-memory: 16200 KiB >>> @@ -44,3 +48,13 @@ driver by writing into the appropriate sysfs node:: >>> Where `N` is a bit mask where cycle and timestamp sampling are respectively >>> enabled by the first and second bits. >>> + >>> +Possible `drm-*-internal` keys are: `total`, `active`, `resident` and `shared`. >>> +These values convey the sizes of the internal driver-owned shmem BO's that >>> +aren't exposed to user-space through a DRM handle, like queue ring buffers, >>> +sync object arrays and heap chunks. Because they are all allocated and pinned >>> +at creation time, `drm-resident-internal` and `drm-total-internal` should always >>> +be equal. `drm-active-internal` shows the size of kernel BO's associated with >>> +VM's and groups currently being scheduled for execution by the GPU. >>> +`drm-shared-internal` is unused at present, but in the future it might stand for >>> +the size of executable FW regions, since they do not belong to an open file context. >> >> The description is way too specific, too tied to some of the implementations. > > These are panthor-specific key:value pairs. I was in the belief that drivers > could define their own when it suits their interest beyond the DRM-wide ones > defined in the drm-fdinfo spec. > >> I also don't remember that you ever explained why totting up the internal >> objects into existing regions isn't good enough. I keep asking, you keep not >> explaining. Or I missed your emails somehow. > > It's not that it's not good enough, but rather that it cannot be done in the > current state of affairs. drm_show_memory_stats() defines its own > drm_memory_stats struct as an automatic variable so we don't have access to it > from anywhere else in the driver. In a previous revision of the patch series I > had come up with a workaround that would let drivers pass a function pointer to > drm_show_memory_stats() which would gather those numbers in a driver-specific > way, but it didn't seem to get any traction. Side note - i915 and amdgpu manage to do it so it is not that it is not possible. >> And you keep not copying me on the thread. Copying people who expressed >> interest, gave past feedback, etc should be the norm. > > I did not CC you on this series because these are all panthor-specific changes > which do not touch on any DRM fdinfo-wide code, and also because I didn't think > that driver-specific key:value pairs needed the approval of the drm-fdinfo core > maintainers. Ah my bad.. sorry! I saw drm-internal-* and did not spot it is actually *in* panthor.rst. So I think you just need to rename those to panthor- prefix. Same as amdgpu has its own private keys amd-evicted-vram etc. Regards, Tvrtko >> Until we can clarify the above points I don't think this can go in. >> >> Regards, >> >> Tvrtko > > Adrian Larumbe