Hi Sebastian,
I've sent a RFC patch to be reviewed here:
https://lore.kernel.org/linux-can/20231221123703.8170-1-socketcan@xxxxxxxxxxxx/T/#u
I hope your suggestion to use rcu_replace_pointer()
in the implemented way fits the requirements.
Best regards,
Oliver
On 2023-11-30 20:56, Oliver Hartkopp wrote:
Hi Sebastian,
On 30.11.23 17:43, Sebastian Andrzej Siewior wrote:
On 2023-10-31 17:52:47 [+0100], To Oliver Hartkopp wrote:
The point is to replace/ update cf_mod at runtime while following RCU
rules so always either new or the old object is observed. Never an
intermediate step.
Do you want me to take care of it?
Yes, sorry.
In fact I've searched some time what would fit best without getting a
clear picture.
As the changes triggered by the netlink update should come into action
with the next processed CAN frame I have thought about adding a shadow
'mod' structure which is written instantly.
And then a flag could be set, that is switched by the next incoming CAN
frame.
I just would have a problem with performing some memory allocation for
the 'mod' updates which might take some unpredictable time.
If you have some cool ideas please let me know. I'm unsure what is the
most effective and performant approach for this use case.
Many thanks,
Oliver