From patchwork Fri Feb 21 11:52:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13985287 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 15B71209681; Fri, 21 Feb 2025 11:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740138746; cv=none; b=qL16i77KzyR7m8Lcl6P1LcMXr/E43rtKe7uUSOfgFuLN2rEcCiNLA14Nuixn5e/2nwcGd3hagPcI/+ip8XZHyk1epTgWg87rzt14uit/+VXlf9Q6Kxbpif4GS1V0GqZtlTpyDzAkHRAy6YrMCuOIkuQGq2he13q0Kazo4uYZPJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740138746; c=relaxed/simple; bh=skTq8v46i33/n7jiSOO6gDliigjNOXLxMEJHCcPRx+g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=P5ybjLwKjScV0nXR3HLgIgI/immWY9huN1dMHVHmWBomGIKaaHE23VivOPeSgkMnTRYZFRHe7gVYM/rjobF/GUfZFGLCCzsX/OzKH/OSAMctJQMs8f+xrRqT2U2D4vv6xY8HoFVbTMpdYj4c6IrdYFp9NuAsQAEI/SJlXCzxdro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=cp5zPfN1; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0JsdDxVr; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cp5zPfN1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0JsdDxVr" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1740138743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FnyOGTGILqtoyxYF47Rnj+ZtDSyzv0taY1OiVXpZQ/c=; b=cp5zPfN1l4+/22KuDevrLwmKAiSApYTsP7IoGEeaNW24Ws+J21/eTCpTIERoc+vH0fN4bp +5kBpo6GIcl30Mo3xBwZ2AxCOgT5ybBaYFAM3816by635m6H51zIHy2VXxRv7rusnPNRK8 HxwxSNigngM3JAotqARDG3qMf88weq5B3SXQnqfsl8qxkBlGZAA5o/qO/wIcwpn3kM1D6W aoPHyLNPZG9/V+02fnlza298u8Ea8IE0aMfd0/pNXyXl3cAzxpygUnQLS6o4tWBjLZRLIY Z3xXavKGOYflcqC/IEmDQXv3axhBDPg/4Ab8QjhHMbFY8qJZN3kyyPr4HG9MRA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1740138743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FnyOGTGILqtoyxYF47Rnj+ZtDSyzv0taY1OiVXpZQ/c=; b=0JsdDxVrRO4NXURl/jBEdu1ov5yDgiur/dbDSm2qLPhmGP9biERnG1U4Epx6+tXRigxSBg KdUIAtqrAp+13bBw== To: linux-rdma@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" , Andrew Lunn , Eric Dumazet , Ilias Apalodimas , Jakub Kicinski , Jesper Dangaard Brouer , Leon Romanovsky , Paolo Abeni , Saeed Mahameed , Simon Horman , Tariq Toukan , Thomas Gleixner , Yunsheng Lin , Sebastian Andrzej Siewior Subject: [PATCH net-next 0/2] page_pool: Convert stats to u64_stats_t. Date: Fri, 21 Feb 2025 12:52:19 +0100 Message-ID: <20250221115221.291006-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is a follow-up on https://lore.kernel.org/all/20250213093925.x_ggH1aj@linutronix.de/ to convert the page_pool statistics to u64_stats_t to avoid u64 related problems on 32bit architectures. While looking over it, the comment for recycle_stat_inc() says that it is safe to use in preemptible context. The 32bit update is split into two 32bit writes and if we get preempted in the middle and another one makes an update then the value gets inconsistent and the previous update can overwrite the following. (Rare but still). I don't know if it is ensured that only *one* update can happen because the stats are per-CPU and per NAPI device. But there will be now a warning on 32bit if this is really attempted in preemptible context. Sebastian Andrzej Siewior (2): page_pool: Convert page_pool_recycle_stats to u64_stats_t. page_pool: Convert page_pool_alloc_stats to u64_stats_t. Documentation/networking/page_pool.rst | 4 +- .../ethernet/mellanox/mlx5/core/en_stats.c | 24 ++--- include/linux/u64_stats_sync.h | 5 + include/net/page_pool/types.h | 27 +++--- net/core/page_pool.c | 95 +++++++++++++------ net/core/page_pool_user.c | 22 ++--- 6 files changed, 113 insertions(+), 64 deletions(-)