From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD639C77B6E for ; Wed, 12 Apr 2023 12:11:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbjDLMLh (ORCPT ); Wed, 12 Apr 2023 08:11:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjDLMLg (ORCPT ); Wed, 12 Apr 2023 08:11:36 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6DD2B4; Wed, 12 Apr 2023 05:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681301495; x=1712837495; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ewT/IrLeXzhwmk8e73q3/ULj13sZtuYMfUJ09TlK3Rs=; b=mP7D6/EWOW7Nj1eRrJ251nO0kIpSGJlAVBjYkd9cAOC3vkz/5jRWa6Mq KuTL0W1P/EI2qvVt1OzdWGALYqSSDIZIIPbbkW17rVE5pgnEy7T/SzDDl o8sqAENnxzlPKJ/kcLfdAEIdkKr6JsCmO3aiKk88lNq80w9LYYnKCmNIx DGXvLhgGvlAzilsfSHp9XnHN0vThviQdLhjsrd19/XvxZ/BaKVMhC3nri H2BNdlSw/mWO7O9ip+rwAJrv7GqnV118y/Vj9+8ElHw5i7Uyf5uTCfNtT N5E1UjpAKUYKbykgKg0ylPY4th5C4Hr8+jDQdvWVPkdlvRgbxaoyWPQjy Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="346550590" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="346550590" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 05:11:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="688934157" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="688934157" Received: from amurkovx-mobl.ger.corp.intel.com (HELO [10.213.229.123]) ([10.213.229.123]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 05:11:28 -0700 Message-ID: <98bb3388-d671-dcf3-0247-649a702b5e11@linux.intel.com> Date: Wed, 12 Apr 2023 13:10:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 0/7] drm: fdinfo memory stats To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Rob Clark , dri-devel@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Boris Brezillon , Christopher Healy , Emil Velikov , Rob Clark , Alex Deucher , "open list:RADEON and AMDGPU DRM DRIVERS" , Arunpravin Paneer Selvam , Christian Gmeiner , "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , Evan Quan , Guchun Chen , Hawking Zhang , intel-gfx@lists.freedesktop.org, "open list:DOCUMENTATION" , open list , Mario Limonciello , =?UTF-8?Q?Michel_D=c3=a4nzer?= , Russell King , Sean Paul , Shashank Sharma , Tvrtko Ursulin , YiPeng Chai References: <20230411225725.2032862-1-robdclark@gmail.com> Content-Language: en-US From: Tvrtko Ursulin Organization: Intel Corporation UK Plc In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 12/04/2023 10:34, Christian König wrote: > Am 12.04.23 um 00:56 schrieb Rob Clark: >> From: Rob Clark >> >> Similar motivation to other similar recent attempt[1].  But with an >> attempt to have some shared code for this.  As well as documentation. >> >> It is probably a bit UMA-centric, I guess devices with VRAM might want >> some placement stats as well.  But this seems like a reasonable start. >> >> Basic gputop support: https://patchwork.freedesktop.org/series/116236/ >> And already nvtop support: https://github.com/Syllo/nvtop/pull/204 >> >> [1] https://patchwork.freedesktop.org/series/112397/ > > I think the extra client id looks a bit superfluous since the ino of the > file should already be unique and IIRC we have been already using that one. Do you mean file_inode(struct drm_file->filp)->i_ino ? That one would be the same number for all clients which open the same device node so wouldn't work. I also don't think the atomic_add_return for client id works either, since it can alias on overflow. In i915 I use an xarray and __xa_alloc_cyclic. Regards, Tvrtko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75DA8C77B71 for ; Wed, 12 Apr 2023 12:11:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34BD410E307; Wed, 12 Apr 2023 12:11:37 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 866A610E2A0; Wed, 12 Apr 2023 12:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681301495; x=1712837495; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ewT/IrLeXzhwmk8e73q3/ULj13sZtuYMfUJ09TlK3Rs=; b=mP7D6/EWOW7Nj1eRrJ251nO0kIpSGJlAVBjYkd9cAOC3vkz/5jRWa6Mq KuTL0W1P/EI2qvVt1OzdWGALYqSSDIZIIPbbkW17rVE5pgnEy7T/SzDDl o8sqAENnxzlPKJ/kcLfdAEIdkKr6JsCmO3aiKk88lNq80w9LYYnKCmNIx DGXvLhgGvlAzilsfSHp9XnHN0vThviQdLhjsrd19/XvxZ/BaKVMhC3nri H2BNdlSw/mWO7O9ip+rwAJrv7GqnV118y/Vj9+8ElHw5i7Uyf5uTCfNtT N5E1UjpAKUYKbykgKg0ylPY4th5C4Hr8+jDQdvWVPkdlvRgbxaoyWPQjy Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="346550591" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="346550591" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 05:11:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="688934157" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="688934157" Received: from amurkovx-mobl.ger.corp.intel.com (HELO [10.213.229.123]) ([10.213.229.123]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 05:11:28 -0700 Message-ID: <98bb3388-d671-dcf3-0247-649a702b5e11@linux.intel.com> Date: Wed, 12 Apr 2023 13:10:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 0/7] drm: fdinfo memory stats To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Rob Clark , dri-devel@lists.freedesktop.org References: <20230411225725.2032862-1-robdclark@gmail.com> Content-Language: en-US From: Tvrtko Ursulin Organization: Intel Corporation UK Plc In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:DOCUMENTATION" , open list , =?UTF-8?Q?Michel_D=c3=a4nzer?= , YiPeng Chai , Mario Limonciello , Rob Clark , Guchun Chen , Shashank Sharma , "open list:RADEON and AMDGPU DRM DRIVERS" , Russell King , Arunpravin Paneer Selvam , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , Evan Quan , Sean Paul , Tvrtko Ursulin , Emil Velikov , Christopher Healy , Boris Brezillon , Alex Deucher , freedreno@lists.freedesktop.org, Hawking Zhang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 12/04/2023 10:34, Christian König wrote: > Am 12.04.23 um 00:56 schrieb Rob Clark: >> From: Rob Clark >> >> Similar motivation to other similar recent attempt[1].  But with an >> attempt to have some shared code for this.  As well as documentation. >> >> It is probably a bit UMA-centric, I guess devices with VRAM might want >> some placement stats as well.  But this seems like a reasonable start. >> >> Basic gputop support: https://patchwork.freedesktop.org/series/116236/ >> And already nvtop support: https://github.com/Syllo/nvtop/pull/204 >> >> [1] https://patchwork.freedesktop.org/series/112397/ > > I think the extra client id looks a bit superfluous since the ino of the > file should already be unique and IIRC we have been already using that one. Do you mean file_inode(struct drm_file->filp)->i_ino ? That one would be the same number for all clients which open the same device node so wouldn't work. I also don't think the atomic_add_return for client id works either, since it can alias on overflow. In i915 I use an xarray and __xa_alloc_cyclic. Regards, Tvrtko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE3D8C77B6E for ; Wed, 12 Apr 2023 12:11:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4274410E7A7; Wed, 12 Apr 2023 12:11:38 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 866A610E2A0; Wed, 12 Apr 2023 12:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681301495; x=1712837495; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ewT/IrLeXzhwmk8e73q3/ULj13sZtuYMfUJ09TlK3Rs=; b=mP7D6/EWOW7Nj1eRrJ251nO0kIpSGJlAVBjYkd9cAOC3vkz/5jRWa6Mq KuTL0W1P/EI2qvVt1OzdWGALYqSSDIZIIPbbkW17rVE5pgnEy7T/SzDDl o8sqAENnxzlPKJ/kcLfdAEIdkKr6JsCmO3aiKk88lNq80w9LYYnKCmNIx DGXvLhgGvlAzilsfSHp9XnHN0vThviQdLhjsrd19/XvxZ/BaKVMhC3nri H2BNdlSw/mWO7O9ip+rwAJrv7GqnV118y/Vj9+8ElHw5i7Uyf5uTCfNtT N5E1UjpAKUYKbykgKg0ylPY4th5C4Hr8+jDQdvWVPkdlvRgbxaoyWPQjy Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="346550591" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="346550591" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 05:11:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="688934157" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="688934157" Received: from amurkovx-mobl.ger.corp.intel.com (HELO [10.213.229.123]) ([10.213.229.123]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 05:11:28 -0700 Message-ID: <98bb3388-d671-dcf3-0247-649a702b5e11@linux.intel.com> Date: Wed, 12 Apr 2023 13:10:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Rob Clark , dri-devel@lists.freedesktop.org References: <20230411225725.2032862-1-robdclark@gmail.com> Content-Language: en-US From: Tvrtko Ursulin Organization: Intel Corporation UK Plc In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH v3 0/7] drm: fdinfo memory stats X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:DOCUMENTATION" , open list , =?UTF-8?Q?Michel_D=c3=a4nzer?= , YiPeng Chai , Mario Limonciello , Rob Clark , Guchun Chen , "open list:RADEON and AMDGPU DRM DRIVERS" , Russell King , Arunpravin Paneer Selvam , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , Christian Gmeiner , Evan Quan , Christopher Healy , Alex Deucher , freedreno@lists.freedesktop.org, Hawking Zhang Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 12/04/2023 10:34, Christian König wrote: > Am 12.04.23 um 00:56 schrieb Rob Clark: >> From: Rob Clark >> >> Similar motivation to other similar recent attempt[1].  But with an >> attempt to have some shared code for this.  As well as documentation. >> >> It is probably a bit UMA-centric, I guess devices with VRAM might want >> some placement stats as well.  But this seems like a reasonable start. >> >> Basic gputop support: https://patchwork.freedesktop.org/series/116236/ >> And already nvtop support: https://github.com/Syllo/nvtop/pull/204 >> >> [1] https://patchwork.freedesktop.org/series/112397/ > > I think the extra client id looks a bit superfluous since the ino of the > file should already be unique and IIRC we have been already using that one. Do you mean file_inode(struct drm_file->filp)->i_ino ? That one would be the same number for all clients which open the same device node so wouldn't work. I also don't think the atomic_add_return for client id works either, since it can alias on overflow. In i915 I use an xarray and __xa_alloc_cyclic. Regards, Tvrtko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8DDA3C7619A for ; Wed, 12 Apr 2023 12:11:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AB0FD10E798; Wed, 12 Apr 2023 12:11:38 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 866A610E2A0; Wed, 12 Apr 2023 12:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681301495; x=1712837495; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ewT/IrLeXzhwmk8e73q3/ULj13sZtuYMfUJ09TlK3Rs=; b=mP7D6/EWOW7Nj1eRrJ251nO0kIpSGJlAVBjYkd9cAOC3vkz/5jRWa6Mq KuTL0W1P/EI2qvVt1OzdWGALYqSSDIZIIPbbkW17rVE5pgnEy7T/SzDDl o8sqAENnxzlPKJ/kcLfdAEIdkKr6JsCmO3aiKk88lNq80w9LYYnKCmNIx DGXvLhgGvlAzilsfSHp9XnHN0vThviQdLhjsrd19/XvxZ/BaKVMhC3nri H2BNdlSw/mWO7O9ip+rwAJrv7GqnV118y/Vj9+8ElHw5i7Uyf5uTCfNtT N5E1UjpAKUYKbykgKg0ylPY4th5C4Hr8+jDQdvWVPkdlvRgbxaoyWPQjy Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="346550591" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="346550591" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 05:11:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="688934157" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="688934157" Received: from amurkovx-mobl.ger.corp.intel.com (HELO [10.213.229.123]) ([10.213.229.123]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 05:11:28 -0700 Message-ID: <98bb3388-d671-dcf3-0247-649a702b5e11@linux.intel.com> Date: Wed, 12 Apr 2023 13:10:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 0/7] drm: fdinfo memory stats To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Rob Clark , dri-devel@lists.freedesktop.org References: <20230411225725.2032862-1-robdclark@gmail.com> Content-Language: en-US From: Tvrtko Ursulin Organization: Intel Corporation UK Plc In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:DOCUMENTATION" , open list , =?UTF-8?Q?Michel_D=c3=a4nzer?= , YiPeng Chai , Mario Limonciello , Rob Clark , Guchun Chen , Shashank Sharma , "open list:RADEON and AMDGPU DRM DRIVERS" , Russell King , Arunpravin Paneer Selvam , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , Christian Gmeiner , Evan Quan , Sean Paul , Tvrtko Ursulin , Emil Velikov , Christopher Healy , Boris Brezillon , Alex Deucher , freedreno@lists.freedesktop.org, Hawking Zhang Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On 12/04/2023 10:34, Christian König wrote: > Am 12.04.23 um 00:56 schrieb Rob Clark: >> From: Rob Clark >> >> Similar motivation to other similar recent attempt[1].  But with an >> attempt to have some shared code for this.  As well as documentation. >> >> It is probably a bit UMA-centric, I guess devices with VRAM might want >> some placement stats as well.  But this seems like a reasonable start. >> >> Basic gputop support: https://patchwork.freedesktop.org/series/116236/ >> And already nvtop support: https://github.com/Syllo/nvtop/pull/204 >> >> [1] https://patchwork.freedesktop.org/series/112397/ > > I think the extra client id looks a bit superfluous since the ino of the > file should already be unique and IIRC we have been already using that one. Do you mean file_inode(struct drm_file->filp)->i_ino ? That one would be the same number for all clients which open the same device node so wouldn't work. I also don't think the atomic_add_return for client id works either, since it can alias on overflow. In i915 I use an xarray and __xa_alloc_cyclic. Regards, Tvrtko