Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3236995rdh; Thu, 28 Sep 2023 06:36:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsihwm+bweW2ClhPIQ2zN16p3CoEXgp04Hx1IysndihJZcmQKDXfitw5Fzjdlzb0sP/xGG X-Received: by 2002:a17:902:ea05:b0:1c4:72c9:64fc with SMTP id s5-20020a170902ea0500b001c472c964fcmr1271636plg.22.1695908161010; Thu, 28 Sep 2023 06:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695908160; cv=none; d=google.com; s=arc-20160816; b=IEpK+L0QCJ/oR9roBX8Nhp4W5Wny+KYrfXWF0MJrxVDHtqSn1Wvhg7R9gzpHk6F2uI wj97JNO/6U0BgHr+eC2J3MUexlPS/AckT7d1dCZsA2pvDKVoKV+MJD3iQwYx8X8k5M6V edk1OYev2GPLWi4FoS7BJcgVES4jW522ETkHv1ipaDHHNxDmuFlaHTJV0PEF8RddBuEw k3vKK939JhWWEV5ZMCAxCphMzs2ZtGXdU/ew2lkZDrmREwAnRd0I0dXdcj0A3XTDfCL/ xA2jdUJFCb2UC/jgpIeir+tZ/iFT4HJOVu2rTuLO1hXtG0dCzVNzUrvhN4/zdzwI0kw3 hi+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=GlE5dX32W5yUJWfld+jeBFVXkEOO/bZcy7YhWfSLWsI=; fh=iE63aS7V1p53rXNbAceeoW63Ki/1UlevUCZQ1/HdOmo=; b=Uqfnq0RF1kLN9cHpkrOuJmzMmjkM6XAVpV0zEyKvAYDaR4/y97j9Nxp4g0Nis1xsBS VMSv6Z36Y/hewSz2UiLhEqpwctdk7dQlqj2wEPUB9l34VZJAw4rriQ8ut8Ra2esFoOb9 DUpPXkPWKM0ItOWYbFnLDxVpAsfe4AGiAjDo9ae+Pa7+G2XmIMf/89gTph4uVN6pXboo 6dWCG62e7ntHuJXrcO5vjTVnewSIuT8StF+p/EmKHWFz9155r0+6V5KPk/bc+EEu8eHu 7yUfxZJi8+IDHuzuV+GjvrmKjM3Ai2AOHNjszMTOCmO7gIrQ09fzO5u9mYv9h2KZxrKl qQYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=CKRSIceL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id b8-20020a170903228800b001c430af53b8si20234190plh.574.2023.09.28.06.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 06:36:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=CKRSIceL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1032E834F74C; Thu, 28 Sep 2023 04:27:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232215AbjI1L1C (ORCPT + 99 others); Thu, 28 Sep 2023 07:27:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232601AbjI1L02 (ORCPT ); Thu, 28 Sep 2023 07:26:28 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49947CFC; Thu, 28 Sep 2023 04:25:00 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 23087660733A; Thu, 28 Sep 2023 12:24:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695900299; bh=hYbCeLnlTSQfRAgC7ALpkheWCkzbYcpdRuwjsO0GqDs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CKRSIceL+5qHqhFGqwgl1BvbRF73hBlPflXssfoTGIkcUTbdjtWBfByxsrM0hcJo6 Q2dbBUhqpO/TYIjcwwtAH41K2gOruB3sRfZYXgzyrN7e6bE6M9qkBxCpABERFusjkf wS/iTamCpvkHOJCk+SfzC66cDmyGOgPNSS8pS8TEk5UhxMylRYD8fzxDMp6TKauKlH 0mAGm/4LSUZEA5xXoXpBQKGwRkAYvbO7u1LRl/AwTfdUSRGWVm0tF31gHAFQ68EynQ yqWL8CNIGCBrts58LWr1C0h5EKVmlSshteK352FmtlUneJ3RgP/EutWTqUhtnSFkyu WoayComFkmNxg== Message-ID: <3fd7e291-4254-c6b3-893a-b8e457cccb58@collabora.com> Date: Thu, 28 Sep 2023 13:24:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH v7 2/5] drm/panfrost: Add fdinfo support GPU load metrics Content-Language: en-US To: =?UTF-8?Q?Adri=c3=a1n_Larumbe?= , maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, robdclark@gmail.com, quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org, sean@poorly.run, marijn.suijten@somainline.org, robh@kernel.org, steven.price@arm.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, healych@amazon.com, kernel@collabora.com, tvrtko.ursulin@linux.intel.com, boris.brezillon@collabora.com References: <20230927213133.1651169-1-adrian.larumbe@collabora.com> <20230927213133.1651169-3-adrian.larumbe@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230927213133.1651169-3-adrian.larumbe@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:27:18 -0700 (PDT) Il 27/09/23 23:29, Adrián Larumbe ha scritto: > The drm-stats fdinfo tags made available to user space are drm-engine, > drm-cycles, drm-max-freq and drm-curfreq, one per job slot. > > This deviates from standard practice in other DRM drivers, where a single > set of key:value pairs is provided for the whole render engine. However, > Panfrost has separate queues for fragment and vertex/tiler jobs, so a > decision was made to calculate bus cycles and workload times separately. > > Maximum operating frequency is calculated at devfreq initialisation time. > Current frequency is made available to user space because nvtop uses it > when performing engine usage calculations. > > It is important to bear in mind that both GPU cycle and kernel time numbers > provided are at best rough estimations, and always reported in excess from > the actual figure because of two reasons: > - Excess time because of the delay between the end of a job processing, > the subsequent job IRQ and the actual time of the sample. > - Time spent in the engine queue waiting for the GPU to pick up the next > job. > > To avoid race conditions during enablement/disabling, a reference counting > mechanism was introduced, and a job flag that tells us whether a given job > increased the refcount. This is necessary, because user space can toggle > cycle counting through a debugfs file, and a given job might have been in > flight by the time cycle counting was disabled. > > The main goal of the debugfs cycle counter knob is letting tools like nvtop > or IGT's gputop switch it at any time, to avoid power waste in case no > engine usage measuring is necessary. > > Add also documentation file explaining the possible values for fdinfo's Also add a documentation file explaining ..... or Moreover, add a documentation file explaining ..... > engine keystrings and Panfrost-specific drm-curfreq- pairs. > > Signed-off-by: Adrián Larumbe > Reviewed-by: Boris Brezillon > Reviewed-by: Steven Price Nitpick apart: Reviewed-by: AngeloGioacchino Del Regno