From nobody Sat Feb 7 21:16:14 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 196171C8621 for ; Wed, 5 Mar 2025 17:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741195628; cv=none; b=piQi0ZaZVQKEigdragmBhG46PgE4vvhzGQRS1xp5dAdrEfpR4WJq7BAotnAlKSEQ3ZhEsFG4iZ8p+tMKRALU3w+OGXQcsGkhDru0qwixWkgCphOKtfrZvKZdJ4zi2BmHfAUvCcJpn3eWntgZ98zvAyxvufG6v2lqNXgJmiivVtg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741195628; c=relaxed/simple; bh=Bjv67NV0vqUGZ1Eg4oFhN3EOv38dSJ8PNXM5R6Kdd4w=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=oII//4bu7HWwpKhEhVIHu5LQn03PeY9WWyNzj9zb9Y2qnUrDIJnWgaGr4e3/5HmL5HT+stD6CO7XvfsVcj2hfMxd9cItgtdg6nnvinBCWDA+GYRhueYPjG0/HxqH+CWJSs93SwXzpNejz+X3yK4sATe88C8WwmUYWHnfvWL7lWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gTibSRTJ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gTibSRTJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741195624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=eBaigGq29QlHrfPkk/jVENWmbj/dHMLv3AXbwfIpCa8=; b=gTibSRTJDyoTJnaFLqMi6AMoYH4+AtJfTIbiRD7WyVPWOa8OtJwF2XPBNOZdAE2rsgvf6D arPTS/dsc+mgUXrnPb58P3pSP2//2cB9vIZ8yCKKrOgaDepqJT4U7dMKdtpFY5zUEjsEp5 48E/sG1FdbmGe8CMPsATZrK5NJ7CcJg= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-GrNdL5I2McaZBuGoedLFng-1; Wed, 05 Mar 2025 12:27:02 -0500 X-MC-Unique: GrNdL5I2McaZBuGoedLFng-1 X-Mimecast-MFC-AGG-ID: GrNdL5I2McaZBuGoedLFng_1741195620 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5185619560BC; Wed, 5 Mar 2025 17:26:59 +0000 (UTC) Received: from localhost (unknown [10.22.80.126]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1ACA0180035E; Wed, 5 Mar 2025 17:26:57 +0000 (UTC) Date: Wed, 5 Mar 2025 14:26:51 -0300 From: "Luis Claudio R. Goncalves" To: LKML , linux-rt-users , stable-rt , Steven Rostedt , Thomas Gleixner , Carsten Emde , Sebastian Andrzej Siewior , Daniel Wagner , Tom Zanussi , Clark Williams , Mark Gross , Pavel Machek , Jeff Brady , Jan Kiszka , Luis Goncalves Subject: [ANNOUNCE] 5.10.234-rt127 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hello RT-list! I'm pleased to announce the 5.10.234-rt127 stable release. This release is an RT-only update. All the changes here are specific to RT. You can get this release via the git tree at: git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git branch: v5.10-rt Head SHA1: 0e289516823b672c36607b928401d426b8d7a08d Or to build 5.10.234-rt127 directly, the following patches should be applie= d: https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.tar.xz https://www.kernel.org/pub/linux/kernel/v5.x/patch-5.10.234.xz https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patch-5.10= .234-rt127.patch.xz Signing key fingerprint: 9354 0649 9972 8D31 D464 D140 F394 A423 F8E6 7C26 All keys used for the above files and repositories can be found on the following git repository: git://git.kernel.org/pub/scm/docs/kernel/pgpkeys.git Enjoy! Luis Changes from v5.10.234-rt126: --- Ahmed S. Darwish (1): u64_stats: Introduce u64_stats_set() Luis Claudio R. Goncalves (2): rt: fix build issue in at_hdmac Linux 5.10.234-rt127 Sebastian Andrzej Siewior (1): netfilter: nft_counter: Use u64_stats_t for statistic. --- drivers/dma/at_hdmac.c | 12 ++++--- include/linux/u64_stats_sync.h | 10 ++++++ localversion-rt | 2 +- net/netfilter/nft_counter.c | 78 ++++++++++++++++++++++----------------= ---- 4 files changed, 59 insertions(+), 43 deletions(-) --- diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 6a4f9697b574..bdbd85adeea9 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -483,8 +483,10 @@ static void atc_advance_work(struct at_dma_chan *atcha= n) dev_vdbg(chan2dev(&atchan->chan_common), "advance_work\n"); =20 spin_lock_irqsave(&atchan->lock, flags); - if (atc_chan_is_enabled(atchan) || list_empty(&atchan->active_list)) - return spin_unlock_irqrestore(&atchan->lock, flags); + if (atc_chan_is_enabled(atchan) || list_empty(&atchan->active_list)) { + spin_unlock_irqrestore(&atchan->lock, flags); + return; + } =20 desc =3D atc_first_active(atchan); /* Remove the transfer node from the active list. */ @@ -1477,8 +1479,10 @@ static void atc_issue_pending(struct dma_chan *chan) dev_vdbg(chan2dev(chan), "issue_pending\n"); =20 spin_lock_irqsave(&atchan->lock, flags); - if (atc_chan_is_enabled(atchan) || list_empty(&atchan->queue)) - return spin_unlock_irqrestore(&atchan->lock, flags); + if (atc_chan_is_enabled(atchan) || list_empty(&atchan->queue)) { + spin_unlock_irqrestore(&atchan->lock, flags); + return; + } =20 desc =3D atc_first_queued(atchan); list_move_tail(&desc->desc_node, &atchan->active_list); diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h index f23192d55528..af6fc08d2fca 100644 --- a/include/linux/u64_stats_sync.h +++ b/include/linux/u64_stats_sync.h @@ -83,6 +83,11 @@ static inline u64 u64_stats_read(const u64_stats_t *p) return local64_read(&p->v); } =20 +static inline void u64_stats_set(u64_stats_t *p, u64 val) +{ + local64_set(&p->v, val); +} + static inline void u64_stats_add(u64_stats_t *p, unsigned long val) { local64_add(val, &p->v); @@ -104,6 +109,11 @@ static inline u64 u64_stats_read(const u64_stats_t *p) return p->v; } =20 +static inline void u64_stats_set(u64_stats_t *p, u64 val) +{ + p->v =3D val; +} + static inline void u64_stats_add(u64_stats_t *p, unsigned long val) { p->v +=3D val; diff --git a/localversion-rt b/localversion-rt index a44fd6cdf249..c85940d40a67 100644 --- a/localversion-rt +++ b/localversion-rt @@ -1 +1 @@ --rt126 +-rt127 diff --git a/net/netfilter/nft_counter.c b/net/netfilter/nft_counter.c index ea102b9a168b..79508b5f71d1 100644 --- a/net/netfilter/nft_counter.c +++ b/net/netfilter/nft_counter.c @@ -8,13 +8,18 @@ #include #include #include -#include +#include #include #include #include #include =20 struct nft_counter { + u64_stats_t bytes; + u64_stats_t packets; +}; + +struct nft_counter_tot { s64 bytes; s64 packets; }; @@ -23,25 +28,24 @@ struct nft_counter_percpu_priv { struct nft_counter __percpu *counter; }; =20 -static DEFINE_PER_CPU(seqcount_t, nft_counter_seq); +static DEFINE_PER_CPU(struct u64_stats_sync, nft_counter_sync); =20 static inline void nft_counter_do_eval(struct nft_counter_percpu_priv *pri= v, struct nft_regs *regs, const struct nft_pktinfo *pkt) { + struct u64_stats_sync *nft_sync; struct nft_counter *this_cpu; - seqcount_t *myseq; =20 local_bh_disable(); this_cpu =3D this_cpu_ptr(priv->counter); - myseq =3D this_cpu_ptr(&nft_counter_seq); - - write_seqcount_begin(myseq); + nft_sync =3D this_cpu_ptr(&nft_counter_sync); =20 - this_cpu->bytes +=3D pkt->skb->len; - this_cpu->packets++; + u64_stats_update_begin(nft_sync); + u64_stats_add(&this_cpu->bytes, pkt->skb->len); + u64_stats_inc(&this_cpu->packets); + u64_stats_update_end(nft_sync); =20 - write_seqcount_end(myseq); local_bh_enable(); } =20 @@ -64,17 +68,16 @@ static int nft_counter_do_init(const struct nlattr * co= nst tb[], if (cpu_stats =3D=3D NULL) return -ENOMEM; =20 - preempt_disable(); - this_cpu =3D this_cpu_ptr(cpu_stats); + this_cpu =3D raw_cpu_ptr(cpu_stats); if (tb[NFTA_COUNTER_PACKETS]) { - this_cpu->packets =3D - be64_to_cpu(nla_get_be64(tb[NFTA_COUNTER_PACKETS])); + u64_stats_set(&this_cpu->packets, + be64_to_cpu(nla_get_be64(tb[NFTA_COUNTER_PACKETS]))); } if (tb[NFTA_COUNTER_BYTES]) { - this_cpu->bytes =3D - be64_to_cpu(nla_get_be64(tb[NFTA_COUNTER_BYTES])); + u64_stats_set(&this_cpu->bytes, + be64_to_cpu(nla_get_be64(tb[NFTA_COUNTER_BYTES]))); } - preempt_enable(); + priv->counter =3D cpu_stats; return 0; } @@ -102,40 +105,41 @@ static void nft_counter_obj_destroy(const struct nft_= ctx *ctx, } =20 static void nft_counter_reset(struct nft_counter_percpu_priv *priv, - struct nft_counter *total) + struct nft_counter_tot *total) { + struct u64_stats_sync *nft_sync; struct nft_counter *this_cpu; - seqcount_t *myseq; =20 local_bh_disable(); this_cpu =3D this_cpu_ptr(priv->counter); - myseq =3D this_cpu_ptr(&nft_counter_seq); + nft_sync =3D this_cpu_ptr(&nft_counter_sync); + + u64_stats_update_begin(nft_sync); + u64_stats_add(&this_cpu->packets, -total->packets); + u64_stats_add(&this_cpu->bytes, -total->bytes); + u64_stats_update_end(nft_sync); =20 - write_seqcount_begin(myseq); - this_cpu->packets -=3D total->packets; - this_cpu->bytes -=3D total->bytes; - write_seqcount_end(myseq); local_bh_enable(); } =20 static void nft_counter_fetch(struct nft_counter_percpu_priv *priv, - struct nft_counter *total) + struct nft_counter_tot *total) { struct nft_counter *this_cpu; - const seqcount_t *myseq; u64 bytes, packets; unsigned int seq; int cpu; =20 memset(total, 0, sizeof(*total)); for_each_possible_cpu(cpu) { - myseq =3D per_cpu_ptr(&nft_counter_seq, cpu); + struct u64_stats_sync *nft_sync =3D per_cpu_ptr(&nft_counter_sync, cpu); + this_cpu =3D per_cpu_ptr(priv->counter, cpu); do { - seq =3D read_seqcount_begin(myseq); - bytes =3D this_cpu->bytes; - packets =3D this_cpu->packets; - } while (read_seqcount_retry(myseq, seq)); + seq =3D u64_stats_fetch_begin(nft_sync); + bytes =3D u64_stats_read(&this_cpu->bytes); + packets =3D u64_stats_read(&this_cpu->packets); + } while (u64_stats_fetch_retry(nft_sync, seq)); =20 total->bytes +=3D bytes; total->packets +=3D packets; @@ -146,7 +150,7 @@ static int nft_counter_do_dump(struct sk_buff *skb, struct nft_counter_percpu_priv *priv, bool reset) { - struct nft_counter total; + struct nft_counter_tot total; =20 nft_counter_fetch(priv, &total); =20 @@ -235,7 +239,7 @@ static int nft_counter_clone(struct nft_expr *dst, cons= t struct nft_expr *src, g struct nft_counter_percpu_priv *priv_clone =3D nft_expr_priv(dst); struct nft_counter __percpu *cpu_stats; struct nft_counter *this_cpu; - struct nft_counter total; + struct nft_counter_tot total; =20 nft_counter_fetch(priv, &total); =20 @@ -243,11 +247,9 @@ static int nft_counter_clone(struct nft_expr *dst, con= st struct nft_expr *src, g if (cpu_stats =3D=3D NULL) return -ENOMEM; =20 - preempt_disable(); - this_cpu =3D this_cpu_ptr(cpu_stats); - this_cpu->packets =3D total.packets; - this_cpu->bytes =3D total.bytes; - preempt_enable(); + this_cpu =3D raw_cpu_ptr(cpu_stats); + u64_stats_set(&this_cpu->packets, total.packets); + u64_stats_set(&this_cpu->bytes, total.bytes); =20 priv_clone->counter =3D cpu_stats; return 0; @@ -279,7 +281,7 @@ static int __init nft_counter_module_init(void) int cpu, err; =20 for_each_possible_cpu(cpu) - seqcount_init(per_cpu_ptr(&nft_counter_seq, cpu)); + u64_stats_init(per_cpu_ptr(&nft_counter_sync, cpu)); =20 err =3D nft_register_obj(&nft_counter_obj_type); if (err < 0)