[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a48f2f20-6aea-400e-a441-7273c5349e2f@intel.com>
Date: Tue, 6 May 2025 11:31:52 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Marc Kleine-Budde <mkl@...gutronix.de>, <netdev@...r.kernel.org>
CC: <davem@...emloft.net>, <kuba@...nel.org>, <linux-can@...r.kernel.org>,
<kernel@...gutronix.de>, Oliver Hartkopp <socketcan@...tkopp.net>, "Sebastian
Andrzej Siewior" <bigeasy@...utronix.de>
Subject: Re: [PATCH net 6/6] can: gw: fix RCU/BH usage in cgw_create_job()
On 5/6/2025 6:56 AM, Marc Kleine-Budde wrote:
> From: Oliver Hartkopp <socketcan@...tkopp.net>
>
> As reported by Sebastian Andrzej Siewior the use of local_bh_disable()
> is only feasible in uni processor systems to update the modification rules.
> The usual use-case to update the modification rules is to update the data
> of the modifications but not the modification types (AND/OR/XOR/SET) or
> the checksum functions itself.
>
> To omit additional memory allocations to maintain fast modification
> switching times, the modification description space is doubled at gw-job
> creation time so that only the reference to the active modification
> description is changed under rcu protection.
>
> Rename cgw_job::mod to cf_mod and make it a RCU pointer. Allocate in
> cgw_create_job() and free it together with cgw_job in
> cgw_job_free_rcu(). Update all users to dereference cgw_job::cf_mod with
> a RCU accessor and if possible once.
>
> [bigeasy: Replace mod1/mod2 from the Oliver's original patch with dynamic
> allocation, use RCU annotation and accessor]
>
> Reported-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> Closes: https://lore.kernel.org/linux-can/20231031112349.y0aLoBrz@linutronix.de/
> Fixes: dd895d7f21b2 ("can: cangw: introduce optional uid to reference created routing jobs")
> Tested-by: Oliver Hartkopp <socketcan@...tkopp.net>
> Signed-off-by: Oliver Hartkopp <socketcan@...tkopp.net>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> Link: https://patch.msgid.link/20250429070555.cs-7b_eZ@linutronix.de
> Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Powered by blists - more mailing lists