From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DA682594A8 for ; Fri, 20 Dec 2024 11:12:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734693155; cv=none; b=izqrFskXZzYkFoXvI6FkU166Bmv+0ZRC/8xk36lbr5HLZtJWaWA73cXTpMMZF9Wt0xjfFASd+xsPnlgMQtXdmqvUB4Jx0FICMEL32pgXy823SyNcqIxwi1+aCF0nV8LaGnuIYhgyi+CvVIfLOav1v2LvLDlaN0JmrS4evlAbgyw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734693155; c=relaxed/simple; bh=z0JUlRDxmUalLERSnxasCclUQoxHHuRATLa0ItI7uPk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=O208pSgbgSpWZehWcJxVSoFzzJddvNUlkTQTGveaYaVIjc0I1rwz3OgR4pR58ilVcc3b419goxDhtmKlNwn2buiJ6r+FMGgqt7xYDyYa6us9gz7CbGCCtKqf2B7KJu7tRt1TMc4qYQlPfm9HRAoQMgGzgvBmBEh7K/1OJMO3GQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1F0FA1480; Fri, 20 Dec 2024 03:13:01 -0800 (PST) Received: from [10.1.31.19] (e122027.cambridge.arm.com [10.1.31.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A58673F58B; Fri, 20 Dec 2024 03:12:30 -0800 (PST) Message-ID: <42ec58fd-d570-43a0-b440-cd0983e6d1e9@arm.com> Date: Fri, 20 Dec 2024 11:12:28 +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 1/2] drm/panthor: Expose size of driver internal BO's over fdinfo To: =?UTF-8?Q?Adri=C3=A1n_Larumbe?= , Boris Brezillon , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20241218181844.886043-1-adrian.larumbe@collabora.com> <20241218181844.886043-2-adrian.larumbe@collabora.com> From: Steven Price Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 18/12/2024 19:14, Adrián Larumbe wrote: > On 19.12.2024 02:18, Adrián Martínez Larumbe wrote: >> From: Adrián Larumbe >> >> This will display the sizes of kenrel BO's bound to an open file, which are >> otherwise not exposed to UM through a handle. >> >> The sizes recorded are as follows: >> - Per group: suspend buffer, protm-suspend buffer, syncobjcs >> - Per queue: ringbuffer, profiling slots, firmware interface >> - For all heaps in all heap pools across all VM's bound to an open file, >> record size of all heap chuks, and for each pool the gpu_context BO too. >> >> This does not record the size of FW regions, as these aren't bound to a >> specific open file and remain active through the whole life of the driver. >> >> Signed-off-by: Adrián Larumbe >> Reviewed-by: Liviu Dudau >> --- [...] >> +size_t panthor_heap_pool_size(struct panthor_heap_pool *pool) >> +{ >> + struct panthor_heap *heap; >> + unsigned long i; >> + size_t size = 0; >> + >> + down_read(&pool->lock); >> + xa_for_each(&pool->xa, i, heap) >> + size += heap->chunk_size * heap->chunk_count; >> + up_write(&pool->lock); > > Oh well, just realised I forgot to change this to up_read() so will do in a final revision. With that fixed, feel free to add: Reviewed-by: Steven Price Thanks, Steve