Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2973769pxm; Mon, 28 Feb 2022 09:31:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdvJThG0H+heXQatOc7tvKeI2Llq0YIDN+1zT4ginto6tbhm6zI+ArVMQzIAXpUr5/Mxgn X-Received: by 2002:a05:6402:358c:b0:412:e44e:f62c with SMTP id y12-20020a056402358c00b00412e44ef62cmr20387443edc.206.1646069466206; Mon, 28 Feb 2022 09:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646069466; cv=none; d=google.com; s=arc-20160816; b=w4Nvjmx+RN7PFFhbaP3G1aI24IGWZztAri1mLPS1mMjKjuVoMWKDyPm/oqWHRaU2+c RJIBmLLsIlLQIm05tj1u9LwEPdpI++4y/rXb+m0BaacCZZcioQRXNdmhwHQAgK+lG/vl 5CKLMboFJ5n881lBTb9yoPx1BwL5Rp59J+F7ablaEaUTa6TUk8A0r8YjMRDtNLzAL1ex VfilmMSO4rzLvN1dp/b/gxYZHgrTMNVQgfAtokzPyTrWtdbZpGO6NlS5SrLd5Vkor0AH A7evPVHAq78ysCPBESa/51RWhOHUtreQn7lZ7uVEqFYdNvGHL+zyj3uMJl4Pl9Vjmb6l scdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aizF1/4lDI+yEy/WBxd8YVF7MFTOczvWHCG6YamD9nM=; b=WAGhMHYcbSZiu4pjoEqBN+YGOmuO6SrjnbFuz31TcReK20D6W3NHNk/Qw3pQKn8KCC 3b3Y6dLA5Td8+5ZIYxJ5CP3KrnDKdLEthiCW3Wp3m/Uahie2ss5F9Y7Wsaohpfg0Awy6 lEr0HeQGHjb1BwCWSMNcugksFlvWNFYQHnHMwFq+oTaCYrMzRy9gWuT2r+0ZWiaSbUNc q3+t2LjBAI3IRw8XVfn7BaQkBPefr93XvppfmrG2NmHAOKwNVwsgins3uj9NvilE6X94 6jdqEaL6l2Z+oFZQjmiM0GYzVbrXIM7btmAKlpHei/r5Fru1RtxYtT2MKfwZLkYbKTdU o5zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="blm/2Rrp"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i21-20020a05640242d500b00412c5f554a7si9197572edc.554.2022.02.28.09.30.43; Mon, 28 Feb 2022 09:31:06 -0800 (PST) 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=@gmail.com header.s=20210112 header.b="blm/2Rrp"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237720AbiB1QBq (ORCPT + 99 others); Mon, 28 Feb 2022 11:01:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232976AbiB1QBo (ORCPT ); Mon, 28 Feb 2022 11:01:44 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D99583025; Mon, 28 Feb 2022 08:01:05 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id o62-20020a1ca541000000b00380e3cc26b7so6376687wme.0; Mon, 28 Feb 2022 08:01:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aizF1/4lDI+yEy/WBxd8YVF7MFTOczvWHCG6YamD9nM=; b=blm/2RrpCx2TsR/aMRP+1EJLebTjElVVfw8i40QiGlQMN6Wi4MltaOd+UtUI+4NfFD OvIwLBmq5XdskxKXmbGsJfayfiwvCeecqgTkJnMpwimuFXPulAUNE5iV9YhTJHFU95qd n8Ndhugd5pEd90a++PIz8mlF56J1Vx6yIEFPX+C6J9mqn75oWffmgBOskCPhEa/qDNwj ZlMyqEqVWCIDC3l31oKWlahqUm6m8aW6WF/ezxGwyoiXUJpvyrkNusfWFeucWTq4hyqF NmcFd8Opv10P0TT05CAnQEmiN4DKlzGYCa/ykxZRnKFOiNgFKfuA0gi+i9kuNYXp58M1 1Pzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aizF1/4lDI+yEy/WBxd8YVF7MFTOczvWHCG6YamD9nM=; b=3wx3XNEpRoy60uY4W1IF0U460VzpM55GDoDJwk5C9fehh4caGZVozBRB0sX0gGogtS regZ7gaS7Pkcl3QLqEKFLhc4rAlgM+H3/CNbc7lVpktekbmn7QjRbW58se/RxpiRgbQm T/J9lzFpBCpvwPhIycPSRb//p90lVPoXFQEJYRF4iHZVJ7iBdk0zK/ar4ECEDQ6Ng5L9 Ykp6l7Xcs9zN2/VICElSPVx/BZHfDpij99A+nBu35DnygpCXoc4DYPjHcb0tRtDfQejr D6YKmd1Et4c5x7MTWdEjhpmV26rg54DXyORTFUhOgREKEwyIjoa6yqQU082PiDaFf12C tlnA== X-Gm-Message-State: AOAM533SsiBOPlre66kGxjc/QTAA04aRqinWVJGpNJHrxyRJwsk989VK 9v8Ixibh5825e1eJNLinmFlbz5LJh4wsceZznos= X-Received: by 2002:a05:600c:25cd:b0:381:4f09:a4b6 with SMTP id 13-20020a05600c25cd00b003814f09a4b6mr8198514wml.44.1646064063544; Mon, 28 Feb 2022 08:01:03 -0800 (PST) MIME-Version: 1.0 References: <20220225202614.225197-1-robdclark@gmail.com> <20220225202614.225197-3-robdclark@gmail.com> In-Reply-To: From: Rob Clark Date: Mon, 28 Feb 2022 08:01:34 -0800 Message-ID: Subject: Re: [PATCH 3/3] drm/msm: Expose client engine utilization via fdinfo To: Tvrtko Ursulin Cc: dri-devel , freedreno , linux-arm-msm , Rob Clark , Sean Paul , Abhinav Kumar , David Airlie , Daniel Vetter , open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, Feb 28, 2022 at 6:33 AM Tvrtko Ursulin wrote: > > > On 25/02/2022 22:14, Rob Clark wrote: > > On Fri, Feb 25, 2022 at 12:25 PM Rob Clark wrote: > >> > >> From: Rob Clark > >> > >> Similar to AMD commit > >> 874442541133 ("drm/amdgpu: Add show_fdinfo() interface"), using the > >> infrastructure added in previous patches, we add basic client info > >> and GPU engine utilisation for msm. > >> > >> Example output: > >> > >> # cat /proc/`pgrep glmark2`/fdinfo/6 > >> pos: 0 > >> flags: 02400002 > >> mnt_id: 21 > >> ino: 162 > >> drm-driver: msm > >> drm-client-id: 7 > >> drm-engine-gpu: 1734371319 ns > >> drm-cycles-gpu: 1153645024 > > Nice, so my vendor agnostic actually worked (with that single fixup of > accounting for the fact pdev tag is optional)? > > > Note that it might be useful to have a standardized way to report # of > > cycles and max freq, so userspace tool can derive %utilization in > > addition to just %busy > > How do you define %utilisation vs %busy - I don't exactly follow since I > see the two as same? so, say you are running at 50% of max clk, and gpu is busy 70% of the time. The utilization is only 35% because the gpu could scale up the clk to get more work done. > Looking at your patch I guess I don't understand the difference between > 'elapsed' and 'cycles' inside your retire_submit(). Both are scoped to a > single context and are not global? If 'elapsed' is time context has > spent on the GPU, cycles isn't the same just in a different unit? Correct, we capture (from GPU cmdstream) two counters both before and after a submit (aka execbuf) runs, one is a fixed-rate counter, which gives us elapsed time. The second is a counter that increments every clk cycle, which gives us the # of cycles. With the two values, we can calculate GPU frequency. BR, -R > Regards, > > Tvrtko >