From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender6-op-o11.zoho.com (sender6-op-o11.zoho.com [165.173.180.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D7804582EB for ; Tue, 6 Oct 2026 16:46:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.180.11 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791305164; cv=pass; b=u2Xx8kho4kKOJV15HhosDctWfyAmrSG10qt33x8YzXqlYUP6iD4Ffbjg8StqrAU2t3hEU0JN6g6X7s4RMK4aWuaf0H99zewUwWjHCXUoiYubpfRv6sAXAlNP4dR7mBoNiEG7nIUIGB9FoRSJbZvfZGl8iqIksLSeDkcaIk0yY6k= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791305164; c=relaxed/simple; bh=Yns9KY08bSgPGCUVI3bZ4Lr0smenU/gzuYmrSov/zf0=; h=MIME-Version:Content-Type:Subject:From:To:Cc:In-Reply-To: References:Date:Message-Id; b=TWgAglBblKKRJ/+J9tUGDYheyz9+ftpIqf/jjzw/WCNe3wO2daCTjsGnBC9UnLm1a7bRbpFIrLnj8i6l+TtTBtj0GQUZhCcZrrh7TFpxfgX+aSDFIsfSf9SSsWfQPJWy7kV16Bo+GQyUL5Fh/ZGP+ypGF1JZzTILnWgW11QXfQg= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=adrian.larumbe@collabora.com header.b=arwN/oC+; arc=pass smtp.client-ip=165.173.180.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=adrian.larumbe@collabora.com header.b="arwN/oC+" ARC-Seal: i=1; a=rsa-sha256; t=1791305125; cv=none; d=zohomail.com; s=zohoarc; b=c2TC4PTqZRH323aHI0dILtKzGqO85wRWEiI8lkK3pP18nPVFk/mdOn1yiKvAU5YwQBgaiUW00bbf6mPp35mxGMHLavMaAYCSpanMwVHz35UD15RG2xyVleKvtflGsNsEluMiU69pUnGRcUw1hQW1RCm7goYfrZYnAlmIXm+i6YY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791305125; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=l2zvtehZljeKvFWWgwouDexzIcgFx4N1aUEmLfSWmKI=; b=ayvTMeyf68nYVT/YQHOn/ndd4A425vahnWiKBettw5HeWDPSgUn1Oiu+0nIQN01R3M2CKmWsDgOpw3xx6N/y3dq8/6q7MRlORn1QQi827Pr5mf+Sxa5liFMTnDb41V41kwTrNFAfO9IZT5EhsoNMbiPaNLVWv87G6txzBZXJjs0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=adrian.larumbe@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1791305125; s=zohomail; d=collabora.com; i=adrian.larumbe@collabora.com; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Subject:Subject:From:From:To:To:Cc:Cc:In-Reply-To:Date:Date:Message-Id:Message-Id:Reply-To; bh=l2zvtehZljeKvFWWgwouDexzIcgFx4N1aUEmLfSWmKI=; b=arwN/oC+UzNN+yr7pnPYYaytEg2sNHRtlGBTW8yWuB4kke2CQeF20QaRQWeaksZq 42RIrVvw6fzLzEV7k3kkrftgSZExTgsdtiv1hLkzo0d+6FHOlwOh/wtTeZhkN6+2Eak 2IAjYDaD/f7yl7SVt9rG/rS9szm6v2wtUJUALLIU= Received: by smtp.zohomail.com with SMTPS id 1791305124824693.0308961866801; Tue, 6 Oct 2026 09:45:24 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: Re: [PATCH v12 12/15] drm/panfrost: Skip cache flush/invalidate when enabling perfcnt From: =?utf-8?q?Adri=C3=A1n_Larumbe?= To: Steven Price Cc: =?utf-8?q?Adri=C3=A1n_Larumbe?= , Boris Brezillon , Rob Herring , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Faith Ekstrand , "Marty E. Plummer" , Tomeu Vizoso , Eric Anholt , Robin Murphy , Philipp Zabel , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Collabora Kernel Team , Neil Armstrong In-Reply-To: <95174a67-0eee-4bf7-b883-9f1138c74a6f@arm.com> References: <20260929-claude-fixes-v12-0-62beb08de207@collabora.com> <20260929-claude-fixes-v12-12-62beb08de207@collabora.com> <95174a67-0eee-4bf7-b883-9f1138c74a6f@arm.com> Date: Tue, 06 Oct 2026 17:45:19 +0100 Message-Id: <179130511905.1018806.3717655233851799587.b4-reply@b4> X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1722; i=adrian.larumbe@collabora.com; h=from:subject:message-id; bh=Yns9KY08bSgPGCUVI3bZ4Lr0smenU/gzuYmrSov/zf0=; b=owEB7QES/pANAwAKAQ4mfkzuU0M9AcsmYgBqxSWfd2mmenSoSaECoG2tgSFSTNRtwF2PHrVwn DGkLRHFqhmJAbMEAAEKAB0WIQQyQDDowAUXXfk3B6QOJn5M7lNDPQUCasUlnwAKCRAOJn5M7lND PdIEC/9ajqyvZeVMQj8DPD9wjIgwf0/cM+AFNwWR197XHiCbZszIxfkJS6eFq/NoeNCZJgBasBt 9fFk6bFT2ImGVhefcZVLrdrqHOPWjGcgR6dfGbaWmv8yidyt39TbPUByIPl87RGqzAa66rpZN1H ucnMvKpF7gZRJzq4RALrQG0BYRAIYfXjfW/xu17+clps5jkKEzUvd0amX8LrPWOA/4eiqyp08eV WtCG7C+zUxWI4Efm3zCKLpRdKYxOInYTuwhL1xPGb/EZ3/utfEFyQJNf/1QDKgk6XaJ+CFPlqzy Yqm1Pq2nlNvpG1EQizCAF4Rs43rs8UCyQNy17o5+93Kmx1fS4a3mbiEawG9OED4oyXSpHsTuTUx 2OAYegvF7IMNaWR1RTY3WDTmz2bdWqOZBcyB+2ppdu4N3O7yWWO9H0VfDFqv52GP9jGFtmSoPR1 VT1T20LkB9n91NfhFUKzJ4R/XzsbHy5/argdPM0LnrrDIdje0xSkssfKX+4GqrdmdjpEM= X-Developer-Key: i=adrian.larumbe@collabora.com; a=openpgp; fpr=324030E8C005175DF93707A40E267E4CEE53433D On 2026-10-02 16:14:38+01:00, Steven Price wrote: > On 29/09/2026 04:44, Adrián Larumbe wrote: > > > The GPU cache flush/invalidate operation is unnecessary. First off, the > > GPU doesn't read off the perfcnt sample buffer, only writes into it, so > > I don't think this is entirely true. The GPU performance counter unit > only writes the counters that are enabled, counters that share a cache > line but are not enabled are not written by the performance counter > unit, but if the L2 contains that cache line then the write can hit in > the L2 and dirty the entire line including stale data where the > unwritten cache line is. >From the perspective of UM, is it bad if offsets into the perfcnt buffer that stand for counters they did not enable contain undefined values? > The upshot is that if the CPU has cleared a block of memory which the > GPU happens to have cached, then the "unused" counters may end up > showing the old data before the CPU cleared it (if they share a cache > line with an active counter). > > I have to admit it's probably somewhat academic given that Panfrost > doesn't expose the ability to control which counters are enabled... > > Is there a good reason for this patch (i.e. have you seen a performance > problem with doing the invalidate)? Otherwise I'd prefer we keep to the > safe route rather than trying to over optimise cache maintenance. Like Boris said in a later reply, it was mostly about simplifying error handling in the perfcnt enable path. We saw this initial clean being done and thought it wasn't necessary. > Obviously in the fully coherent case the invalidate could be skipped (as > in the next patch). > > Thanks, > Steve