Linux-Can Archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	linux-can@vger.kernel.org, netdev@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC] Questionable RCU/BH usage in cgw_create_job().
Date: Thu, 21 Dec 2023 13:43:19 +0100	[thread overview]
Message-ID: <0338581d-89f0-4cca-a360-7693a27eba37@hartkopp.net> (raw)
In-Reply-To: <94c27fa1-bf19-48ae-bc20-7530d97bbd5f@hartkopp.net>

Hi Sebastian,

I've sent a RFC patch to be reviewed here:

https://lore.kernel.org/linux-can/20231221123703.8170-1-socketcan@hartkopp.net/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
> 

      reply	other threads:[~2023-12-21 12:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31 11:23 [RFC] Questionable RCU/BH usage in cgw_create_job() Sebastian Andrzej Siewior
2023-10-31 16:14 ` Oliver Hartkopp
2023-10-31 16:52   ` Sebastian Andrzej Siewior
2023-11-30 16:43     ` Sebastian Andrzej Siewior
2023-11-30 19:56       ` Oliver Hartkopp
2023-12-21 12:43         ` Oliver Hartkopp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0338581d-89f0-4cca-a360-7693a27eba37@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=bigeasy@linutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).